skins/AknSkins/rlplugininc/AknsRlEffectPluginContrast.h
changeset 0 05e9090e2422
equal deleted inserted replaced
-1:000000000000 0:05e9090e2422
       
     1 /*
       
     2 * Copyright (c) 2004-2008 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:  Provides functionality adjust image contrast.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef AKNSRLEFFECTPLUGINCONTRAST_H
       
    20 #define AKNSRLEFFECTPLUGINCONTRAST_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include "AknsRlEffectPlugin.h"
       
    24 #include <AknsRlEffect.h>
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 // Effect plugin UID
       
    29 const TInt KAknsRlEffectPluginContrastUID = 0x10204AE1;
       
    30 
       
    31 // Constants for parameter names
       
    32 _LIT( KAknsRlEffectContrastAdjustment, "a" );
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 * Contrast provides functionality adjust image contrast by blending the
       
    38 * original image with medium (127) gray image.
       
    39 *
       
    40 * @since 2.8
       
    41 */
       
    42 NONSHARABLE_CLASS(CAknsRlEffectPluginContrast):
       
    43     public CAknsRlEffectPlugin,
       
    44     public MAknsRlEffect
       
    45     {
       
    46     public: // Constructors and destructor
       
    47 
       
    48         /**
       
    49         * Default constructor.
       
    50         *
       
    51         * @since 2.8
       
    52         */
       
    53         CAknsRlEffectPluginContrast();
       
    54 
       
    55         /**
       
    56         * Destructor.
       
    57         *
       
    58         * @since 2.8
       
    59         */
       
    60         virtual ~CAknsRlEffectPluginContrast();
       
    61 
       
    62     public: // Implementation of CAknsEffectPlugin
       
    63 
       
    64         TUid EffectUid() const;
       
    65         MAknsRlEffect* Effect( const TInt aInterface );
       
    66 
       
    67     public: // Implementation of MAknsRlEffect
       
    68 
       
    69         void InitializeL();
       
    70         void Release();
       
    71 
       
    72         void ActivateL( MAknsRlEffectContext* aContext );
       
    73         void Deactivate();
       
    74 
       
    75         /**
       
    76         * Accepted named parameters:
       
    77         * - "a", integer, adjustment value.
       
    78         *
       
    79         * The normal range of adjustment value is [-255, 255]. Value -255
       
    80         * produces medium gray image, value 255 produces fully contrasted
       
    81         * image. Values outside range [-255, 255] will result in underexposure
       
    82         * and overexposure.
       
    83         *
       
    84         * The default value is 0. With default value the filter produces the
       
    85         * original image.
       
    86         */
       
    87         void SetParametersL( MAknsRlParameterIterator& aParameters );
       
    88 
       
    89         /**
       
    90         * Supported modes:
       
    91         * - EColor64K -> EColor64K
       
    92         * - EColor16MU -> EColor16MU
       
    93         *
       
    94         * Masks are ignored. Target layer and input layer A are both required.
       
    95         */
       
    96         void GetCapabilities( TAknsRlEffectCaps& aCaps );
       
    97 
       
    98         TInt Render( const TAknsRlRenderOpParam& aParam );
       
    99 
       
   100     private:
       
   101 
       
   102         MAknsRlEffectContext* iContext;
       
   103 
       
   104         TInt iAdjustment;
       
   105     };
       
   106 
       
   107 #endif // AKNSRLEFFECTPLUGINCONTRAST_H
       
   108 
       
   109 // End of File