videoeditorengine/vedengine/GenManip/inc/DCSharpening.h
changeset 0 951a5db380a0
equal deleted inserted replaced
-1:000000000000 0:951a5db380a0
       
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "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 * Ixonos Plc
       
    14 *
       
    15 * Description:  
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 //----IMAAMI----
       
    21 //*************************************************************************
       
    22 //DCSharpening.h
       
    23 //
       
    24 //Version 1.00
       
    25 //
       
    26 //Contains:
       
    27 //	DCSharpening 
       
    28 //		Sharpening using IMAAMI algorithm.
       
    29 //			
       
    30 //History:
       
    31 //	19.08.2003 version 1.00 created using existing IMAAMI algorithms	
       
    32 //*************************************************************************
       
    33 
       
    34 #ifndef __DCSharpening_H
       
    35 #define __DCSharpening_H
       
    36 
       
    37 #include <e32std.h> // for Fundamental Types
       
    38 #include <e32base.h> // for Fundamental Types
       
    39 #include "DCInit.h"
       
    40 
       
    41 //Adjust to proper signal range (10 bits)
       
    42 #define ADJUST_RANGE_TO_10BITS(value) ((value) < 0) ? 0 : ((value) > 1023) ? 1023 : (value)
       
    43 
       
    44 
       
    45 //Class definition
       
    46 class DCSharpening : public CBase
       
    47 {
       
    48 public:
       
    49 
       
    50 	//parameters
       
    51 	struct DCSharpeningParams
       
    52 	{
       
    53 		TUint SHARP_OVER;
       
    54 		TUint SHARP_DZONE;
       
    55 		TReal SHARP_GAIN;
       
    56 	};
       
    57 
       
    58 	DCSharpening();
       
    59 	static DCSharpening* NewL();
       
    60 	static DCSharpening* NewLC();
       
    61 	~DCSharpening();
       
    62 	
       
    63 	// Second Phase contructor (may leave)
       
    64 	void ConstructL();
       
    65 	
       
    66 	//Process original image and store result
       
    67 	void ProcessL(CFbsBitmap* aBPtr);
       
    68 	
       
    69 	//Set processing parameters
       
    70 	void SetParameters(DCSharpeningParams* params);
       
    71 
       
    72 	//Get current processing parameters
       
    73 	void GetParameters(DCSharpeningParams* params);
       
    74 
       
    75 	
       
    76 	//Limit integer value to byte [0,255]
       
    77 	static inline TUint8 Limit255(TInt i) {
       
    78 		return (TUint8)(i<0?0:(i>255?255:i));
       
    79 	}
       
    80 	
       
    81 	
       
    82 private:
       
    83 	
       
    84 	//Processing parameters
       
    85 	DCSharpeningParams iParameters;
       
    86 
       
    87 	//Line Buffer and pointer
       
    88 	HBufC8*	iScanLine;
       
    89 	HBufC8*	iPrevScanLine;
       
    90 	HBufC8*	iPrevPrevScanLine;
       
    91 	HBufC8*	iNextScanLine;
       
    92 	HBufC8*	iNextNextScanLine;
       
    93 
       
    94 	//Sharpening functions from IMAAMI
       
    95 	TInt Peak(TInt aA, TInt aB, TInt aC, TInt aD, TInt aE, TInt aF, TInt aG, TInt aH, TInt aO);
       
    96 	TInt Median3(TInt aA, TInt aB, TInt aC);
       
    97 	void findMinMax4(TInt A, TInt B, TInt C, TInt D, TInt *min, TInt *max);
       
    98 
       
    99 	//Processing parameters for stretch
       
   100 	TInt iGain;
       
   101 };
       
   102 
       
   103 #endif // ifndef __DCSharpening_H
       
   104 //----IMAAMI----