Lines Matching refs:image

87 /* Read the information before the actual image data.  This has been
618 /* Read one or more rows of image data. If the image is interlaced,
621 * image has alpha or transparency, and png_handle_alpha()[*] has been
625 * "row" holds the actual image, and pixels are placed in it
626 * as they arrive. If the image is displayed after each pass, it will
628 * "chunky" progressive image, with finer detail added as it becomes
632 * If you have called png_handle_alpha(), and the image has either an
635 * also, but you may. If the image is not interlaced, or if you have
826 /* Read the entire image. If the image has an alpha channel or a tRNS
828 * initialize the image to the current image that PNG will be overlaying.
833 * only call this function once. If you desire to have an image for
834 * each pass of a interlaced image, use png_read_rows() instead.
839 png_read_image(png_structrp png_ptr, png_bytepp image)
879 "Cannot read interlaced image -- interlace handler disabled");
888 rp = image;
1181 * PNG file before the first IDAT (image data chunk).
1187 /* -------------- image transformations start here ------------------- */
1317 /* Expand grayscale image to RGB */
1346 /* -------------- image transformations end here ------------------- */
1392 /* Color-map processing: after libpng has run on the PNG image further
1411 png_imagep image;
1431 png_image_read_init(png_imagep image)
1433 if (image->opaque == NULL)
1435 png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, image,
1441 memset(image, 0, (sizeof *image));
1442 image->version = PNG_IMAGE_VERSION;
1461 image->opaque = control;
1472 return png_image_error(image, "png_image_read: out of memory");
1475 return png_image_error(image, "png_image_read: opaque pointer not NULL");
1534 png_imagep image = png_voidcast(png_imagep, argument);
1535 png_structrp png_ptr = image->opaque->png_ptr;
1536 png_inforp info_ptr = image->opaque->info_ptr;
1542 image->width = png_ptr->width;
1543 image->height = png_ptr->height;
1548 image->format = format;
1559 image->flags |= PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB;
1587 image->colormap_entries = cmap_entries;
1595 png_image_begin_read_from_stdio(png_imagep image, FILE* file)
1597 if (image != NULL && image->version == PNG_IMAGE_VERSION)
1601 if (png_image_read_init(image))
1607 image->opaque->png_ptr->io_ptr = file;
1608 return png_safe_execute(image, png_image_read_header, image);
1613 return png_image_error(image,
1617 else if (image != NULL)
1618 return png_image_error(image,
1625 png_image_begin_read_from_file(png_imagep image, const char *file_name)
1627 if (image != NULL && image->version == PNG_IMAGE_VERSION)
1635 if (png_image_read_init(image))
1637 image->opaque->png_ptr->io_ptr = fp;
1638 image->opaque->owned_file = 1;
1639 return png_safe_execute(image, png_image_read_header, image);
1647 return png_image_error(image, strerror(errno));
1651 return png_image_error(image,
1655 else if (image != NULL)
1656 return png_image_error(image,
1668 png_imagep image = png_voidcast(png_imagep, png_ptr->io_ptr);
1669 if (image != NULL)
1671 png_controlp cp = image->opaque;
1693 int PNGAPI png_image_begin_read_from_memory(png_imagep image,
1696 if (image != NULL && image->version == PNG_IMAGE_VERSION)
1700 if (png_image_read_init(image))
1706 image->opaque->memory = png_voidcast(png_const_bytep, memory);
1707 image->opaque->size = size;
1708 image->opaque->png_ptr->io_ptr = image;
1709 image->opaque->png_ptr->read_data_fn = png_image_memory_read;
1711 return png_safe_execute(image, png_image_read_header, image);
1716 return png_image_error(image,
1720 else if (image != NULL)
1721 return png_image_error(image,
1727 /* Utility function to skip chunks that are not used by the simplified image
1736 * involved in basic image reading:
1740 * Or image data handling:
1770 /* But do not ignore image data handling chunks */
1791 png_fixed_point g = display->image->opaque->png_ptr->colorspace.gamma;
1838 png_error(display->image->opaque->png_ptr,
1888 png_imagep image = display->image;
1889 const int output_encoding = (image->format & PNG_FORMAT_FLAG_LINEAR) ?
1891 const int convert_to_Y = (image->format & PNG_FORMAT_FLAG_COLOR) == 0 &&
1895 png_error(image->opaque->png_ptr, "color-map index out of range");
1993 png_error(image->opaque->png_ptr, "bad encoding (internal error)");
1998 const int afirst = (image->format & PNG_FORMAT_FLAG_AFIRST) != 0 &&
1999 (image->format & PNG_FORMAT_FLAG_ALPHA) != 0;
2004 const int bgr = (image->format & PNG_FORMAT_FLAG_BGR) ? 2 : 0;
2013 entry += ip * PNG_IMAGE_SAMPLE_CHANNELS(image->format);
2019 switch (PNG_IMAGE_SAMPLE_CHANNELS(image->format))
2068 entry += ip * PNG_IMAGE_SAMPLE_CHANNELS(image->format);
2070 switch (PNG_IMAGE_SAMPLE_CHANNELS(image->format))
2212 const png_imagep image = display->image;
2214 const png_structrp png_ptr = image->opaque->png_ptr;
2215 const png_uint_32 output_format = image->format;
2284 (image->flags & PNG_IMAGE_FLAG_16BIT_sRGB) == 0)
2309 if (cmap_entries > image->colormap_entries)
2327 * corresponding color-map entry using the format from 'image',
2388 if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries)
2480 if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries)
2514 if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries)
2548 if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries)
2646 if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries)
2660 if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries)
2765 if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries)
2814 if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries)
2899 if (PNG_RGB_COLORMAP_ENTRIES > image->colormap_entries)
2930 if (cmap_entries > image->colormap_entries)
3001 if (cmap_entries > 256 || cmap_entries > image->colormap_entries)
3004 image->colormap_entries = cmap_entries;
3053 png_imagep image = display->image;
3054 png_structrp png_ptr = image->opaque->png_ptr;
3076 png_uint_32 height = image->height;
3077 png_uint_32 width = image->width;
3090 /* The row may be empty for a short image: */
3242 png_imagep image = display->image;
3243 png_controlp control = image->opaque;
3283 image->colormap_entries == 256)
3293 image->colormap_entries == 216)
3303 image->colormap_entries == 244 /* 216 + 1 + 27 */)
3328 ptr += (image->height-1) * (-row_bytes);
3342 result = png_safe_execute(image, png_image_read_and_map, display);
3355 png_uint_32 y = image->height;
3375 png_imagep image = display->image;
3376 png_structrp png_ptr = image->opaque->png_ptr;
3394 png_uint_32 height = image->height;
3395 png_uint_32 width = image->width;
3397 unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) ? 3 : 1;
3407 /* The row may be empty for a short image: */
3501 png_imagep image = display->image;
3502 png_structrp png_ptr = image->opaque->png_ptr;
3503 png_inforp info_ptr = image->opaque->info_ptr;
3504 png_uint_32 height = image->height;
3505 png_uint_32 width = image->width;
3523 if ((image->format & PNG_FORMAT_FLAG_LINEAR) == 0 &&
3524 (image->format & PNG_FORMAT_FLAG_ALPHA) != 0)
3571 /* The row may be empty for a short image: */
3690 int preserve_alpha = (image->format & PNG_FORMAT_FLAG_ALPHA) != 0;
3695 if (preserve_alpha && (image->format & PNG_FORMAT_FLAG_AFIRST))
3708 /* The row may be empty for a short image: */
3779 png_imagep image = display->image;
3780 png_structrp png_ptr = image->opaque->png_ptr;
3781 png_inforp info_ptr = image->opaque->info_ptr;
3783 png_uint_32 format = image->format;
3841 (image->flags & PNG_IMAGE_FLAG_16BIT_sRGB) == 0)
4146 ptr += (image->height-1) * (-row_bytes);
4160 result = png_safe_execute(image, png_image_read_composite, display);
4173 result = png_safe_execute(image, png_image_read_background, display);
4186 png_uint_32 y = image->height;
4201 png_image_finish_read(png_imagep image, png_const_colorp background,
4204 if (image != NULL && image->version == PNG_IMAGE_VERSION)
4209 row_stride = PNG_IMAGE_ROW_STRIDE(*image);
4217 if (image->opaque != NULL && buffer != NULL &&
4218 check >= PNG_IMAGE_ROW_STRIDE(*image))
4220 if ((image->format & PNG_FORMAT_FLAG_COLORMAP) == 0 ||
4221 (image->colormap_entries > 0 && colormap != NULL))
4227 display.image = image;
4237 if (image->format & PNG_FORMAT_FLAG_COLORMAP)
4239 png_safe_execute(image, png_image_read_colormap, &display) &&
4240 png_safe_execute(image, png_image_read_colormapped, &display);
4244 png_safe_execute(image, png_image_read_direct, &display);
4246 png_image_free(image);
4251 return png_image_error(image,
4256 return png_image_error(image,
4260 else if (image != NULL)
4261 return png_image_error(image,