mmserv/thumbnailengine/ImaamiInc/DCIetd.h
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   
       
    15 *	CDCIETD 
       
    16 *		Display specific color contrast enhancement, 
       
    17 *		Image Enhancement for Transflective Displays version 2,
       
    18 *		IETD 2.
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 #ifndef  __DCIetd_H__
       
    24 #define  __DCIetd_H__
       
    25 
       
    26 //  INCLUDES
       
    27 
       
    28 #ifndef   __E32STD_H__
       
    29 #include  <e32std.h>   // for Fundamental Types
       
    30 #endif // __E32STD_H__
       
    31 
       
    32 #ifndef   __E32BASE_H__
       
    33 #include  <e32base.h>  // for CBase
       
    34 #endif // __E32BASE_H__
       
    35 
       
    36 //Default parameters
       
    37 #include "DCInit.h"
       
    38 
       
    39 
       
    40 //-------------------
       
    41 //  CLASS DEFINITIONS 
       
    42 // CDCIetd - The one and ony class to contain all required methods
       
    43 // to implement DCIetd functionality.
       
    44 class CDCIetd : public CBase
       
    45     {
       
    46     public:     
       
    47 
       
    48 		//Parameter struct
       
    49 		struct DCIetdParameters
       
    50 		{
       
    51 			TUint8 aWhitePixels; 	//Percentage of pixels stretched to maximum value
       
    52 			TUint8 aBlackPixels;	//Percentage of pixels stretched to minimum value
       
    53 			TUint8 aStretchLimit;	//Narrowest histogram to be stretched to full range
       
    54 			TUint8 aSaturationGain;	//Saturation increase gain
       
    55 			TUint8 aBitLimit;		//Minimum number of color values for full gain		
       
    56 			TUint8 aWBC;			//White balance correction limit
       
    57 			TUint8 aDBC;			//Dark balance correction limit
       
    58 		};
       
    59 
       
    60         CDCIetd();				// Constructor
       
    61         static CDCIetd* NewL();	// Factory function NewL
       
    62         static CDCIetd* NewLC();// Factory function NewLC
       
    63         ~CDCIetd();				// Destructor
       
    64         void ConstructL();		// Second Phase contructor (may leave)
       
    65         
       
    66 		// Analyze image referenced by aBPtr
       
    67 		void Analyze(CFbsBitmap& aBPtr);
       
    68 
       
    69 		// Process and store image referenced by aBPtr
       
    70 		void ProcessL(CFbsBitmap& aBPtr);
       
    71 
       
    72 		// Parameter exchange
       
    73 		void SetParams(DCIetdParameters* parameters);
       
    74 		void GetParams(DCIetdParameters* parameters);
       
    75         
       
    76     private:
       
    77 
       
    78 		void GatherHistograms(const CFbsBitmap& aBPtr); // Construct the R, G, and B Histograms
       
    79         void MakeMappings();                            // Calculate the mapping LUTs
       
    80 
       
    81         // Limit integer value to byte [0,255]
       
    82         static inline TUint8 Limit255(TInt i) {return (TUint8)(i<0?0:(i>255?255:i));}
       
    83 
       
    84         TUint    iHistogram[3][256];  // Histogram data
       
    85         TUint8   iMap[3][256];        // Color component mapping funtions
       
    86         HBufC8*  iScanLineBuffer;     // Scan line buffer
       
    87 
       
    88         TUint8 iReducedStretchLimit[3]; //Stretch limits for each component
       
    89 
       
    90 		DCIetdParameters iParameters; //Parameters
       
    91     };
       
    92 
       
    93 #endif // __DCIetd_H__
       
    94             
       
    95 // End of File
       
    96 //----IMAAMI----