Lines Matching refs:dinfo
59 static SkEncodedOrigin get_exif_orientation(jpeg_decompress_struct* dinfo) { in get_exif_orientation() argument
61 for (jpeg_marker_struct* marker = dinfo->marker_list; marker; marker = marker->next) { in get_exif_orientation()
84 static std::unique_ptr<SkEncodedInfo::ICCProfile> read_color_profile(jpeg_decompress_struct* dinfo) in read_color_profile() argument
93 for (jpeg_marker_struct* marker = dinfo->marker_list; marker; marker = marker->next) { in read_color_profile()
163 auto* dinfo = decoderMgr->dinfo(); in ReadHeader() local
169 jpeg_save_markers(dinfo, kExifMarker, 0xFFFF); in ReadHeader()
170 jpeg_save_markers(dinfo, kICCMarker, 0xFFFF); in ReadHeader()
174 switch (jpeg_read_header(dinfo, true)) { in ReadHeader()
190 SkEncodedOrigin orientation = get_exif_orientation(dinfo); in ReadHeader()
191 auto profile = read_color_profile(dinfo); in ReadHeader()
194 switch (decoderMgr->dinfo()->jpeg_color_space) { in ReadHeader()
219 SkEncodedInfo info = SkEncodedInfo::Make(dinfo->image_width, dinfo->image_height, in ReadHeader()
255 , fReadyState(decoderMgr->dinfo()->global_state) in SkJpegCodec()
264 static size_t get_row_bytes(const j_decompress_ptr dinfo) { in get_row_bytes() argument
265 const size_t colorBytes = (dinfo->out_color_space == JCS_RGB565) ? 2 : in get_row_bytes()
266 dinfo->out_color_components; in get_row_bytes()
267 return dinfo->output_width * colorBytes; in get_row_bytes()
277 void calc_output_dimensions(jpeg_decompress_struct* dinfo, unsigned int num, unsigned int denom) { in calc_output_dimensions() argument
278 dinfo->num_components = 0; in calc_output_dimensions()
279 dinfo->scale_num = num; in calc_output_dimensions()
280 dinfo->scale_denom = denom; in calc_output_dimensions()
281 jpeg_calc_output_dimensions(dinfo); in calc_output_dimensions()
311 jpeg_decompress_struct dinfo; in onGetScaledDimensions() local
312 sk_bzero(&dinfo, sizeof(dinfo)); in onGetScaledDimensions()
313 dinfo.image_width = this->dimensions().width(); in onGetScaledDimensions()
314 dinfo.image_height = this->dimensions().height(); in onGetScaledDimensions()
315 dinfo.global_state = fReadyState; in onGetScaledDimensions()
316 calc_output_dimensions(&dinfo, num, denom); in onGetScaledDimensions()
319 return SkISize::Make(dinfo.output_width, dinfo.output_height); in onGetScaledDimensions()
351 J_COLOR_SPACE encodedColorType = fDecoderMgr->dinfo()->jpeg_color_space; in conversionSupported()
356 fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA; in conversionSupported()
362 fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA; in conversionSupported()
364 fDecoderMgr->dinfo()->out_color_space = JCS_EXT_BGRA; in conversionSupported()
369 fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA; in conversionSupported()
371 fDecoderMgr->dinfo()->dither_mode = JDITHER_NONE; in conversionSupported()
372 fDecoderMgr->dinfo()->out_color_space = JCS_RGB565; in conversionSupported()
381 fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA; in conversionSupported()
383 fDecoderMgr->dinfo()->out_color_space = JCS_GRAYSCALE; in conversionSupported()
388 fDecoderMgr->dinfo()->out_color_space = JCS_EXT_RGBA; in conversionSupported()
397 fDecoderMgr->dinfo()->out_color_space = JCS_CMYK; in conversionSupported()
418 jpeg_decompress_struct dinfo; in onDimensionsSupported() local
419 sk_bzero(&dinfo, sizeof(dinfo)); in onDimensionsSupported()
420 dinfo.image_width = this->dimensions().width(); in onDimensionsSupported()
421 dinfo.image_height = this->dimensions().height(); in onDimensionsSupported()
422 dinfo.global_state = fReadyState; in onDimensionsSupported()
427 calc_output_dimensions(&dinfo, num, denom); in onDimensionsSupported()
428 while (dinfo.output_width != dstWidth || dinfo.output_height != dstHeight) { in onDimensionsSupported()
431 if (1 == num || dstWidth > dinfo.output_width || dstHeight > dinfo.output_height) { in onDimensionsSupported()
437 calc_output_dimensions(&dinfo, num, denom); in onDimensionsSupported()
440 fDecoderMgr->dinfo()->scale_num = num; in onDimensionsSupported()
441 fDecoderMgr->dinfo()->scale_denom = denom; in onDimensionsSupported()
484 uint32_t lines = jpeg_read_scanlines(fDecoderMgr->dinfo(), &decodeDst, 1); in readRows()
535 jpeg_decompress_struct* dinfo = fDecoderMgr->dinfo(); in onGetPixels() local
543 if (!jpeg_start_decompress(dinfo)) { in onGetPixels()
549 SkASSERT(1 == dinfo->rec_outbuf_height); in onGetPixels()
551 if (needs_swizzler_to_convert_from_cmyk(dinfo->out_color_space, in onGetPixels()
574 swizzleBytes = get_row_bytes(fDecoderMgr->dinfo()); in allocateStorage()
623 switch (fDecoderMgr->dinfo()->out_color_space) { in initializeSwizzler()
651 fDecoderMgr->dinfo()->out_color_space, this->getEncodedInfo().profile(), in getSampler()
669 if (!jpeg_start_decompress(fDecoderMgr->dinfo())) { in onStartScanlineDecode()
675 fDecoderMgr->dinfo()->out_color_space, this->getEncodedInfo().profile(), in onStartScanlineDecode()
686 jpeg_crop_scanline(fDecoderMgr->dinfo(), &startX, &width); in onStartScanlineDecode()
730 fDecoderMgr->dinfo()->output_scanline = this->dstInfo().height(); in onGetScanlines()
743 return (uint32_t) count == jpeg_skip_scanlines(fDecoderMgr->dinfo(), count); in onSkipScanlines()
746 static bool is_yuv_supported(const jpeg_decompress_struct* dinfo, in is_yuv_supported() argument
751 SkASSERT(dinfo->scale_num == dinfo->scale_denom); in is_yuv_supported()
756 if (JCS_YCbCr != dinfo->jpeg_color_space) { in is_yuv_supported()
760 SkASSERT(3 == dinfo->num_components); in is_yuv_supported()
761 SkASSERT(dinfo->comp_info); in is_yuv_supported()
778 if ((1 != dinfo->comp_info[1].h_samp_factor) || in is_yuv_supported()
779 (1 != dinfo->comp_info[1].v_samp_factor) || in is_yuv_supported()
780 (1 != dinfo->comp_info[2].h_samp_factor) || in is_yuv_supported()
781 (1 != dinfo->comp_info[2].v_samp_factor)) in is_yuv_supported()
794 int hSampY = dinfo->comp_info[0].h_samp_factor; in is_yuv_supported()
795 int vSampY = dinfo->comp_info[0].v_samp_factor; in is_yuv_supported()
796 SkASSERT(hSampY == dinfo->max_h_samp_factor); in is_yuv_supported()
797 SkASSERT(vSampY == dinfo->max_v_samp_factor); in is_yuv_supported()
825 rowBytes[i] = dinfo->comp_info[i].width_in_blocks * DCTSIZE; in is_yuv_supported()
841 jpeg_decompress_struct* dinfo = fDecoderMgr->dinfo(); in onQueryYUVAInfo() local
842 return is_yuv_supported(dinfo, *this, &supportedDataTypes, yuvaPixmapInfo); in onQueryYUVAInfo()
847 jpeg_decompress_struct* dinfo = fDecoderMgr->dinfo(); in onGetYUVAPlanes() local
848 if (!is_yuv_supported(dinfo, *this, nullptr, nullptr)) { in onGetYUVAPlanes()
857 dinfo->raw_data_out = TRUE; in onGetYUVAPlanes()
858 if (!jpeg_start_decompress(dinfo)) { in onGetYUVAPlanes()
871 SkASSERT(is_yuv_supported(dinfo, *this, nullptr, &info)); in onGetYUVAPlanes()
893 int numYRowsPerBlock = DCTSIZE * dinfo->comp_info[0].v_samp_factor; in onGetYUVAPlanes()
915 const int numIters = dinfo->output_height / numRowsPerBlock; in onGetYUVAPlanes()
917 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock); in onGetYUVAPlanes()
933 uint32_t remainingRows = dinfo->output_height - dinfo->output_scanline; in onGetYUVAPlanes()
934 SkASSERT(remainingRows == dinfo->output_height % numRowsPerBlock); in onGetYUVAPlanes()
935 SkASSERT(dinfo->output_scanline == numIters * numRowsPerBlock); in onGetYUVAPlanes()
945 int remainingUVRows = dinfo->comp_info[1].downsampled_height - DCTSIZE * numIters; in onGetYUVAPlanes()
951 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock); in onGetYUVAPlanes()
978 jpeg_decompress_struct* dinfo = decoderMgr.dinfo(); in SkGetJpegInfo() local
979 jpeg_save_markers(dinfo, kExifMarker, 0xFFFF); in SkGetJpegInfo()
980 jpeg_save_markers(dinfo, kICCMarker, 0xFFFF); in SkGetJpegInfo()
981 if (JPEG_HEADER_OK != jpeg_read_header(dinfo, true)) { in SkGetJpegInfo()
992 *orientation = get_exif_orientation(dinfo); in SkGetJpegInfo()
995 *size = {SkToS32(dinfo->image_width), SkToS32(dinfo->image_height)}; in SkGetJpegInfo()