uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10FilterBase.h
changeset 0 15bf7259bb7c
child 29 ac3859d43844
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 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:   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef HUIFXVG10FILTERBASE_H_
       
    21 #define HUIFXVG10FILTERBASE_H_
       
    22 
       
    23 #include "HuiFxFilter.h"
       
    24 #include "HuiFxVg10RenderbufferBase.h"
       
    25 #include "HuiFxVg10.h"
       
    26 #include <e32math.h>
       
    27 
       
    28 // when comparing floating point numbers against zero, if the number is below
       
    29 // EPSILON it's considered zero.
       
    30 const float EPSILON = 0.001;
       
    31 
       
    32 
       
    33 class CHuiFxVg10FilterBase: public CHuiFxFilter
       
    34     {
       
    35 public: // from CHuiFxFilter
       
    36     virtual TBool Draw(CHuiFxEngine& aEngine, CHuiGc& aGc,
       
    37             CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource,
       
    38             const TRect& aTargetRect, const TRect& aSourceRect);
       
    39 
       
    40 private:
       
    41     virtual void DrawEffect(CHuiFxEngine& aEngine, VGImage aTargetImage, VGImage aSourceImage, TInt aWidth, TInt aHeight) = 0;
       
    42 protected:
       
    43     TBool wasEnoughMemory();
       
    44     
       
    45     template <class T>
       
    46     inline T clamp(const T value, const T minimum, const T maximum) {return (Max(Min(maximum, value), minimum));}
       
    47     };
       
    48  
       
    49 
       
    50 #endif /*HUIFXVG10FILTERBASE_H_*/