1 /*
2  * Copyright (C) 2011 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef AUTOLOCKTEST_H
18 #define AUTOLOCKTEST_H
19 
20 #include <vector>
21 
22 #include "imagetesthandler.h"
23 
24 class AutoLockTest : public ImageTestHandler {
25   public:
AutoLockTest()26     AutoLockTest() : ImageTestHandler() {}
AutoLockTest(int debugHeight,int debugWidth)27     AutoLockTest(int debugHeight, int debugWidth) :
28         ImageTestHandler(debugHeight, debugWidth) {}
~AutoLockTest()29     ~AutoLockTest() {}
30 
addDataToList(const std::vector<Vec3f> * checkerColors)31     void addDataToList(const std::vector<Vec3f>* checkerColors) {
32       mCheckerColors.push_back(*checkerColors);
33       delete checkerColors;
34     }
35 
36     void processData();
37 
38     void clearData();
39 
getComparisonResults()40     const std::vector<bool>* getComparisonResults() const {
41       return (&mComparisonResults);
42     }
43 
44   private:
45     bool IsBrighterThan(const std::vector<Vec3f>* colorCheckers1,
46                         const std::vector<Vec3f>* colorCheckers2) const;
47     bool IsEquivalentTo(const std::vector<Vec3f>* colorCheckers1,
48                         const std::vector<Vec3f>* colorCheckers2) const;
49 
50     std::vector<std::vector<Vec3f> > mCheckerColors;
51     std::vector<bool> mComparisonResults;
52     int mNumPatches;
53 };
54 
55 #endif
56