os/graphics/egl/egltest/endpointtestsuite/automated/tinc/egltest_endpoint_images.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @test
    19  @internalComponent - Internal Symbian test code
    20 */
    21 
    22 #ifndef __EGLTEST_ENDPOINT_IMAGE_H__
    23 #define __EGLTEST_ENDPOINT_IMAGE_H__
    24 
    25 #include <e32std.h>
    26 #include <fbs.h>
    27 #include <EGL/egl.h>
    28 #include <EGL/eglext.h>
    29 #include <VG/openvg.h>
    30 
    31 // Class Hierarchy to manage a set of images, based on an index.
    32 
    33 class CTestImage: public CBase
    34     {
    35 public:
    36     virtual ~CTestImage();
    37     virtual TRgb Pixel(TInt aX, TInt aY) const = 0;
    38     virtual TSize Size() const = 0;
    39     TBool CompareImageL(const CTestImage *aImage, TBool aExecptError) const;
    40     TBool IsSolidColourL() const;
    41 private:
    42     static TBool ComparePixel(TRgb aPixel1, TRgb aPixel2, TBool aExecptError);
    43 protected:
    44     CTestImage();
    45 public:
    46     static const TInt KImageCount;
    47     };
    48 
    49 class CTestCFbsImage: public CTestImage
    50     {
    51 public:
    52     static CTestCFbsImage *NewL(TInt aIndex);
    53     CFbsBitmap *Bitmap();
    54     virtual ~CTestCFbsImage();
    55     virtual TRgb Pixel(TInt aX, TInt aY) const;
    56     virtual TSize Size() const;
    57 protected:
    58     void ConstructL(TInt aIndex);
    59     CTestCFbsImage();
    60 
    61 private:
    62     CFbsBitmap *iBitmap;
    63     RFbsSession iSession;
    64     };
    65 
    66 class CTestVgImage: public CTestImage
    67     {
    68 protected:
    69     VGImage iVgImage;
    70     VGImageFormat iDataFormat;
    71 
    72 public:
    73     static CTestVgImage *NewL(TInt aIndex);
    74     VGImage VGImage();
    75     virtual ~CTestVgImage();
    76     virtual TRgb Pixel(TInt aX, TInt aY) const;
    77     virtual TSize Size() const;
    78 private:
    79     void ConstructL(TInt aIndex);
    80 protected:
    81     CTestVgImage();
    82     };
    83 
    84 
    85 class CTestVgEglImage: public CTestVgImage
    86     {
    87 public:
    88     static CTestVgEglImage *New(EGLImageKHR aEglImage);
    89     static CTestVgEglImage *NewL(EGLImageKHR aEglImage);
    90 private:
    91     void ConstructL(EGLImageKHR aEglImage);
    92 
    93     CTestVgEglImage();
    94     };
    95 
    96 
    97 #endif // __EGLTEST_ENDPOINT_IMAGE_H__