Definition at line 88 of file SkPngCodec.cpp.
◆ AutoCleanPng()
Definition at line 96 of file SkPngCodec.cpp.
98 : fPng_ptr(png_ptr)
99 , fInfo_ptr(nullptr)
100 , fStream(stream)
101 , fChunkReader(reader)
102 , fOutCodec(codecPtr)
103 {}
◆ ~AutoCleanPng()
AutoCleanPng::~AutoCleanPng |
( |
| ) |
|
|
inline |
Definition at line 105 of file SkPngCodec.cpp.
105 {
106
107 if (fPng_ptr) {
108 png_infopp info_pp = fInfo_ptr ? &fInfo_ptr : nullptr;
109 png_destroy_read_struct(&fPng_ptr, info_pp, nullptr);
110 }
111 }
◆ decodeBounds()
bool AutoCleanPng::decodeBounds |
( |
| ) |
|
Reads enough of the input stream to decode the bounds.
- Returns
- false if the stream is not a valid PNG (or too short). true if it read enough of the stream to determine the bounds. In the latter case, the stream may have been read beyond the point to determine the bounds, and the png_ptr will have saved any extra data. Further, if the codecPtr supplied to the constructor was not NULL, it will now point to a new SkCodec, which owns (or refs, in the case of the SkPngChunkReader) the inputs. If codecPtr was NULL, the png_ptr and info_ptr are unowned, and it is up to the caller to destroy them.
Definition at line 165 of file SkPngCodec.cpp.
165 {
168 return false;
169 }
170
171 png_set_progressive_read_fn(fPng_ptr, nullptr, nullptr, nullptr, nullptr);
172
173
174
175
178
179 {
180
182 return false;
183 }
184
185 png_process_data(fPng_ptr, fInfo_ptr, (png_bytep)
buffer, 8);
186 }
187
188 while (true) {
189
191
192 break;
193 }
194
195 png_byte* chunk =
reinterpret_cast<png_byte*
>(
buffer);
196 const size_t length = png_get_uint_32(chunk);
197
199 this->infoCallback(
length);
200 return true;
201 }
202
203 png_process_data(fPng_ptr, fInfo_ptr, chunk, 8);
204
206 return false;
207 }
208 }
209
210 return false;
211}
static bool process_data(png_structp png_ptr, png_infop info_ptr, SkStream *stream, void *buffer, size_t bufferSize, size_t length)
static bool is_chunk(const png_byte *chunk, const char *tag)
static const size_t kBufferSize
virtual size_t read(void *buffer, size_t size)=0
static const uint8_t buffer[]
◆ setInfoPtr()
void AutoCleanPng::setInfoPtr |
( |
png_infop |
info_ptr | ) |
|
|
inline |
The documentation for this class was generated from the following file: