OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2014 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #ifndef image_expectations_DEFINED | |
9 #define image_expectations_DEFINED | |
10 | |
11 #include "SkBitmap.h" | |
12 #include "SkJSONCPP.h" | |
13 | |
14 namespace sk_tools { | |
15 | |
16 /** | |
17 * Class for collecting image results (checksums) as we go. | |
18 */ | |
19 class ImageResultsSummary { | |
20 public: | |
21 /** | |
22 * Adds this image to the summary of results. | |
23 * | |
24 * @param sourceName name of the source file that generated this result | |
25 * @param fileName relative path to the image output file on local disk | |
26 * @param hash hash to store | |
27 * @param tileNumber if not NULL, ptr to tile number | |
28 */ | |
29 void add(const char *sourceName, const char *fileName, uint64_t hash, | |
30 const int *tileNumber=NULL); | |
31 | |
32 /** | |
33 * Adds this image to the summary of results. | |
34 * | |
35 * @param sourceName name of the source file that generated this result | |
36 * @param fileName relative path to the image output file on local disk | |
37 * @param bitmap bitmap to store the hash of | |
38 * @param tileNumber if not NULL, ptr to tile number | |
39 */ | |
40 void add(const char *sourceName, const char *fileName, const SkBitmap& b
itmap, | |
41 const int *tileNumber=NULL); | |
42 | |
43 /** | |
44 * Writes the summary (as constructed so far) to a file. | |
45 * | |
46 * @param filename path to write the summary to | |
47 */ | |
48 void writeToFile(const char *filename); | |
49 | |
50 private: | |
51 Json::Value fActualResults; | |
52 }; | |
53 | |
54 } // namespace sk_tools | |
55 | |
56 #endif // image_expectations_DEFINED | |
OLD | NEW |