imagingandcamerafws/imagingunittest/tsu_icl_imageframe/src/TestStepImageFrame.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 
       
     2 // Copyright (c) 2005-2009 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 #ifndef TESTSTEPIMAGEFRAME_H
       
    18 #define TESTSTEPIMAGEFRAME_H
       
    19 
       
    20 #include <testframework.h>
       
    21 #include <imageframe.h>
       
    22 
       
    23 class TFrameFormat;
       
    24 class TFrameLayout;
       
    25 class CImageFrame;
       
    26 class TDataUnit;
       
    27 
       
    28 // class, which methods are used to provide various utility functionality
       
    29 class RImageFrameUtil
       
    30 	{
       
    31 public:
       
    32     static TBool FormatsEqual(const TFrameFormat& aFormat1, const TFrameFormat& aFormat2);
       
    33     static TBool LayoutsEqual(const TFrameLayout& aLayout1, const TFrameLayout& aLayout2);
       
    34     static TBool CheckUniformAssignment(CImageFrame& aFrame, TInt aValue, TInt aBufferSize, TBool aForward);
       
    35 	static void SetBlockToUniformValue(TDataUnit& aDataUnit, TInt aValue);
       
    36 	static TBool CompareBlockValues(TDataUnit& aDataUnit1, TDataUnit& aDataUnit2);
       
    37 	static void InitPointerValues(TDataUnit* aDataUnit, TDataUnit** aDataUnitPtr, TInt aBlocks);
       
    38     static TInt LayoutPlanes(const TFrameFormat& aFormat);
       
    39     static void InitLayoutValues(TFrameLayout& aLayout,TFrameFormat& aFormat, TSize& aSize, TInt& aRecommendedSize);
       
    40 	static void InitPointerValuesL(TDataUnit* aDataUnit, RArray<const TDataUnit*> &aDataUnitPtr, TInt aBlocks);
       
    41 };
       
    42 
       
    43 // base class for all tests, it embeds the alloc tests step
       
    44 class RImageFrameTest : public  RTestStep
       
    45 	{
       
    46 protected:
       
    47 	// from RTestStep;
       
    48 	TVerdict DoTestStepL();
       
    49     virtual TVerdict DoTestL();
       
    50     TVerdict ProbeAllocTestsL();
       
    51 	RImageFrameTest(TBool aAllocTest);
       
    52     TInt LayoutPlanes(const TFrameFormat& aFormat);
       
    53     void InitLayoutValues(TFrameLayout& aLayout,TFrameFormat& aFormat, TSize& aSize, TInt& aRecommendedSize);
       
    54 
       
    55 protected:
       
    56 	TBool iAllocTest;
       
    57 	};
       
    58 	
       
    59 class RImageFrameDecDesc : public  RImageFrameTest
       
    60 	{
       
    61 public:
       
    62 	static RImageFrameDecDesc* NewL(TBool aAllocTest);
       
    63 	
       
    64 protected:
       
    65 	// from RImageFrameTest;
       
    66 	TVerdict DoTestL();
       
    67 
       
    68 	RImageFrameDecDesc(TBool aAllocTest);
       
    69 	};	
       
    70 	
       
    71 class RImageFrameDecChunk : public  RImageFrameTest
       
    72 	{
       
    73 public:
       
    74 	static RImageFrameDecChunk* NewL(TBool aAllocTest);
       
    75 protected:
       
    76 	// from RImageFrameTest;
       
    77 	TVerdict DoTestL();
       
    78 private:
       
    79 	RImageFrameDecChunk(TBool aAllocTest);
       
    80 	};
       
    81 	
       
    82 class RImageFrameEncDesc : public RImageFrameTest 
       
    83 	{
       
    84 public:
       
    85 	static RImageFrameEncDesc* NewL(TBool aAllocTest);
       
    86 protected:
       
    87 	// from RImageFrameTest;
       
    88 	TVerdict DoTestL();
       
    89 private:
       
    90 	RImageFrameEncDesc(TBool aAllocTest);
       
    91 	};
       
    92 	
       
    93 class RImageFrameEncChunk : public RImageFrameTest
       
    94 	{
       
    95 public:
       
    96 	static RImageFrameEncChunk* NewL(TBool aAllocTest);
       
    97 protected:
       
    98 	// from RImageFrameTest;
       
    99 	TVerdict DoTestL();
       
   100 private:
       
   101 	RImageFrameEncChunk(TBool aAllocTest);
       
   102 	};	
       
   103 	
       
   104 class RYuvMonoProcDesc : public RImageFrameTest
       
   105 	{
       
   106 public:
       
   107 	static RYuvMonoProcDesc* NewL(TBool aAllocTest);
       
   108 protected:
       
   109 	// from RImageFrameTest;
       
   110 	TVerdict DoTestL();
       
   111 private:
       
   112 	RYuvMonoProcDesc(TBool aAllocTest);
       
   113 	};
       
   114 
       
   115 class RYuvMonoProcChunk : public RImageFrameTest
       
   116 	{
       
   117 public:
       
   118 	static RYuvMonoProcChunk* NewL(TBool aAllocTest);
       
   119 protected:
       
   120 	// from RImageFrameTest;
       
   121 	TVerdict DoTestL();
       
   122 private:
       
   123 	RYuvMonoProcChunk(TBool aAllocTest);
       
   124 	};		
       
   125 
       
   126 class RYuv422IntlProcDesc : public RImageFrameTest
       
   127 	{
       
   128 public:
       
   129 	static RYuv422IntlProcDesc* NewL(TBool aAllocTest);
       
   130 protected:
       
   131 	// from RImageFrameTest;
       
   132 	TVerdict DoTestL();
       
   133 private:
       
   134 	RYuv422IntlProcDesc(TBool aAllocTest);
       
   135 	};
       
   136 
       
   137 class RYuv422IntlProcChunk : public RImageFrameTest
       
   138 	{
       
   139 public:
       
   140 	static RYuv422IntlProcChunk* NewL(TBool aAllocTest);
       
   141 protected:
       
   142 	// from RImageFrameTest;
       
   143 	TVerdict DoTestL();
       
   144 private:
       
   145 	RYuv422IntlProcChunk(TBool aAllocTest);
       
   146 	};		
       
   147 	
       
   148 //YUV420PlanarProcessor (Reversed) for descriptor test
       
   149 class RYuv420PlnProcDesc : public RImageFrameTest
       
   150 	{
       
   151 public:
       
   152 	static RYuv420PlnProcDesc* NewL(TBool aAllocTest);
       
   153 protected:
       
   154 	// from RImageFrameTest;
       
   155 	TVerdict DoTestL();
       
   156 private:
       
   157 	RYuv420PlnProcDesc(TBool aAllocTest);
       
   158 	};
       
   159 
       
   160 //YUV420PlanarProcessor for chunk test
       
   161 class RYuv420PlnProcChunk : public RImageFrameTest
       
   162 	{
       
   163 public:
       
   164 	static RYuv420PlnProcChunk* NewL(TBool aAllocTest);
       
   165 protected:
       
   166 	// from RImageFrameTest;
       
   167 	TVerdict DoTestL();
       
   168 private:
       
   169 	RYuv420PlnProcChunk(TBool aAllocTest);
       
   170 	};	
       
   171 	
       
   172 //YUV420PlanarProcessor (Reversed) for descriptor test
       
   173 class RYuv420PlnRevProcDesc : public RImageFrameTest
       
   174 	{
       
   175 public:
       
   176 	static RYuv420PlnRevProcDesc* NewL(TBool aAllocTest);
       
   177 protected:
       
   178 	// from RImageFrameTest;
       
   179 	TVerdict DoTestL();
       
   180 private:
       
   181 	RYuv420PlnRevProcDesc(TBool aAllocTest);
       
   182 	};
       
   183 
       
   184 //YUV420PlanarProcessor (Reversed) for chunk test
       
   185 class RYuv420PlnRevProcChunk : public RImageFrameTest
       
   186 	{
       
   187 public:
       
   188 	static RYuv420PlnRevProcChunk* NewL(TBool aAllocTest);
       
   189 protected:
       
   190 	// from RImageFrameTest;
       
   191 	TVerdict DoTestL();
       
   192 private:
       
   193 	RYuv420PlnRevProcChunk(TBool aAllocTest);
       
   194 	};		
       
   195 
       
   196 // test to demostrate how all works when a descriptor or chunk contains more than one image frame - descriptor case	
       
   197 class RImageFrameDescMultiFrame : public RTestStep
       
   198 	{
       
   199 public:
       
   200 	static RImageFrameDescMultiFrame* NewL(TBool aAllocTest);
       
   201 protected:
       
   202 	// from RTestStep;
       
   203 	TVerdict DoTestStepL();
       
   204 private:
       
   205 	RImageFrameDescMultiFrame(TBool aAllocTest);
       
   206 	};
       
   207 
       
   208 // test to demostrate how all works when a descriptor or chunk contains more than one image frame - chunk case
       
   209 class RImageFrameRChunkMultiFrame : public RTestStep
       
   210 	{
       
   211 public:
       
   212 	static RImageFrameRChunkMultiFrame* NewL(TBool aAllocTest);
       
   213 protected:
       
   214 	// from RTestStep;
       
   215 	TVerdict DoTestStepL();
       
   216 private:
       
   217 	RImageFrameRChunkMultiFrame(TBool aAllocTest);
       
   218 	};	
       
   219 
       
   220 // test to verify the functionality of TFormatClass for all different recognised format codes
       
   221 class RFormatTest : public RTestStep
       
   222 	{
       
   223 public:
       
   224 	static RFormatTest* NewL(TBool aAllocTest);
       
   225 protected:
       
   226 	// from RTestStep;
       
   227 	TVerdict DoTestStepL();
       
   228 private:
       
   229 	RFormatTest(TBool aAllocTest);
       
   230 	};
       
   231 
       
   232 // test to verify the clipping functionality of the image processor 
       
   233 class RImageFrameClip : public RTestStep
       
   234 	{
       
   235 public:
       
   236 	static RImageFrameClip* NewL(TBool aAllocTest);
       
   237 protected:
       
   238 	// from RTestStep;
       
   239 	TVerdict DoTestStepL();
       
   240 private:
       
   241 	RImageFrameClip(TBool aAllocTest);
       
   242 	};	
       
   243 	
       
   244 
       
   245 #endif // TESTSTEPIMAGEFRAME_H
       
   246