OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #ifndef SkImageEncoder_DEFINED | 8 #ifndef SkImageEncoder_DEFINED |
9 #define SkImageEncoder_DEFINED | 9 #define SkImageEncoder_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
| 12 #include "SkTRegistry.h" |
12 | 13 |
13 class SkBitmap; | 14 class SkBitmap; |
14 class SkData; | 15 class SkData; |
15 class SkWStream; | 16 class SkWStream; |
16 | 17 |
17 class SkImageEncoder { | 18 class SkImageEncoder { |
18 public: | 19 public: |
19 enum Type { | 20 enum Type { |
20 kUnknown_Type, | 21 kUnknown_Type, |
21 kBMP_Type, | 22 kBMP_Type, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // not all of these will be available | 91 // not all of these will be available |
91 /** An ARGBImageEncoder will always write out | 92 /** An ARGBImageEncoder will always write out |
92 * bitmap.width() * bitmap.height() * 4 | 93 * bitmap.width() * bitmap.height() * 4 |
93 * bytes. | 94 * bytes. |
94 */ | 95 */ |
95 DECLARE_ENCODER_CREATOR(ARGBImageEncoder); | 96 DECLARE_ENCODER_CREATOR(ARGBImageEncoder); |
96 DECLARE_ENCODER_CREATOR(JPEGImageEncoder); | 97 DECLARE_ENCODER_CREATOR(JPEGImageEncoder); |
97 DECLARE_ENCODER_CREATOR(PNGImageEncoder); | 98 DECLARE_ENCODER_CREATOR(PNGImageEncoder); |
98 DECLARE_ENCODER_CREATOR(WEBPImageEncoder); | 99 DECLARE_ENCODER_CREATOR(WEBPImageEncoder); |
99 | 100 |
| 101 // Typedef to make registering encoder callback easier |
| 102 // This has to be defined outside SkImageEncoder. :( |
| 103 typedef SkTRegistry<SkImageEncoder*(*)(SkImageEncoder::Type)> SkImageEncoder_Enc
odeReg; |
100 #endif | 104 #endif |
OLD | NEW |