|
<html><head><title>dlib C++ Library - pngget.c</title></head><body bgcolor='white'><pre> |
|
|
|
<font color='#009900'>/* pngget.c - retrieval of values from info struct |
|
* |
|
* Last changed in libpng 1.6.1 [March 28, 2013] |
|
* Copyright (c) 1998-2013 Glenn Randers-Pehrson |
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) |
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) |
|
* |
|
* This code is released under the libpng license. |
|
* For conditions of distribution and use, see the disclaimer |
|
* and license in png.h |
|
* |
|
*/</font> |
|
|
|
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='pngpriv.h.html'>pngpriv.h</a>" |
|
|
|
<font color='#0000FF'>#if</font> defined<font face='Lucida Console'>(</font>PNG_READ_SUPPORTED<font face='Lucida Console'>)</font> <font color='#5555FF'>|</font><font color='#5555FF'>|</font> defined<font face='Lucida Console'>(</font>PNG_WRITE_SUPPORTED<font face='Lucida Console'>)</font> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_valid'></a>png_get_valid</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
png_uint_32 flag<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> flag<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>return</font><font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_size_t PNGAPI |
|
<b><a name='png_get_rowbytes'></a>png_get_rowbytes</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>rowbytes<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>return</font><font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_INFO_IMAGE_SUPPORTED |
|
png_bytepp PNGAPI |
|
<b><a name='png_get_rows'></a>png_get_rows</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>row_pointers<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>return</font><font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_EASY_ACCESS_SUPPORTED |
|
<font color='#009900'>/* Easy access to info, added in libpng-0.99 */</font> |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_image_width'></a>png_get_image_width</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>width; |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_image_height'></a>png_get_image_height</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>height; |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_byte PNGAPI |
|
<b><a name='png_get_bit_depth'></a>png_get_bit_depth</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>bit_depth; |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_byte PNGAPI |
|
<b><a name='png_get_color_type'></a>png_get_color_type</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>color_type; |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_byte PNGAPI |
|
<b><a name='png_get_filter_type'></a>png_get_filter_type</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>filter_type; |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_byte PNGAPI |
|
<b><a name='png_get_interlace_type'></a>png_get_interlace_type</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>interlace_type; |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_byte PNGAPI |
|
<b><a name='png_get_compression_type'></a>png_get_compression_type</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>compression_type; |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_x_pixels_per_meter'></a>png_get_x_pixels_per_meter</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp |
|
info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>#ifdef</font> PNG_pHYs_SUPPORTED |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_pHYs<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", |
|
"<font color='#CC0000'>png_get_x_pixels_per_meter</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>phys_unit_type <font color='#5555FF'>=</font><font color='#5555FF'>=</font> PNG_RESOLUTION_METER<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>x_pixels_per_unit<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_y_pixels_per_meter'></a>png_get_y_pixels_per_meter</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp |
|
info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>#ifdef</font> PNG_pHYs_SUPPORTED |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_pHYs<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", |
|
"<font color='#CC0000'>png_get_y_pixels_per_meter</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>phys_unit_type <font color='#5555FF'>=</font><font color='#5555FF'>=</font> PNG_RESOLUTION_METER<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>y_pixels_per_unit<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_pixels_per_meter'></a>png_get_pixels_per_meter</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>#ifdef</font> PNG_pHYs_SUPPORTED |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_pHYs<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>png_get_pixels_per_meter</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>phys_unit_type <font color='#5555FF'>=</font><font color='#5555FF'>=</font> PNG_RESOLUTION_METER <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>x_pixels_per_unit <font color='#5555FF'>=</font><font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>y_pixels_per_unit<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>x_pixels_per_unit<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_FLOATING_POINT_SUPPORTED |
|
<font color='#0000FF'><u>float</u></font> PNGAPI |
|
<b><a name='png_get_pixel_aspect_ratio'></a>png_get_pixel_aspect_ratio</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp |
|
info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>#ifdef</font> PNG_READ_pHYs_SUPPORTED |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_pHYs<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>png_get_aspect_ratio</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>x_pixels_per_unit <font color='#5555FF'>!</font><font color='#5555FF'>=</font> <font color='#979000'>0</font><font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font face='Lucida Console'>(</font><font color='#0000FF'><u>float</u></font><font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font face='Lucida Console'>(</font><font color='#0000FF'><u>float</u></font><font face='Lucida Console'>)</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>y_pixels_per_unit |
|
<font color='#5555FF'>/</font><font face='Lucida Console'>(</font><font color='#0000FF'><u>float</u></font><font face='Lucida Console'>)</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>x_pixels_per_unit<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#else</font> |
|
<font color='#BB00BB'>PNG_UNUSED</font><font face='Lucida Console'>(</font>png_ptr<font face='Lucida Console'>)</font> |
|
<font color='#BB00BB'>PNG_UNUSED</font><font face='Lucida Console'>(</font>info_ptr<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font face='Lucida Console'>(</font><font color='#0000FF'><u>float</u></font><font face='Lucida Console'>)</font><font color='#979000'>0.0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_FIXED_POINT_SUPPORTED |
|
png_fixed_point PNGAPI |
|
<b><a name='png_get_pixel_aspect_ratio_fixed'></a>png_get_pixel_aspect_ratio_fixed</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, |
|
png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>#ifdef</font> PNG_READ_pHYs_SUPPORTED |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_pHYs<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>x_pixels_per_unit <font color='#5555FF'>></font> <font color='#979000'>0</font> <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>y_pixels_per_unit <font color='#5555FF'>></font> <font color='#979000'>0</font> |
|
<font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>x_pixels_per_unit <font color='#5555FF'><</font><font color='#5555FF'>=</font> PNG_UINT_31_MAX |
|
<font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>y_pixels_per_unit <font color='#5555FF'><</font><font color='#5555FF'>=</font> PNG_UINT_31_MAX<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
png_fixed_point res; |
|
|
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>png_get_aspect_ratio_fixed</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#009900'>/* The following casts work because a PNG 4 byte integer only has a valid |
|
* range of 0..2^31-1; otherwise the cast might overflow. |
|
*/</font> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font><font color='#BB00BB'>png_muldiv</font><font face='Lucida Console'>(</font><font color='#5555FF'>&</font>res, <font face='Lucida Console'>(</font>png_int_32<font face='Lucida Console'>)</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>y_pixels_per_unit, PNG_FP_1, |
|
<font face='Lucida Console'>(</font>png_int_32<font face='Lucida Console'>)</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>x_pixels_per_unit<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> res; |
|
<b>}</b> |
|
<font color='#0000FF'>#else</font> |
|
<font color='#BB00BB'>PNG_UNUSED</font><font face='Lucida Console'>(</font>png_ptr<font face='Lucida Console'>)</font> |
|
<font color='#BB00BB'>PNG_UNUSED</font><font face='Lucida Console'>(</font>info_ptr<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>return</font> <font color='#979000'>0</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
png_int_32 PNGAPI |
|
<b><a name='png_get_x_offset_microns'></a>png_get_x_offset_microns</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>#ifdef</font> PNG_oFFs_SUPPORTED |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_oFFs<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>png_get_x_offset_microns</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>offset_unit_type <font color='#5555FF'>=</font><font color='#5555FF'>=</font> PNG_OFFSET_MICROMETER<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>x_offset<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_int_32 PNGAPI |
|
<b><a name='png_get_y_offset_microns'></a>png_get_y_offset_microns</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>#ifdef</font> PNG_oFFs_SUPPORTED |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_oFFs<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>png_get_y_offset_microns</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>offset_unit_type <font color='#5555FF'>=</font><font color='#5555FF'>=</font> PNG_OFFSET_MICROMETER<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>y_offset<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_int_32 PNGAPI |
|
<b><a name='png_get_x_offset_pixels'></a>png_get_x_offset_pixels</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>#ifdef</font> PNG_oFFs_SUPPORTED |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_oFFs<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>png_get_x_offset_pixels</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>offset_unit_type <font color='#5555FF'>=</font><font color='#5555FF'>=</font> PNG_OFFSET_PIXEL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>x_offset<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_int_32 PNGAPI |
|
<b><a name='png_get_y_offset_pixels'></a>png_get_y_offset_pixels</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>#ifdef</font> PNG_oFFs_SUPPORTED |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_oFFs<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>png_get_y_offset_pixels</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>offset_unit_type <font color='#5555FF'>=</font><font color='#5555FF'>=</font> PNG_OFFSET_PIXEL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>y_offset<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_INCH_CONVERSIONS_SUPPORTED |
|
<font color='#0000FF'>static</font> png_uint_32 |
|
<b><a name='ppi_from_ppm'></a>ppi_from_ppm</b><font face='Lucida Console'>(</font>png_uint_32 ppm<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>#if</font> <font color='#979000'>0</font> |
|
<font color='#009900'>/* The conversion is *(2.54/100), in binary (32 digits): |
|
* .00000110100000001001110101001001 |
|
*/</font> |
|
png_uint_32 t1001, t1101; |
|
ppm <font color='#5555FF'>></font><font color='#5555FF'>></font><font color='#5555FF'>=</font> <font color='#979000'>1</font>; <font color='#009900'>/* .1 */</font> |
|
t1001 <font color='#5555FF'>=</font> ppm <font color='#5555FF'>+</font> <font face='Lucida Console'>(</font>ppm <font color='#5555FF'>></font><font color='#5555FF'>></font> <font color='#979000'>3</font><font face='Lucida Console'>)</font>; <font color='#009900'>/* .1001 */</font> |
|
t1101 <font color='#5555FF'>=</font> t1001 <font color='#5555FF'>+</font> <font face='Lucida Console'>(</font>ppm <font color='#5555FF'>></font><font color='#5555FF'>></font> <font color='#979000'>1</font><font face='Lucida Console'>)</font>; <font color='#009900'>/* .1101 */</font> |
|
ppm <font color='#5555FF'>></font><font color='#5555FF'>></font><font color='#5555FF'>=</font> <font color='#979000'>20</font>; <font color='#009900'>/* .000000000000000000001 */</font> |
|
t1101 <font color='#5555FF'>+</font><font color='#5555FF'>=</font> t1101 <font color='#5555FF'>></font><font color='#5555FF'>></font> <font color='#979000'>15</font>; <font color='#009900'>/* .1101000000000001101 */</font> |
|
t1001 <font color='#5555FF'>></font><font color='#5555FF'>></font><font color='#5555FF'>=</font> <font color='#979000'>11</font>; <font color='#009900'>/* .000000000001001 */</font> |
|
t1001 <font color='#5555FF'>+</font><font color='#5555FF'>=</font> t1001 <font color='#5555FF'>></font><font color='#5555FF'>></font> <font color='#979000'>12</font>; <font color='#009900'>/* .000000000001001000000001001 */</font> |
|
ppm <font color='#5555FF'>+</font><font color='#5555FF'>=</font> t1001; <font color='#009900'>/* .000000000001001000001001001 */</font> |
|
ppm <font color='#5555FF'>+</font><font color='#5555FF'>=</font> t1101; <font color='#009900'>/* .110100000001001110101001001 */</font> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>ppm <font color='#5555FF'>+</font> <font color='#979000'>16</font><font face='Lucida Console'>)</font> <font color='#5555FF'>></font><font color='#5555FF'>></font> <font color='#979000'>5</font>;<font color='#009900'>/* .00000110100000001001110101001001 */</font> |
|
<font color='#0000FF'>#else</font> |
|
<font color='#009900'>/* The argument is a PNG unsigned integer, so it is not permitted |
|
* to be bigger than 2^31. |
|
*/</font> |
|
png_fixed_point result; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>ppm <font color='#5555FF'><</font><font color='#5555FF'>=</font> PNG_UINT_31_MAX <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font color='#BB00BB'>png_muldiv</font><font face='Lucida Console'>(</font><font color='#5555FF'>&</font>result, <font face='Lucida Console'>(</font>png_int_32<font face='Lucida Console'>)</font>ppm, <font color='#979000'>127</font>, |
|
<font color='#979000'>5000</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> result; |
|
|
|
<font color='#009900'>/* Overflow. */</font> |
|
<font color='#0000FF'>return</font> <font color='#979000'>0</font>; |
|
<font color='#0000FF'>#endif</font> |
|
<b>}</b> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_pixels_per_inch'></a>png_get_pixels_per_inch</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>return</font> <font color='#BB00BB'>ppi_from_ppm</font><font face='Lucida Console'>(</font><font color='#BB00BB'>png_get_pixels_per_meter</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_x_pixels_per_inch'></a>png_get_x_pixels_per_inch</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>return</font> <font color='#BB00BB'>ppi_from_ppm</font><font face='Lucida Console'>(</font><font color='#BB00BB'>png_get_x_pixels_per_meter</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_y_pixels_per_inch'></a>png_get_y_pixels_per_inch</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>return</font> <font color='#BB00BB'>ppi_from_ppm</font><font face='Lucida Console'>(</font><font color='#BB00BB'>png_get_y_pixels_per_meter</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_FIXED_POINT_SUPPORTED |
|
<font color='#0000FF'>static</font> png_fixed_point |
|
<b><a name='png_fixed_inches_from_microns'></a>png_fixed_inches_from_microns</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_int_32 microns<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#009900'>/* Convert from metres * 1,000,000 to inches * 100,000, meters to |
|
* inches is simply *(100/2.54), so we want *(10/2.54) == 500/127. |
|
* Notice that this can overflow - a warning is output and 0 is |
|
* returned. |
|
*/</font> |
|
<font color='#0000FF'>return</font> <font color='#BB00BB'>png_muldiv_warn</font><font face='Lucida Console'>(</font>png_ptr, microns, <font color='#979000'>500</font>, <font color='#979000'>127</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_fixed_point PNGAPI |
|
<b><a name='png_get_x_offset_inches_fixed'></a>png_get_x_offset_inches_fixed</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, |
|
png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>return</font> <font color='#BB00BB'>png_fixed_inches_from_microns</font><font face='Lucida Console'>(</font>png_ptr, |
|
<font color='#BB00BB'>png_get_x_offset_microns</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_FIXED_POINT_SUPPORTED |
|
png_fixed_point PNGAPI |
|
<b><a name='png_get_y_offset_inches_fixed'></a>png_get_y_offset_inches_fixed</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, |
|
png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>return</font> <font color='#BB00BB'>png_fixed_inches_from_microns</font><font face='Lucida Console'>(</font>png_ptr, |
|
<font color='#BB00BB'>png_get_y_offset_microns</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_FLOATING_POINT_SUPPORTED |
|
<font color='#0000FF'><u>float</u></font> PNGAPI |
|
<b><a name='png_get_x_offset_inches'></a>png_get_x_offset_inches</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#009900'>/* To avoid the overflow do the conversion directly in floating |
|
* point. |
|
*/</font> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>float</u></font><font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font color='#BB00BB'>png_get_x_offset_microns</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font face='Lucida Console'>)</font> <font color='#5555FF'>*</font> .<font color='#979000'>00003937</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_FLOATING_POINT_SUPPORTED |
|
<font color='#0000FF'><u>float</u></font> PNGAPI |
|
<b><a name='png_get_y_offset_inches'></a>png_get_y_offset_inches</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#009900'>/* To avoid the overflow do the conversion directly in floating |
|
* point. |
|
*/</font> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>float</u></font><font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font color='#BB00BB'>png_get_y_offset_microns</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font face='Lucida Console'>)</font> <font color='#5555FF'>*</font> .<font color='#979000'>00003937</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_pHYs_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_pHYs_dpi'></a>png_get_pHYs_dpi</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
png_uint_32 <font color='#5555FF'>*</font>res_x, png_uint_32 <font color='#5555FF'>*</font>res_y, <font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>unit_type<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
png_uint_32 retval <font color='#5555FF'>=</font> <font color='#979000'>0</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_pHYs<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>pHYs</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>res_x <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>res_x <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>x_pixels_per_unit; |
|
retval <font color='#5555FF'>|</font><font color='#5555FF'>=</font> PNG_INFO_pHYs; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>res_y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>res_y <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>y_pixels_per_unit; |
|
retval <font color='#5555FF'>|</font><font color='#5555FF'>=</font> PNG_INFO_pHYs; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>unit_type <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>unit_type <font color='#5555FF'>=</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>int</u></font><font face='Lucida Console'>)</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>phys_unit_type; |
|
retval <font color='#5555FF'>|</font><font color='#5555FF'>=</font> PNG_INFO_pHYs; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font><font color='#5555FF'>*</font>unit_type <font color='#5555FF'>=</font><font color='#5555FF'>=</font> <font color='#979000'>1</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>res_x <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> <font color='#5555FF'>*</font>res_x <font color='#5555FF'>=</font> <font face='Lucida Console'>(</font>png_uint_32<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font color='#5555FF'>*</font>res_x <font color='#5555FF'>*</font> .<font color='#979000'>0254</font> <font color='#5555FF'>+</font> .<font color='#979000'>50</font><font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>res_y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> <font color='#5555FF'>*</font>res_y <font color='#5555FF'>=</font> <font face='Lucida Console'>(</font>png_uint_32<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font color='#5555FF'>*</font>res_y <font color='#5555FF'>*</font> .<font color='#979000'>0254</font> <font color='#5555FF'>+</font> .<font color='#979000'>50</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<b>}</b> |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>retval<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> <font color='#009900'>/* PNG_pHYs_SUPPORTED */</font> |
|
<font color='#0000FF'>#endif</font> <font color='#009900'>/* PNG_INCH_CONVERSIONS_SUPPORTED */</font> |
|
|
|
<font color='#009900'>/* png_get_channels really belongs in here, too, but it's been around longer */</font> |
|
|
|
<font color='#0000FF'>#endif</font> <font color='#009900'>/* PNG_EASY_ACCESS_SUPPORTED */</font> |
|
|
|
|
|
png_byte PNGAPI |
|
<b><a name='png_get_channels'></a>png_get_channels</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>channels<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_READ_SUPPORTED |
|
png_const_bytep PNGAPI |
|
<b><a name='png_get_signature'></a>png_get_signature</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>signature<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>NULL<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_bKGD_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_bKGD'></a>png_get_bKGD</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_inforp info_ptr, |
|
png_color_16p <font color='#5555FF'>*</font>background<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_bKGD<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>&</font><font color='#5555FF'>&</font> background <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>bKGD</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#5555FF'>*</font>background <font color='#5555FF'>=</font> <font color='#5555FF'>&</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>background<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_bKGD<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_cHRM_SUPPORTED |
|
<font color='#009900'>/* The XYZ APIs were added in 1.5.5 to take advantage of the code added at the |
|
* same time to correct the rgb grayscale coefficient defaults obtained from the |
|
* cHRM chunk in 1.5.4 |
|
*/</font> |
|
# ifdef PNG_FLOATING_POINT_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_cHRM'></a>png_get_cHRM</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
<font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>white_x, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>white_y, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>red_x, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>red_y, |
|
<font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>green_x, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>green_y, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>blue_x, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>blue_y<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#009900'>/* Quiet API change: this code used to only return the end points if a cHRM |
|
* chunk was present, but the end points can also come from iCCP or sRGB |
|
* chunks, so in 1.6.0 the png_get_ APIs return the end points regardless and |
|
* the png_set_ APIs merely check that set end points are mutually |
|
* consistent. |
|
*/</font> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
<font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.flags <font color='#5555FF'>&</font> PNG_COLORSPACE_HAVE_ENDPOINTS<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>cHRM</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>white_x <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>white_x <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, |
|
info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.whitex, "<font color='#CC0000'>cHRM white X</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>white_y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>white_y <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, |
|
info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.whitey, "<font color='#CC0000'>cHRM white Y</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>red_x <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>red_x <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.redx, |
|
"<font color='#CC0000'>cHRM red X</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>red_y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>red_y <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.redy, |
|
"<font color='#CC0000'>cHRM red Y</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>green_x <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>green_x <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, |
|
info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.greenx, "<font color='#CC0000'>cHRM green X</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>green_y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>green_y <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, |
|
info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.greeny, "<font color='#CC0000'>cHRM green Y</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>blue_x <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>blue_x <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.bluex, |
|
"<font color='#CC0000'>cHRM blue X</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>blue_y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>blue_y <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.bluey, |
|
"<font color='#CC0000'>cHRM blue Y</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_cHRM<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_cHRM_XYZ'></a>png_get_cHRM_XYZ</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
<font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>red_X, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>red_Y, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>red_Z, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>green_X, |
|
<font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>green_Y, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>green_Z, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>blue_X, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>blue_Y, |
|
<font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>blue_Z<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
<font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.flags <font color='#5555FF'>&</font> PNG_COLORSPACE_HAVE_ENDPOINTS<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>cHRM_XYZ(float)</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>red_X <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>red_X <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.red_X, |
|
"<font color='#CC0000'>cHRM red X</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>red_Y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>red_Y <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.red_Y, |
|
"<font color='#CC0000'>cHRM red Y</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>red_Z <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>red_Z <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.red_Z, |
|
"<font color='#CC0000'>cHRM red Z</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>green_X <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>green_X <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, |
|
info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.green_X, "<font color='#CC0000'>cHRM green X</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>green_Y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>green_Y <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, |
|
info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.green_Y, "<font color='#CC0000'>cHRM green Y</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>green_Z <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>green_Z <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, |
|
info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.green_Z, "<font color='#CC0000'>cHRM green Z</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>blue_X <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>blue_X <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, |
|
info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.blue_X, "<font color='#CC0000'>cHRM blue X</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>blue_Y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>blue_Y <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, |
|
info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.blue_Y, "<font color='#CC0000'>cHRM blue Y</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>blue_Z <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>blue_Z <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, |
|
info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.blue_Z, "<font color='#CC0000'>cHRM blue Z</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_cHRM<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
# endif |
|
|
|
# ifdef PNG_FIXED_POINT_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_cHRM_XYZ_fixed'></a>png_get_cHRM_XYZ_fixed</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
png_fixed_point <font color='#5555FF'>*</font>int_red_X, png_fixed_point <font color='#5555FF'>*</font>int_red_Y, |
|
png_fixed_point <font color='#5555FF'>*</font>int_red_Z, png_fixed_point <font color='#5555FF'>*</font>int_green_X, |
|
png_fixed_point <font color='#5555FF'>*</font>int_green_Y, png_fixed_point <font color='#5555FF'>*</font>int_green_Z, |
|
png_fixed_point <font color='#5555FF'>*</font>int_blue_X, png_fixed_point <font color='#5555FF'>*</font>int_blue_Y, |
|
png_fixed_point <font color='#5555FF'>*</font>int_blue_Z<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
<font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.flags <font color='#5555FF'>&</font> PNG_COLORSPACE_HAVE_ENDPOINTS<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>cHRM_XYZ</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>int_red_X <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>int_red_X <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.red_X; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>int_red_Y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>int_red_Y <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.red_Y; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>int_red_Z <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>int_red_Z <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.red_Z; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>int_green_X <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>int_green_X <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.green_X; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>int_green_Y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>int_green_Y <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.green_Y; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>int_green_Z <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>int_green_Z <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.green_Z; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>int_blue_X <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>int_blue_X <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.blue_X; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>int_blue_Y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>int_blue_Y <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.blue_Y; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>int_blue_Z <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>int_blue_Z <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_XYZ.blue_Z; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_cHRM<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_cHRM_fixed'></a>png_get_cHRM_fixed</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
png_fixed_point <font color='#5555FF'>*</font>white_x, png_fixed_point <font color='#5555FF'>*</font>white_y, png_fixed_point <font color='#5555FF'>*</font>red_x, |
|
png_fixed_point <font color='#5555FF'>*</font>red_y, png_fixed_point <font color='#5555FF'>*</font>green_x, png_fixed_point <font color='#5555FF'>*</font>green_y, |
|
png_fixed_point <font color='#5555FF'>*</font>blue_x, png_fixed_point <font color='#5555FF'>*</font>blue_y<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>cHRM</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
<font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.flags <font color='#5555FF'>&</font> PNG_COLORSPACE_HAVE_ENDPOINTS<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>white_x <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>white_x <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.whitex; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>white_y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>white_y <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.whitey; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>red_x <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>red_x <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.redx; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>red_y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>red_y <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.redy; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>green_x <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>green_x <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.greenx; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>green_y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>green_y <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.greeny; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>blue_x <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>blue_x <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.bluex; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>blue_y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>blue_y <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.end_points_xy.bluey; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_cHRM<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
# endif |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_gAMA_SUPPORTED |
|
# ifdef PNG_FIXED_POINT_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_gAMA_fixed'></a>png_get_gAMA_fixed</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
png_fixed_point <font color='#5555FF'>*</font>file_gamma<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>gAMA</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
<font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.flags <font color='#5555FF'>&</font> PNG_COLORSPACE_HAVE_GAMMA<font face='Lucida Console'>)</font> <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
file_gamma <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>file_gamma <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.gamma; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_gAMA<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
# endif |
|
|
|
# ifdef PNG_FLOATING_POINT_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_gAMA'></a>png_get_gAMA</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
<font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>file_gamma<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>gAMA(float)</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
<font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.flags <font color='#5555FF'>&</font> PNG_COLORSPACE_HAVE_GAMMA<font face='Lucida Console'>)</font> <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
file_gamma <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>file_gamma <font color='#5555FF'>=</font> <font color='#BB00BB'>png_float</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.gamma, |
|
"<font color='#CC0000'>png_get_gAMA</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_gAMA<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
# endif |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_sRGB_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_sRGB'></a>png_get_sRGB</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
<font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>file_srgb_intent<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>sRGB</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_sRGB<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>&</font><font color='#5555FF'>&</font> file_srgb_intent <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>file_srgb_intent <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>colorspace.rendering_intent; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_sRGB<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_iCCP_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_iCCP'></a>png_get_iCCP</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_inforp info_ptr, |
|
png_charpp name, <font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>compression_type, |
|
png_bytepp profile, png_uint_32 <font color='#5555FF'>*</font>proflen<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>iCCP</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_iCCP<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>&</font><font color='#5555FF'>&</font> name <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> compression_type <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> profile <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
proflen <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>name <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>iccp_name; |
|
<font color='#5555FF'>*</font>profile <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>iccp_profile; |
|
<font color='#5555FF'>*</font>proflen <font color='#5555FF'>=</font> <font color='#BB00BB'>png_get_uint_32</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>iccp_profile<font face='Lucida Console'>)</font>; |
|
<font color='#009900'>/* This is somewhat irrelevant since the profile data returned has |
|
* actually been uncompressed. |
|
*/</font> |
|
<font color='#5555FF'>*</font>compression_type <font color='#5555FF'>=</font> PNG_COMPRESSION_TYPE_BASE; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_iCCP<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_sPLT_SUPPORTED |
|
<font color='#0000FF'><u>int</u></font> PNGAPI |
|
<b><a name='png_get_sPLT'></a>png_get_sPLT</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_inforp info_ptr, |
|
png_sPLT_tpp spalettes<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> spalettes <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>spalettes <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>splt_palettes; |
|
<font color='#0000FF'>return</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>splt_palettes_num; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_hIST_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_hIST'></a>png_get_hIST</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_inforp info_ptr, |
|
png_uint_16p <font color='#5555FF'>*</font>hist<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>hIST</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_hIST<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>&</font><font color='#5555FF'>&</font> hist <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>hist <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>hist; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_hIST<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_IHDR'></a>png_get_IHDR</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
png_uint_32 <font color='#5555FF'>*</font>width, png_uint_32 <font color='#5555FF'>*</font>height, <font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>bit_depth, |
|
<font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>color_type, <font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>interlace_type, <font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>compression_type, |
|
<font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>filter_type<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>IHDR</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>=</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>|</font><font color='#5555FF'>|</font> info_ptr <font color='#5555FF'>=</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>|</font><font color='#5555FF'>|</font> width <font color='#5555FF'>=</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>|</font><font color='#5555FF'>|</font> |
|
height <font color='#5555FF'>=</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>|</font><font color='#5555FF'>|</font> bit_depth <font color='#5555FF'>=</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>|</font><font color='#5555FF'>|</font> color_type <font color='#5555FF'>=</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
|
|
<font color='#5555FF'>*</font>width <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>width; |
|
<font color='#5555FF'>*</font>height <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>height; |
|
<font color='#5555FF'>*</font>bit_depth <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>bit_depth; |
|
<font color='#5555FF'>*</font>color_type <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>color_type; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>compression_type <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>compression_type <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>compression_type; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>filter_type <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>filter_type <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>filter_type; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>interlace_type <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>interlace_type <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>interlace_type; |
|
|
|
<font color='#009900'>/* This is redundant if we can be sure that the info_ptr values were all |
|
* assigned in png_set_IHDR(). We do the check anyhow in case an |
|
* application has ignored our advice not to mess with the members |
|
* of info_ptr directly. |
|
*/</font> |
|
<font color='#BB00BB'>png_check_IHDR</font><font face='Lucida Console'>(</font>png_ptr, info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>width, info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>height, |
|
info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>bit_depth, info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>color_type, info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>interlace_type, |
|
info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>compression_type, info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>filter_type<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_oFFs_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_oFFs'></a>png_get_oFFs</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
png_int_32 <font color='#5555FF'>*</font>offset_x, png_int_32 <font color='#5555FF'>*</font>offset_y, <font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>unit_type<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>oFFs</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_oFFs<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>&</font><font color='#5555FF'>&</font> offset_x <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> offset_y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> unit_type <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>offset_x <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>x_offset; |
|
<font color='#5555FF'>*</font>offset_y <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>y_offset; |
|
<font color='#5555FF'>*</font>unit_type <font color='#5555FF'>=</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>int</u></font><font face='Lucida Console'>)</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>offset_unit_type; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_oFFs<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_pCAL_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_pCAL'></a>png_get_pCAL</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_inforp info_ptr, |
|
png_charp <font color='#5555FF'>*</font>purpose, png_int_32 <font color='#5555FF'>*</font>X0, png_int_32 <font color='#5555FF'>*</font>X1, <font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>type, <font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>nparams, |
|
png_charp <font color='#5555FF'>*</font>units, png_charpp <font color='#5555FF'>*</font>params<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>pCAL</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_pCAL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>&</font><font color='#5555FF'>&</font> purpose <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> X0 <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> X1 <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> type <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
nparams <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> units <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> params <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>purpose <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>pcal_purpose; |
|
<font color='#5555FF'>*</font>X0 <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>pcal_X0; |
|
<font color='#5555FF'>*</font>X1 <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>pcal_X1; |
|
<font color='#5555FF'>*</font>type <font color='#5555FF'>=</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>int</u></font><font face='Lucida Console'>)</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>pcal_type; |
|
<font color='#5555FF'>*</font>nparams <font color='#5555FF'>=</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>int</u></font><font face='Lucida Console'>)</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>pcal_nparams; |
|
<font color='#5555FF'>*</font>units <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>pcal_units; |
|
<font color='#5555FF'>*</font>params <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>pcal_params; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_pCAL<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_sCAL_SUPPORTED |
|
# ifdef PNG_FIXED_POINT_SUPPORTED |
|
# <font color='#0000FF'>if</font> <b><a name='defined'></a>defined</b><font face='Lucida Console'>(</font>PNG_FLOATING_ARITHMETIC_SUPPORTED<font face='Lucida Console'>)</font> <font color='#5555FF'>|</font><font color='#5555FF'>|</font> \ |
|
<b><a name='defined'></a>defined</b><font face='Lucida Console'>(</font>PNG_FLOATING_POINT_SUPPORTED<font face='Lucida Console'>)</font> |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_sCAL_fixed'></a>png_get_sCAL_fixed</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
<font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>unit, png_fixed_point <font color='#5555FF'>*</font>width, png_fixed_point <font color='#5555FF'>*</font>height<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
<font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_sCAL<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>unit <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>scal_unit; |
|
<font color='#009900'>/*TODO: make this work without FP support; the API is currently eliminated |
|
* if neither floating point APIs nor internal floating point arithmetic |
|
* are enabled. |
|
*/</font> |
|
<font color='#5555FF'>*</font>width <font color='#5555FF'>=</font> <font color='#BB00BB'>png_fixed</font><font face='Lucida Console'>(</font>png_ptr, <font color='#BB00BB'>atof</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>scal_s_width<font face='Lucida Console'>)</font>, "<font color='#CC0000'>sCAL width</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#5555FF'>*</font>height <font color='#5555FF'>=</font> <font color='#BB00BB'>png_fixed</font><font face='Lucida Console'>(</font>png_ptr, <font color='#BB00BB'>atof</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>scal_s_height<font face='Lucida Console'>)</font>, |
|
"<font color='#CC0000'>sCAL height</font>"<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_sCAL<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font><font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
# endif <font color='#009900'>/* FLOATING_ARITHMETIC */</font> |
|
# endif <font color='#009900'>/* FIXED_POINT */</font> |
|
# ifdef PNG_FLOATING_POINT_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_sCAL'></a>png_get_sCAL</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
<font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>unit, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>width, <font color='#0000FF'><u>double</u></font> <font color='#5555FF'>*</font>height<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
<font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_sCAL<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>unit <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>scal_unit; |
|
<font color='#5555FF'>*</font>width <font color='#5555FF'>=</font> <font color='#BB00BB'>atof</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>scal_s_width<font face='Lucida Console'>)</font>; |
|
<font color='#5555FF'>*</font>height <font color='#5555FF'>=</font> <font color='#BB00BB'>atof</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>scal_s_height<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_sCAL<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font><font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
# endif <font color='#009900'>/* FLOATING POINT */</font> |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_sCAL_s'></a>png_get_sCAL_s</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
<font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>unit, png_charpp width, png_charpp height<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
<font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_sCAL<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>unit <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>scal_unit; |
|
<font color='#5555FF'>*</font>width <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>scal_s_width; |
|
<font color='#5555FF'>*</font>height <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>scal_s_height; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_sCAL<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font><font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> <font color='#009900'>/* sCAL */</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_pHYs_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_pHYs'></a>png_get_pHYs</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_const_inforp info_ptr, |
|
png_uint_32 <font color='#5555FF'>*</font>res_x, png_uint_32 <font color='#5555FF'>*</font>res_y, <font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>unit_type<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
png_uint_32 retval <font color='#5555FF'>=</font> <font color='#979000'>0</font>; |
|
|
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>pHYs</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> |
|
<font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_pHYs<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>res_x <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>res_x <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>x_pixels_per_unit; |
|
retval <font color='#5555FF'>|</font><font color='#5555FF'>=</font> PNG_INFO_pHYs; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>res_y <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>res_y <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>y_pixels_per_unit; |
|
retval <font color='#5555FF'>|</font><font color='#5555FF'>=</font> PNG_INFO_pHYs; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>unit_type <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>unit_type <font color='#5555FF'>=</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>int</u></font><font face='Lucida Console'>)</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>phys_unit_type; |
|
retval <font color='#5555FF'>|</font><font color='#5555FF'>=</font> PNG_INFO_pHYs; |
|
<b>}</b> |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>retval<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> <font color='#009900'>/* pHYs */</font> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_PLTE'></a>png_get_PLTE</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_inforp info_ptr, |
|
png_colorp <font color='#5555FF'>*</font>palette, <font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>num_palette<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>PLTE</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_PLTE<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>&</font><font color='#5555FF'>&</font> palette <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>palette <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>palette; |
|
<font color='#5555FF'>*</font>num_palette <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>num_palette; |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>3</font>, "<font color='#CC0000'>num_palette = %d</font>", <font color='#5555FF'>*</font>num_palette<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_PLTE<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_sBIT_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_sBIT'></a>png_get_sBIT</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_inforp info_ptr, |
|
png_color_8p <font color='#5555FF'>*</font>sig_bit<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>sBIT</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_sBIT<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>&</font><font color='#5555FF'>&</font> sig_bit <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>sig_bit <font color='#5555FF'>=</font> <font color='#5555FF'>&</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>sig_bit<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_sBIT<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_TEXT_SUPPORTED |
|
<font color='#0000FF'><u>int</u></font> PNGAPI |
|
<b><a name='png_get_text'></a>png_get_text</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_inforp info_ptr, |
|
png_textp <font color='#5555FF'>*</font>text_ptr, <font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>num_text<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>num_text <font color='#5555FF'>></font> <font color='#979000'>0</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in 0x%lx retrieval function</font>", |
|
<font face='Lucida Console'>(</font><font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font><font face='Lucida Console'>)</font>png_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>chunk_name<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>text_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>text_ptr <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>text; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>num_text <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>num_text <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>num_text; |
|
|
|
<font color='#0000FF'>return</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>num_text; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>num_text <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>num_text <font color='#5555FF'>=</font> <font color='#979000'>0</font>; |
|
|
|
<font color='#0000FF'>return</font><font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_tIME_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_tIME'></a>png_get_tIME</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_inforp info_ptr, |
|
png_timep <font color='#5555FF'>*</font>mod_time<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>tIME</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_tIME<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>&</font><font color='#5555FF'>&</font> mod_time <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>mod_time <font color='#5555FF'>=</font> <font color='#5555FF'>&</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>mod_time<font face='Lucida Console'>)</font>; |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>PNG_INFO_tIME<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_tRNS_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_tRNS'></a>png_get_tRNS</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_inforp info_ptr, |
|
png_bytep <font color='#5555FF'>*</font>trans_alpha, <font color='#0000FF'><u>int</u></font> <font color='#5555FF'>*</font>num_trans, png_color_16p <font color='#5555FF'>*</font>trans_color<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
png_uint_32 retval <font color='#5555FF'>=</font> <font color='#979000'>0</font>; |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>valid <font color='#5555FF'>&</font> PNG_INFO_tRNS<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#BB00BB'>png_debug1</font><font face='Lucida Console'>(</font><font color='#979000'>1</font>, "<font color='#CC0000'>in %s retrieval function</font>", "<font color='#CC0000'>tRNS</font>"<font face='Lucida Console'>)</font>; |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>color_type <font color='#5555FF'>=</font><font color='#5555FF'>=</font> PNG_COLOR_TYPE_PALETTE<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>trans_alpha <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>trans_alpha <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>trans_alpha; |
|
retval <font color='#5555FF'>|</font><font color='#5555FF'>=</font> PNG_INFO_tRNS; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>trans_color <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>trans_color <font color='#5555FF'>=</font> <font color='#5555FF'>&</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>trans_color<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>else</font> <font color='#009900'>/* if (info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) */</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>trans_color <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>trans_color <font color='#5555FF'>=</font> <font color='#5555FF'>&</font><font face='Lucida Console'>(</font>info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>trans_color<font face='Lucida Console'>)</font>; |
|
retval <font color='#5555FF'>|</font><font color='#5555FF'>=</font> PNG_INFO_tRNS; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>trans_alpha <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#5555FF'>*</font>trans_alpha <font color='#5555FF'>=</font> NULL; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>num_trans <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>num_trans <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>num_trans; |
|
retval <font color='#5555FF'>|</font><font color='#5555FF'>=</font> PNG_INFO_tRNS; |
|
<b>}</b> |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>retval<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED |
|
<font color='#0000FF'><u>int</u></font> PNGAPI |
|
<b><a name='png_get_unknown_chunks'></a>png_get_unknown_chunks</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr, png_inforp info_ptr, |
|
png_unknown_chunkpp unknowns<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> unknowns <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#5555FF'>*</font>unknowns <font color='#5555FF'>=</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>unknown_chunks; |
|
<font color='#0000FF'>return</font> info_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>unknown_chunks_num; |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_READ_RGB_TO_GRAY_SUPPORTED |
|
png_byte PNGAPI |
|
<b><a name='png_get_rgb_to_gray_status'></a>png_get_rgb_to_gray_status</b> <font face='Lucida Console'>(</font>png_const_structrp png_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>png_byte<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font>png_ptr ? png_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>rgb_to_gray_status : <font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_USER_CHUNKS_SUPPORTED |
|
png_voidp PNGAPI |
|
<b><a name='png_get_user_chunk_ptr'></a>png_get_user_chunk_ptr</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>png_ptr ? png_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>user_chunk_ptr : NULL<font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> |
|
|
|
png_size_t PNGAPI |
|
<b><a name='png_get_compression_buffer_size'></a>png_get_compression_buffer_size</b><font face='Lucida Console'>(</font>png_const_structrp png_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>=</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> <font color='#979000'>0</font>; |
|
|
|
# ifdef PNG_WRITE_SUPPORTED |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>mode <font color='#5555FF'>&</font> PNG_IS_READ_STRUCT<font face='Lucida Console'>)</font> |
|
# endif |
|
<b>{</b> |
|
# ifdef PNG_SEQUENTIAL_READ_SUPPORTED |
|
<font color='#0000FF'>return</font> png_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>IDAT_read_size; |
|
# <font color='#0000FF'>else</font> |
|
<font color='#0000FF'>return</font> PNG_IDAT_READ_SIZE; |
|
# endif |
|
<b>}</b> |
|
|
|
# ifdef PNG_WRITE_SUPPORTED |
|
<font color='#0000FF'>else</font> |
|
<font color='#0000FF'>return</font> png_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>zbuffer_size; |
|
# endif |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_SET_USER_LIMITS_SUPPORTED |
|
<font color='#009900'>/* These functions were added to libpng 1.2.6 and were enabled |
|
* by default in libpng-1.4.0 */</font> |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_user_width_max'></a>png_get_user_width_max</b> <font face='Lucida Console'>(</font>png_const_structrp png_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>png_ptr ? png_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>user_width_max : <font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_user_height_max'></a>png_get_user_height_max</b> <font face='Lucida Console'>(</font>png_const_structrp png_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>png_ptr ? png_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>user_height_max : <font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#009900'>/* This function was added to libpng 1.4.0 */</font> |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_chunk_cache_max'></a>png_get_chunk_cache_max</b> <font face='Lucida Console'>(</font>png_const_structrp png_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>png_ptr ? png_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>user_chunk_cache_max : <font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
|
|
<font color='#009900'>/* This function was added to libpng 1.4.1 */</font> |
|
png_alloc_size_t PNGAPI |
|
<b><a name='png_get_chunk_malloc_max'></a>png_get_chunk_malloc_max</b> <font face='Lucida Console'>(</font>png_const_structrp png_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font>png_ptr ? png_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>user_chunk_malloc_max : <font color='#979000'>0</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> <font color='#009900'>/* ?PNG_SET_USER_LIMITS_SUPPORTED */</font> |
|
|
|
<font color='#009900'>/* These functions were added to libpng 1.4.0 */</font> |
|
<font color='#0000FF'>#ifdef</font> PNG_IO_STATE_SUPPORTED |
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_io_state'></a>png_get_io_state</b> <font face='Lucida Console'>(</font>png_const_structrp png_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>return</font> png_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>io_state; |
|
<b>}</b> |
|
|
|
png_uint_32 PNGAPI |
|
<b><a name='png_get_io_chunk_type'></a>png_get_io_chunk_type</b> <font face='Lucida Console'>(</font>png_const_structrp png_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>return</font> png_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>chunk_name; |
|
<b>}</b> |
|
<font color='#0000FF'>#endif</font> <font color='#009900'>/* ?PNG_IO_STATE_SUPPORTED */</font> |
|
|
|
<font color='#0000FF'>#ifdef</font> PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED |
|
# ifdef PNG_GET_PALETTE_MAX_SUPPORTED |
|
<font color='#0000FF'><u>int</u></font> PNGAPI |
|
<b><a name='png_get_palette_max'></a>png_get_palette_max</b><font face='Lucida Console'>(</font>png_const_structp png_ptr, png_const_infop info_ptr<font face='Lucida Console'>)</font> |
|
<b>{</b> |
|
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>png_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL <font color='#5555FF'>&</font><font color='#5555FF'>&</font> info_ptr <font color='#5555FF'>!</font><font color='#5555FF'>=</font> NULL<font face='Lucida Console'>)</font> |
|
<font color='#0000FF'>return</font> png_ptr<font color='#5555FF'>-</font><font color='#5555FF'>></font>num_palette_max; |
|
|
|
<font color='#0000FF'>return</font> <font face='Lucida Console'>(</font><font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>; |
|
<b>}</b> |
|
# endif |
|
<font color='#0000FF'>#endif</font> |
|
|
|
<font color='#0000FF'>#endif</font> <font color='#009900'>/* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */</font> |
|
|
|
</pre></body></html> |