OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkImageEncoder_DEFINED | 8 #ifndef SkImageEncoder_DEFINED |
9 #define SkImageEncoder_DEFINED | 9 #define SkImageEncoder_DEFINED |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 enum Type { | 23 enum Type { |
24 kUnknown_Type, | 24 kUnknown_Type, |
25 kBMP_Type, | 25 kBMP_Type, |
26 kGIF_Type, | 26 kGIF_Type, |
27 kICO_Type, | 27 kICO_Type, |
28 kJPEG_Type, | 28 kJPEG_Type, |
29 kPNG_Type, | 29 kPNG_Type, |
30 kWBMP_Type, | 30 kWBMP_Type, |
31 kWEBP_Type, | 31 kWEBP_Type, |
32 kKTX_Type, | 32 kKTX_Type, |
| 33 kEXR_Type, |
33 }; | 34 }; |
34 static SkImageEncoder* Create(Type); | 35 static SkImageEncoder* Create(Type); |
35 | 36 |
36 virtual ~SkImageEncoder(); | 37 virtual ~SkImageEncoder(); |
37 | 38 |
38 /* Quality ranges from 0..100 */ | 39 /* Quality ranges from 0..100 */ |
39 enum { | 40 enum { |
40 kDefaultQuality = 80 | 41 kDefaultQuality = 80 |
41 }; | 42 }; |
42 | 43 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // encoder implementation that registers with the encoder factory must call it. | 98 // encoder implementation that registers with the encoder factory must call it. |
98 #define DEFINE_ENCODER_CREATOR(codec) \ | 99 #define DEFINE_ENCODER_CREATOR(codec) \ |
99 SkImageEncoder* Create##codec() { return new Sk##codec; } | 100 SkImageEncoder* Create##codec() { return new Sk##codec; } |
100 | 101 |
101 // All the encoders known by Skia. Note that, depending on the compiler settings
, | 102 // All the encoders known by Skia. Note that, depending on the compiler settings
, |
102 // not all of these will be available | 103 // not all of these will be available |
103 DECLARE_ENCODER_CREATOR(JPEGImageEncoder); | 104 DECLARE_ENCODER_CREATOR(JPEGImageEncoder); |
104 DECLARE_ENCODER_CREATOR(PNGImageEncoder); | 105 DECLARE_ENCODER_CREATOR(PNGImageEncoder); |
105 DECLARE_ENCODER_CREATOR(KTXImageEncoder); | 106 DECLARE_ENCODER_CREATOR(KTXImageEncoder); |
106 DECLARE_ENCODER_CREATOR(WEBPImageEncoder); | 107 DECLARE_ENCODER_CREATOR(WEBPImageEncoder); |
| 108 DECLARE_ENCODER_CREATOR(EXRImageEncoder); |
107 | 109 |
108 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) | 110 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) |
109 SkImageEncoder* CreateImageEncoder_CG(SkImageEncoder::Type type); | 111 SkImageEncoder* CreateImageEncoder_CG(SkImageEncoder::Type type); |
110 #endif | 112 #endif |
111 | 113 |
112 #if defined(SK_BUILD_FOR_WIN) | 114 #if defined(SK_BUILD_FOR_WIN) |
113 SkImageEncoder* CreateImageEncoder_WIC(SkImageEncoder::Type type); | 115 SkImageEncoder* CreateImageEncoder_WIC(SkImageEncoder::Type type); |
114 #endif | 116 #endif |
115 | 117 |
116 // Typedef to make registering encoder callback easier | 118 // Typedef to make registering encoder callback easier |
117 // This has to be defined outside SkImageEncoder. :( | 119 // This has to be defined outside SkImageEncoder. :( |
118 typedef SkTRegistry<SkImageEncoder*(*)(SkImageEncoder::Type)> SkImageEncoder_Enc
odeReg; | 120 typedef SkTRegistry<SkImageEncoder*(*)(SkImageEncoder::Type)> SkImageEncoder_Enc
odeReg; |
119 #endif | 121 #endif |
OLD | NEW |