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