0
|
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 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
#ifndef CSTATImageVerify_H
|
|
22 |
#define CSTATImageVerify_H
|
|
23 |
|
|
24 |
#include "CSTATLogFile.h"
|
|
25 |
|
|
26 |
#define VERIFY_MAX_IMAGES 250
|
|
27 |
|
|
28 |
//class to be used to store names of reference images in time ascending order
|
|
29 |
//Verification will then take place according to current location in the array
|
|
30 |
class CSTATReferenceImages
|
|
31 |
{
|
|
32 |
public :
|
|
33 |
CString completefilenamepath;
|
|
34 |
ULONGLONG lCreationTime;
|
|
35 |
};
|
|
36 |
|
|
37 |
class CSTATImageVerify
|
|
38 |
{
|
|
39 |
public :
|
|
40 |
CSTATImageVerify(CSTATLogFile *pLog);
|
|
41 |
~CSTATImageVerify();
|
|
42 |
|
|
43 |
int Initialise(const CString& path); // sets the location of the reference images
|
|
44 |
int CopyReferenceImages(LPTSTR refimagelocation); // copy new ref images
|
|
45 |
int DeleteReferenceImages(); // remove existing reference images
|
|
46 |
int EnableVerification(int fudge); //will load ref file names into array and sort them accroding to creation time
|
|
47 |
int VerifyImage(CString& lastscreenshot); //image verification function (blitting)
|
|
48 |
int IsActive() { return iImageCount; } // are we using verification?
|
|
49 |
void DisableVerification() { iImageCount = 0; } // turn it off
|
|
50 |
|
|
51 |
private :
|
|
52 |
bool ImagesRemaining() { return (lastrefimageloaded < iImageCount); }
|
|
53 |
bool LoadNewImage(CString& newimage); //image loading for reference and new images
|
|
54 |
bool LoadRefImage(); // ...
|
|
55 |
|
|
56 |
CSTATReferenceImages refimagearray[250]; // array of images to verify against
|
|
57 |
int lastrefimageloaded; // position of last image
|
|
58 |
int margin; // percentage error allowed on images
|
|
59 |
int iImageCount; // total images for verification
|
|
60 |
CString referenceimagedir; // location of reference images
|
|
61 |
CSTATLogFile *pLogFile; // pointer to our logging class
|
|
62 |
|
|
63 |
CPalette m_Palette;
|
|
64 |
unsigned char *m_pDib, *m_pDib2, *m_pDibBits, *m_pDibBits2;
|
|
65 |
DWORD m_dwDibSize, m_dwDibSize2;
|
|
66 |
BITMAPINFOHEADER *m_pBIH, *m_pBIH2;
|
|
67 |
RGBQUAD *m_pPalette, *m_pPalette2;
|
|
68 |
int m_nPaletteEntries, m_nPaletteEntries2;
|
|
69 |
};
|
|
70 |
|
|
71 |
#endif
|