Creating Histograms

This document introduces how to create a histogram.

Purpose

This document describes the various APIs used to create a Histogram.

Introduction

You can request histograms for image capture, video capture and viewfinder separately or you can combine viewfinder functionality with image or video capture. Histograms provide information about the exposure of light on a captured frame.

The key classes are described in Histogram Overview.

Creating a Histogram

You can create instance of a histogram class from the following class objects:

  • snapshot

  • image capture

  • video capture

  • version2 direct viewfinder

  • client viewfinder

This provides better handling of histogram features by tying it closely to the given object.

Note:

Client is not allowed to create object of this class directly.

Setup and Configuration Requirements

The following are the setup and configuration requirements you need to follow before Histogram implementation:

Note:

McameraObserver2::HandleEvent will not be used with this class.

Basic Procedure for Creating Histograms

The high level steps to create a histogram are shown here:

Example

The following example illustrates the sequence for creating a histogram:

  1. The following creates the new camera histogram object.

    CCamera* camera;//exists beforehand
    CCamera::CCameraClientViewFinder* clientVF;//exists beforehand
    MCameraObserver* observer2;//exists beforehand
    clientVF  = CCamera::CCameraClientViewFinder::NewL(*camera, *clientVFObserver);    
    CCamera::CCameraV2Histogram* histogram_CVF = clientVF->CreateHistogramHandleL();
  2. Find out about the supported set of values.

    TUint supportedHistogramType=0;
    histogram_CVF->GetSupportedHistogramsL(supportedHistogramType);

    Get the information about direct histograms.

        TBool directHistogramSupported = EFalse;
    histogram_CVF->GetDirectHistogramSupportInfoL(directHistogramSupported);
  3. Prepare the selected or available histogram.

    • direct access

      Camera::CCameraV2Histogram::TDirectHistogramParameters histogramParameters;
      histogram_CVF->PrepareDirectHistogramL(histogramParameters);
    • non direct access

      CCamera::CCameraV2Histogram::THistogramType histogramType = CCamera::CCameraV2Histogram::Eluminance;
      histogram_CVF->PrepareClientHistogramL(histogramType);