Lines Matching refs:readPtr
83 static void readDataFromStream(png_structp readPtr, png_bytep data, in readDataFromStream() argument
86 reinterpret_cast<std::istream*>(png_get_io_ptr(readPtr)); in readDataFromStream()
88 png_error(readPtr, strerror(errno)); in readDataFromStream()
101 static void logWarning(png_structp readPtr, png_const_charp warningMessage) { in logWarning() argument
103 reinterpret_cast<IDiagnostics*>(png_get_error_ptr(readPtr)); in logWarning()
107 static bool readPng(IDiagnostics* diag, png_structp readPtr, png_infop infoPtr, in readPng() argument
109 if (setjmp(png_jmpbuf(readPtr))) { in readPng()
114 png_set_sig_bytes(readPtr, kPngSignatureSize); in readPng()
115 png_read_info(readPtr, infoPtr); in readPng()
118 png_get_IHDR(readPtr, infoPtr, &outInfo->width, &outInfo->height, &bitDepth, in readPng()
122 png_set_palette_to_rgb(readPtr); in readPng()
126 png_set_expand_gray_1_2_4_to_8(readPtr); in readPng()
129 if (png_get_valid(readPtr, infoPtr, PNG_INFO_tRNS)) { in readPng()
130 png_set_tRNS_to_alpha(readPtr); in readPng()
134 png_set_strip_16(readPtr); in readPng()
138 png_set_add_alpha(readPtr, 0xFF, PNG_FILLER_AFTER); in readPng()
143 png_set_gray_to_rgb(readPtr); in readPng()
146 png_set_interlace_handling(readPtr); in readPng()
147 png_read_update_info(readPtr, infoPtr); in readPng()
149 const uint32_t rowBytes = png_get_rowbytes(readPtr, infoPtr); in readPng()
155 png_read_image(readPtr, outInfo->rows.data()); in readPng()
156 png_read_end(readPtr, infoPtr); in readPng()
1253 png_structp readPtr = nullptr; in process() local
1259 readPtr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, nullptr, nullptr); in process()
1260 if (!readPtr) { in process()
1265 infoPtr = png_create_info_struct(readPtr); in process()
1271 png_set_error_fn(readPtr, reinterpret_cast<png_voidp>(mDiag), nullptr, in process()
1275 png_set_read_fn(readPtr, (png_voidp)input, readDataFromStream); in process()
1277 if (!readPng(mDiag, readPtr, infoPtr, &pngInfo)) { in process()
1315 if (readPtr) { in process()
1316 png_destroy_read_struct(&readPtr, &infoPtr, nullptr); in process()