src/java.desktop/share/native/libsplashscreen/libpng/pngget.c
author serb
Wed, 12 Jun 2019 13:50:37 -0700
changeset 57618 53154e45385a
parent 51304 66d9993dd4ad
permissions -rw-r--r--
8217676: Upgrade libpng to 1.6.37 Reviewed-by: prr, jdv, kcr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     6
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     8
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
/* pngget.c - retrieval of values from info struct
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * This file is available under and governed by the GNU General Public
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * License version 2 only, as published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * However, the following notice accompanied the original version of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * file and, per its terms, should not be removed:
48280
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
    31
 *
57618
53154e45385a 8217676: Upgrade libpng to 1.6.37
serb
parents: 51304
diff changeset
    32
 * Copyright (c) 2018 Cosmin Truta
51304
66d9993dd4ad 8208353: Upgrade JDK 11 to libpng 1.6.35
prr
parents: 48280
diff changeset
    33
 * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
57618
53154e45385a 8217676: Upgrade libpng to 1.6.37
serb
parents: 51304
diff changeset
    34
 * Copyright (c) 1996-1997 Andreas Dilger
53154e45385a 8217676: Upgrade libpng to 1.6.37
serb
parents: 51304
diff changeset
    35
 * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    36
 *
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    37
 * This code is released under the libpng license.
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    38
 * For conditions of distribution and use, see the disclaimer
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    39
 * and license in png.h
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    40
 *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    43
#include "pngpriv.h"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
    48
png_get_valid(png_const_structrp png_ptr, png_const_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    49
    png_uint_32 flag)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
   if (png_ptr != NULL && info_ptr != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
      return(info_ptr->valid & flag);
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    53
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    54
   return(0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
51304
66d9993dd4ad 8208353: Upgrade JDK 11 to libpng 1.6.35
prr
parents: 48280
diff changeset
    57
size_t PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
    58
png_get_rowbytes(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
   if (png_ptr != NULL && info_ptr != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
      return(info_ptr->rowbytes);
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    62
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    63
   return(0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    66
#ifdef PNG_INFO_IMAGE_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
png_bytepp PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
    68
png_get_rows(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
   if (png_ptr != NULL && info_ptr != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
      return(info_ptr->row_pointers);
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    72
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    73
   return(0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
#ifdef PNG_EASY_ACCESS_SUPPORTED
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    78
/* Easy access to info, added in libpng-0.99 */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
    80
png_get_image_width(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
   if (png_ptr != NULL && info_ptr != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
      return info_ptr->width;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    84
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
    89
png_get_image_height(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
   if (png_ptr != NULL && info_ptr != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
      return info_ptr->height;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
    93
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
png_byte PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
    98
png_get_bit_depth(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
   if (png_ptr != NULL && info_ptr != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
      return info_ptr->bit_depth;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   102
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
png_byte PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   107
png_get_color_type(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
   if (png_ptr != NULL && info_ptr != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
      return info_ptr->color_type;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   111
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
png_byte PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   116
png_get_filter_type(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
   if (png_ptr != NULL && info_ptr != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
      return info_ptr->filter_type;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   120
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
png_byte PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   125
png_get_interlace_type(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
   if (png_ptr != NULL && info_ptr != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
      return info_ptr->interlace_type;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   129
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
png_byte PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   134
png_get_compression_type(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
   if (png_ptr != NULL && info_ptr != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
      return info_ptr->compression_type;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   138
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   143
png_get_x_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   144
   info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   146
#ifdef PNG_pHYs_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   147
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   148
       (info_ptr->valid & PNG_INFO_pHYs) != 0)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   149
      {
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   150
         png_debug1(1, "in %s retrieval function",
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   151
             "png_get_x_pixels_per_meter");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   152
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   153
         if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   154
            return (info_ptr->x_pixels_per_unit);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   155
      }
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   156
#else
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   157
   PNG_UNUSED(png_ptr)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   158
   PNG_UNUSED(info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
#endif
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   160
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   165
png_get_y_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   166
    info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   168
#ifdef PNG_pHYs_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   169
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   170
       (info_ptr->valid & PNG_INFO_pHYs) != 0)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
   {
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   172
      png_debug1(1, "in %s retrieval function",
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   173
          "png_get_y_pixels_per_meter");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   174
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   175
      if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   176
         return (info_ptr->y_pixels_per_unit);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
   }
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   178
#else
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   179
   PNG_UNUSED(png_ptr)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   180
   PNG_UNUSED(info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
#endif
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   182
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   187
png_get_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   189
#ifdef PNG_pHYs_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   190
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   191
       (info_ptr->valid & PNG_INFO_pHYs) != 0)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
   {
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   193
      png_debug1(1, "in %s retrieval function", "png_get_pixels_per_meter");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   194
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   195
      if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER &&
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   196
          info_ptr->x_pixels_per_unit == info_ptr->y_pixels_per_unit)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   197
         return (info_ptr->x_pixels_per_unit);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
   }
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   199
#else
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   200
   PNG_UNUSED(png_ptr)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   201
   PNG_UNUSED(info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
#endif
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   203
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
#ifdef PNG_FLOATING_POINT_SUPPORTED
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
float PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   209
png_get_pixel_aspect_ratio(png_const_structrp png_ptr, png_const_inforp
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   210
   info_ptr)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   211
{
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   212
#ifdef PNG_READ_pHYs_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   213
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   214
       (info_ptr->valid & PNG_INFO_pHYs) != 0)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
   {
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   216
      png_debug1(1, "in %s retrieval function", "png_get_aspect_ratio");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   217
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   218
      if (info_ptr->x_pixels_per_unit != 0)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
         return ((float)((float)info_ptr->y_pixels_per_unit
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   220
             /(float)info_ptr->x_pixels_per_unit));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
   }
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   222
#else
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   223
   PNG_UNUSED(png_ptr)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   224
   PNG_UNUSED(info_ptr)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   225
#endif
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   226
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   227
   return ((float)0.0);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   228
}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
#endif
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   230
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   231
#ifdef PNG_FIXED_POINT_SUPPORTED
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   232
png_fixed_point PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   233
png_get_pixel_aspect_ratio_fixed(png_const_structrp png_ptr,
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   234
    png_const_inforp info_ptr)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   235
{
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   236
#ifdef PNG_READ_pHYs_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   237
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   238
       (info_ptr->valid & PNG_INFO_pHYs) != 0 &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   239
       info_ptr->x_pixels_per_unit > 0 && info_ptr->y_pixels_per_unit > 0 &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   240
       info_ptr->x_pixels_per_unit <= PNG_UINT_31_MAX &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   241
       info_ptr->y_pixels_per_unit <= PNG_UINT_31_MAX)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   242
   {
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   243
      png_fixed_point res;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   244
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   245
      png_debug1(1, "in %s retrieval function", "png_get_aspect_ratio_fixed");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   246
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   247
      /* The following casts work because a PNG 4 byte integer only has a valid
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   248
       * range of 0..2^31-1; otherwise the cast might overflow.
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   249
       */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   250
      if (png_muldiv(&res, (png_int_32)info_ptr->y_pixels_per_unit, PNG_FP_1,
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   251
          (png_int_32)info_ptr->x_pixels_per_unit) != 0)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   252
         return res;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   253
   }
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   254
#else
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   255
   PNG_UNUSED(png_ptr)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   256
   PNG_UNUSED(info_ptr)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   257
#endif
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   258
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   259
   return 0;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
png_int_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   264
png_get_x_offset_microns(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   266
#ifdef PNG_oFFs_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   267
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   268
       (info_ptr->valid & PNG_INFO_oFFs) != 0)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
   {
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   270
      png_debug1(1, "in %s retrieval function", "png_get_x_offset_microns");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   271
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   272
      if (info_ptr->offset_unit_type == PNG_OFFSET_MICROMETER)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   273
         return (info_ptr->x_offset);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
   }
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   275
#else
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   276
   PNG_UNUSED(png_ptr)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   277
   PNG_UNUSED(info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
#endif
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   279
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
png_int_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   284
png_get_y_offset_microns(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   286
#ifdef PNG_oFFs_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   287
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   288
       (info_ptr->valid & PNG_INFO_oFFs) != 0)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
   {
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   290
      png_debug1(1, "in %s retrieval function", "png_get_y_offset_microns");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   291
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   292
      if (info_ptr->offset_unit_type == PNG_OFFSET_MICROMETER)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   293
         return (info_ptr->y_offset);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
   }
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   295
#else
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   296
   PNG_UNUSED(png_ptr)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   297
   PNG_UNUSED(info_ptr)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   298
#endif
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   299
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
   return (0);
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   301
}
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   302
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   303
png_int_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   304
png_get_x_offset_pixels(png_const_structrp png_ptr, png_const_inforp info_ptr)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   305
{
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   306
#ifdef PNG_oFFs_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   307
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   308
       (info_ptr->valid & PNG_INFO_oFFs) != 0)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   309
   {
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   310
      png_debug1(1, "in %s retrieval function", "png_get_x_offset_pixels");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   311
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   312
      if (info_ptr->offset_unit_type == PNG_OFFSET_PIXEL)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   313
         return (info_ptr->x_offset);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   314
   }
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   315
#else
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   316
   PNG_UNUSED(png_ptr)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   317
   PNG_UNUSED(info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
#endif
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   319
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
png_int_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   324
png_get_y_offset_pixels(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   326
#ifdef PNG_oFFs_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   327
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   328
       (info_ptr->valid & PNG_INFO_oFFs) != 0)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
   {
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   330
      png_debug1(1, "in %s retrieval function", "png_get_y_offset_pixels");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   331
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   332
      if (info_ptr->offset_unit_type == PNG_OFFSET_PIXEL)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   333
         return (info_ptr->y_offset);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
   }
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   335
#else
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   336
   PNG_UNUSED(png_ptr)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   337
   PNG_UNUSED(info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   343
#ifdef PNG_INCH_CONVERSIONS_SUPPORTED
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   344
static png_uint_32
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   345
ppi_from_ppm(png_uint_32 ppm)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   347
#if 0
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   348
   /* The conversion is *(2.54/100), in binary (32 digits):
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   349
    * .00000110100000001001110101001001
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   350
    */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   351
   png_uint_32 t1001, t1101;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   352
   ppm >>= 1;                  /* .1 */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   353
   t1001 = ppm + (ppm >> 3);   /* .1001 */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   354
   t1101 = t1001 + (ppm >> 1); /* .1101 */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   355
   ppm >>= 20;                 /* .000000000000000000001 */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   356
   t1101 += t1101 >> 15;       /* .1101000000000001101 */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   357
   t1001 >>= 11;               /* .000000000001001 */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   358
   t1001 += t1001 >> 12;       /* .000000000001001000000001001 */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   359
   ppm += t1001;               /* .000000000001001000001001001 */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   360
   ppm += t1101;               /* .110100000001001110101001001 */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   361
   return (ppm + 16) >> 5;/* .00000110100000001001110101001001 */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   362
#else
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   363
   /* The argument is a PNG unsigned integer, so it is not permitted
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   364
    * to be bigger than 2^31.
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   365
    */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   366
   png_fixed_point result;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   367
   if (ppm <= PNG_UINT_31_MAX && png_muldiv(&result, (png_int_32)ppm, 127,
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   368
       5000) != 0)
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   369
      return (png_uint_32)result;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   370
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   371
   /* Overflow. */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   372
   return 0;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   373
#endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   377
png_get_pixels_per_inch(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   379
   return ppi_from_ppm(png_get_pixels_per_meter(png_ptr, info_ptr));
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   380
}
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   381
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   382
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   383
png_get_x_pixels_per_inch(png_const_structrp png_ptr, png_const_inforp info_ptr)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   384
{
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   385
   return ppi_from_ppm(png_get_x_pixels_per_meter(png_ptr, info_ptr));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   389
png_get_y_pixels_per_inch(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   391
   return ppi_from_ppm(png_get_y_pixels_per_meter(png_ptr, info_ptr));
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   392
}
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   393
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   394
#ifdef PNG_FIXED_POINT_SUPPORTED
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   395
static png_fixed_point
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   396
png_fixed_inches_from_microns(png_const_structrp png_ptr, png_int_32 microns)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   397
{
51304
66d9993dd4ad 8208353: Upgrade JDK 11 to libpng 1.6.35
prr
parents: 48280
diff changeset
   398
   /* Convert from meters * 1,000,000 to inches * 100,000, meters to
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   399
    * inches is simply *(100/2.54), so we want *(10/2.54) == 500/127.
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   400
    * Notice that this can overflow - a warning is output and 0 is
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   401
    * returned.
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   402
    */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   403
   return png_muldiv_warn(png_ptr, microns, 500, 127);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   406
png_fixed_point PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   407
png_get_x_offset_inches_fixed(png_const_structrp png_ptr,
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   408
    png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   410
   return png_fixed_inches_from_microns(png_ptr,
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   411
       png_get_x_offset_microns(png_ptr, info_ptr));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
}
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   413
#endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   415
#ifdef PNG_FIXED_POINT_SUPPORTED
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   416
png_fixed_point PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   417
png_get_y_offset_inches_fixed(png_const_structrp png_ptr,
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   418
    png_const_inforp info_ptr)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   419
{
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   420
   return png_fixed_inches_from_microns(png_ptr,
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   421
       png_get_y_offset_microns(png_ptr, info_ptr));
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   422
}
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   423
#endif
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   424
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   425
#ifdef PNG_FLOATING_POINT_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
float PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   427
png_get_x_offset_inches(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   429
   /* To avoid the overflow do the conversion directly in floating
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   430
    * point.
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   431
    */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   432
   return (float)(png_get_x_offset_microns(png_ptr, info_ptr) * .00003937);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
}
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   434
#endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   436
#ifdef PNG_FLOATING_POINT_SUPPORTED
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   437
float PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   438
png_get_y_offset_inches(png_const_structrp png_ptr, png_const_inforp info_ptr)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   439
{
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   440
   /* To avoid the overflow do the conversion directly in floating
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   441
    * point.
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   442
    */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   443
   return (float)(png_get_y_offset_microns(png_ptr, info_ptr) * .00003937);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   444
}
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   445
#endif
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   446
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   447
#ifdef PNG_pHYs_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   449
png_get_pHYs_dpi(png_const_structrp png_ptr, png_const_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   450
    png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
   png_uint_32 retval = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   454
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   455
       (info_ptr->valid & PNG_INFO_pHYs) != 0)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
   {
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   457
      png_debug1(1, "in %s retrieval function", "pHYs");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   458
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
      if (res_x != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
         *res_x = info_ptr->x_pixels_per_unit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
         retval |= PNG_INFO_pHYs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
      }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   464
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
      if (res_y != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
         *res_y = info_ptr->y_pixels_per_unit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
         retval |= PNG_INFO_pHYs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
      }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   470
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
      if (unit_type != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
         *unit_type = (int)info_ptr->phys_unit_type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
         retval |= PNG_INFO_pHYs;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   475
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   476
         if (*unit_type == 1)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
         {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
            if (res_x != NULL) *res_x = (png_uint_32)(*res_x * .0254 + .50);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
            if (res_y != NULL) *res_y = (png_uint_32)(*res_y * .0254 + .50);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   483
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
   return (retval);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
}
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   486
#endif /* pHYs */
40436
94ae0ede53a5 8155690: Update libPNG library to the latest up-to-date
azvegint
parents: 35296
diff changeset
   487
#endif /* INCH_CONVERSIONS */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
/* png_get_channels really belongs in here, too, but it's been around longer */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
40436
94ae0ede53a5 8155690: Update libPNG library to the latest up-to-date
azvegint
parents: 35296
diff changeset
   491
#endif /* EASY_ACCESS */
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   492
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
png_byte PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   495
png_get_channels(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
   if (png_ptr != NULL && info_ptr != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
      return(info_ptr->channels);
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   499
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   500
   return (0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   503
#ifdef PNG_READ_SUPPORTED
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   504
png_const_bytep PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   505
png_get_signature(png_const_structrp png_ptr, png_const_inforp info_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
   if (png_ptr != NULL && info_ptr != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
      return(info_ptr->signature);
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   509
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   510
   return (NULL);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
}
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   512
#endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   514
#ifdef PNG_bKGD_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   516
png_get_bKGD(png_const_structrp png_ptr, png_inforp info_ptr,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   517
    png_color_16p *background)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
{
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   519
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   520
       (info_ptr->valid & PNG_INFO_bKGD) != 0 &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   521
       background != NULL)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
   {
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   523
      png_debug1(1, "in %s retrieval function", "bKGD");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   524
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
      *background = &(info_ptr->background);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
      return (PNG_INFO_bKGD);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   528
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   533
#ifdef PNG_cHRM_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   534
/* The XYZ APIs were added in 1.5.5 to take advantage of the code added at the
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   535
 * same time to correct the rgb grayscale coefficient defaults obtained from the
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   536
 * cHRM chunk in 1.5.4
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   537
 */
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   538
#  ifdef PNG_FLOATING_POINT_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   540
png_get_cHRM(png_const_structrp png_ptr, png_const_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   541
    double *white_x, double *white_y, double *red_x, double *red_y,
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   542
    double *green_x, double *green_y, double *blue_x, double *blue_y)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
{
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   544
   /* Quiet API change: this code used to only return the end points if a cHRM
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   545
    * chunk was present, but the end points can also come from iCCP or sRGB
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   546
    * chunks, so in 1.6.0 the png_get_ APIs return the end points regardless and
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   547
    * the png_set_ APIs merely check that set end points are mutually
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   548
    * consistent.
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   549
    */
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   550
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   551
      (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
   {
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   553
      png_debug1(1, "in %s retrieval function", "cHRM");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   554
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
      if (white_x != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   556
         *white_x = png_float(png_ptr,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   557
             info_ptr->colorspace.end_points_xy.whitex, "cHRM white X");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
      if (white_y != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   559
         *white_y = png_float(png_ptr,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   560
             info_ptr->colorspace.end_points_xy.whitey, "cHRM white Y");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
      if (red_x != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   562
         *red_x = png_float(png_ptr, info_ptr->colorspace.end_points_xy.redx,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   563
             "cHRM red X");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
      if (red_y != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   565
         *red_y = png_float(png_ptr, info_ptr->colorspace.end_points_xy.redy,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   566
             "cHRM red Y");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
      if (green_x != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   568
         *green_x = png_float(png_ptr,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   569
             info_ptr->colorspace.end_points_xy.greenx, "cHRM green X");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
      if (green_y != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   571
         *green_y = png_float(png_ptr,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   572
             info_ptr->colorspace.end_points_xy.greeny, "cHRM green Y");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
      if (blue_x != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   574
         *blue_x = png_float(png_ptr, info_ptr->colorspace.end_points_xy.bluex,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   575
             "cHRM blue X");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
      if (blue_y != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   577
         *blue_y = png_float(png_ptr, info_ptr->colorspace.end_points_xy.bluey,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   578
             "cHRM blue Y");
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   579
      return (PNG_INFO_cHRM);
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   580
   }
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   581
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   582
   return (0);
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   583
}
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   584
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   585
png_uint_32 PNGAPI
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   586
png_get_cHRM_XYZ(png_const_structrp png_ptr, png_const_inforp info_ptr,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   587
    double *red_X, double *red_Y, double *red_Z, double *green_X,
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   588
    double *green_Y, double *green_Z, double *blue_X, double *blue_Y,
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   589
    double *blue_Z)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   590
{
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   591
   if (png_ptr != NULL && info_ptr != NULL &&
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   592
       (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   593
   {
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   594
      png_debug1(1, "in %s retrieval function", "cHRM_XYZ(float)");
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   595
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   596
      if (red_X != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   597
         *red_X = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_X,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   598
             "cHRM red X");
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   599
      if (red_Y != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   600
         *red_Y = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_Y,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   601
             "cHRM red Y");
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   602
      if (red_Z != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   603
         *red_Z = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_Z,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   604
             "cHRM red Z");
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   605
      if (green_X != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   606
         *green_X = png_float(png_ptr,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   607
             info_ptr->colorspace.end_points_XYZ.green_X, "cHRM green X");
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   608
      if (green_Y != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   609
         *green_Y = png_float(png_ptr,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   610
             info_ptr->colorspace.end_points_XYZ.green_Y, "cHRM green Y");
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   611
      if (green_Z != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   612
         *green_Z = png_float(png_ptr,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   613
             info_ptr->colorspace.end_points_XYZ.green_Z, "cHRM green Z");
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   614
      if (blue_X != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   615
         *blue_X = png_float(png_ptr,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   616
             info_ptr->colorspace.end_points_XYZ.blue_X, "cHRM blue X");
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   617
      if (blue_Y != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   618
         *blue_Y = png_float(png_ptr,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   619
             info_ptr->colorspace.end_points_XYZ.blue_Y, "cHRM blue Y");
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   620
      if (blue_Z != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   621
         *blue_Z = png_float(png_ptr,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   622
             info_ptr->colorspace.end_points_XYZ.blue_Z, "cHRM blue Z");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
      return (PNG_INFO_cHRM);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   625
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
}
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   628
#  endif
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   629
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   630
#  ifdef PNG_FIXED_POINT_SUPPORTED
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   631
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   632
png_get_cHRM_XYZ_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   633
    png_fixed_point *int_red_X, png_fixed_point *int_red_Y,
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   634
    png_fixed_point *int_red_Z, png_fixed_point *int_green_X,
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   635
    png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   636
    png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   637
    png_fixed_point *int_blue_Z)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   638
{
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   639
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   640
      (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   641
   {
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   642
      png_debug1(1, "in %s retrieval function", "cHRM_XYZ");
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   643
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   644
      if (int_red_X != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   645
         *int_red_X = info_ptr->colorspace.end_points_XYZ.red_X;
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   646
      if (int_red_Y != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   647
         *int_red_Y = info_ptr->colorspace.end_points_XYZ.red_Y;
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   648
      if (int_red_Z != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   649
         *int_red_Z = info_ptr->colorspace.end_points_XYZ.red_Z;
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   650
      if (int_green_X != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   651
         *int_green_X = info_ptr->colorspace.end_points_XYZ.green_X;
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   652
      if (int_green_Y != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   653
         *int_green_Y = info_ptr->colorspace.end_points_XYZ.green_Y;
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   654
      if (int_green_Z != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   655
         *int_green_Z = info_ptr->colorspace.end_points_XYZ.green_Z;
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   656
      if (int_blue_X != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   657
         *int_blue_X = info_ptr->colorspace.end_points_XYZ.blue_X;
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   658
      if (int_blue_Y != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   659
         *int_blue_Y = info_ptr->colorspace.end_points_XYZ.blue_Y;
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   660
      if (int_blue_Z != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   661
         *int_blue_Z = info_ptr->colorspace.end_points_XYZ.blue_Z;
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   662
      return (PNG_INFO_cHRM);
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   663
   }
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   664
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   665
   return (0);
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   666
}
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   667
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   668
png_uint_32 PNGAPI
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   669
png_get_cHRM_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   670
    png_fixed_point *white_x, png_fixed_point *white_y, png_fixed_point *red_x,
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   671
    png_fixed_point *red_y, png_fixed_point *green_x, png_fixed_point *green_y,
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   672
    png_fixed_point *blue_x, png_fixed_point *blue_y)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   673
{
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   674
   png_debug1(1, "in %s retrieval function", "cHRM");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   675
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   676
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   677
      (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   678
   {
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   679
      if (white_x != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   680
         *white_x = info_ptr->colorspace.end_points_xy.whitex;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   681
      if (white_y != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   682
         *white_y = info_ptr->colorspace.end_points_xy.whitey;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   683
      if (red_x != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   684
         *red_x = info_ptr->colorspace.end_points_xy.redx;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   685
      if (red_y != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   686
         *red_y = info_ptr->colorspace.end_points_xy.redy;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   687
      if (green_x != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   688
         *green_x = info_ptr->colorspace.end_points_xy.greenx;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   689
      if (green_y != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   690
         *green_y = info_ptr->colorspace.end_points_xy.greeny;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   691
      if (blue_x != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   692
         *blue_x = info_ptr->colorspace.end_points_xy.bluex;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   693
      if (blue_y != NULL)
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   694
         *blue_y = info_ptr->colorspace.end_points_xy.bluey;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   695
      return (PNG_INFO_cHRM);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   696
   }
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   697
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   698
   return (0);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   699
}
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   700
#  endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   703
#ifdef PNG_gAMA_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   704
#  ifdef PNG_FIXED_POINT_SUPPORTED
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   705
png_uint_32 PNGAPI
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   706
png_get_gAMA_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   707
    png_fixed_point *file_gamma)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   709
   png_debug1(1, "in %s retrieval function", "gAMA");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   710
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   711
   if (png_ptr != NULL && info_ptr != NULL &&
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   712
       (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 &&
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   713
       file_gamma != NULL)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
   {
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   715
      *file_gamma = info_ptr->colorspace.gamma;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
      return (PNG_INFO_gAMA);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   718
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
}
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   721
#  endif
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   722
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   723
#  ifdef PNG_FLOATING_POINT_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   725
png_get_gAMA(png_const_structrp png_ptr, png_const_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   726
    double *file_gamma)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
{
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   728
   png_debug1(1, "in %s retrieval function", "gAMA(float)");
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   729
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   730
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   731
      (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   732
      file_gamma != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   733
   {
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   734
      *file_gamma = png_float(png_ptr, info_ptr->colorspace.gamma,
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   735
          "png_get_gAMA");
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   736
      return (PNG_INFO_gAMA);
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   737
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   738
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   739
   return (0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
}
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   741
#  endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   744
#ifdef PNG_sRGB_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   746
png_get_sRGB(png_const_structrp png_ptr, png_const_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   747
    int *file_srgb_intent)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   749
   png_debug1(1, "in %s retrieval function", "sRGB");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   750
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   751
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   752
      (info_ptr->valid & PNG_INFO_sRGB) != 0 && file_srgb_intent != NULL)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
   {
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   754
      *file_srgb_intent = info_ptr->colorspace.rendering_intent;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
      return (PNG_INFO_sRGB);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   757
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   762
#ifdef PNG_iCCP_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   764
png_get_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   765
    png_charpp name, int *compression_type,
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   766
    png_bytepp profile, png_uint_32 *proflen)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   768
   png_debug1(1, "in %s retrieval function", "iCCP");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   769
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   770
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   771
       (info_ptr->valid & PNG_INFO_iCCP) != 0 &&
51304
66d9993dd4ad 8208353: Upgrade JDK 11 to libpng 1.6.35
prr
parents: 48280
diff changeset
   772
       name != NULL && profile != NULL && proflen != NULL)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
   {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
      *name = info_ptr->iccp_name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
      *profile = info_ptr->iccp_profile;
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   776
      *proflen = png_get_uint_32(info_ptr->iccp_profile);
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   777
      /* This is somewhat irrelevant since the profile data returned has
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   778
       * actually been uncompressed.
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   779
       */
51304
66d9993dd4ad 8208353: Upgrade JDK 11 to libpng 1.6.35
prr
parents: 48280
diff changeset
   780
      if (compression_type != NULL)
66d9993dd4ad 8208353: Upgrade JDK 11 to libpng 1.6.35
prr
parents: 48280
diff changeset
   781
         *compression_type = PNG_COMPRESSION_TYPE_BASE;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
      return (PNG_INFO_iCCP);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   784
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
   return (0);
51304
66d9993dd4ad 8208353: Upgrade JDK 11 to libpng 1.6.35
prr
parents: 48280
diff changeset
   786
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   790
#ifdef PNG_sPLT_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   791
int PNGAPI
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   792
png_get_sPLT(png_const_structrp png_ptr, png_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   793
    png_sPLT_tpp spalettes)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
   if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   796
   {
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   797
      *spalettes = info_ptr->splt_palettes;
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   798
      return info_ptr->splt_palettes_num;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   799
   }
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   800
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   801
   return (0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
48280
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   805
#ifdef PNG_eXIf_SUPPORTED
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   806
png_uint_32 PNGAPI
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   807
png_get_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   808
    png_bytep *exif)
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   809
{
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   810
  png_warning(png_ptr, "png_get_eXIf does not work; use png_get_eXIf_1");
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   811
  PNG_UNUSED(info_ptr)
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   812
  PNG_UNUSED(exif)
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   813
  return 0;
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   814
}
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   815
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   816
png_uint_32 PNGAPI
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   817
png_get_eXIf_1(png_const_structrp png_ptr, png_const_inforp info_ptr,
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   818
    png_uint_32 *num_exif, png_bytep *exif)
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   819
{
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   820
   png_debug1(1, "in %s retrieval function", "eXIf");
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   821
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   822
   if (png_ptr != NULL && info_ptr != NULL &&
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   823
       (info_ptr->valid & PNG_INFO_eXIf) != 0 && exif != NULL)
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   824
   {
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   825
      *num_exif = info_ptr->num_exif;
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   826
      *exif = info_ptr->exif;
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   827
      return (PNG_INFO_eXIf);
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   828
   }
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   829
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   830
   return (0);
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   831
}
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   832
#endif
791d551bcdb8 8183960: Upgrade to libpng 1.6.34
prr
parents: 47216
diff changeset
   833
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   834
#ifdef PNG_hIST_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   836
png_get_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   837
    png_uint_16p *hist)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   839
   png_debug1(1, "in %s retrieval function", "hIST");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   840
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   841
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   842
       (info_ptr->valid & PNG_INFO_hIST) != 0 && hist != NULL)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
   {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
      *hist = info_ptr->hist;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
      return (PNG_INFO_hIST);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   847
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   853
png_get_IHDR(png_const_structrp png_ptr, png_const_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   854
    png_uint_32 *width, png_uint_32 *height, int *bit_depth,
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   855
    int *color_type, int *interlace_type, int *compression_type,
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   856
    int *filter_type)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   858
   png_debug1(1, "in %s retrieval function", "IHDR");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   859
35296
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
   860
   if (png_ptr == NULL || info_ptr == NULL)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   861
      return (0);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   862
35296
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
   863
   if (width != NULL)
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
   864
       *width = info_ptr->width;
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
   865
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
   866
   if (height != NULL)
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
   867
       *height = info_ptr->height;
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
   868
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
   869
   if (bit_depth != NULL)
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
   870
       *bit_depth = info_ptr->bit_depth;
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
   871
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
   872
   if (color_type != NULL)
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
   873
       *color_type = info_ptr->color_type;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   874
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   875
   if (compression_type != NULL)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   876
      *compression_type = info_ptr->compression_type;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   878
   if (filter_type != NULL)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   879
      *filter_type = info_ptr->filter_type;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   880
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   881
   if (interlace_type != NULL)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   882
      *interlace_type = info_ptr->interlace_type;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   883
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   884
   /* This is redundant if we can be sure that the info_ptr values were all
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   885
    * assigned in png_set_IHDR().  We do the check anyhow in case an
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   886
    * application has ignored our advice not to mess with the members
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   887
    * of info_ptr directly.
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   888
    */
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   889
   png_check_IHDR(png_ptr, info_ptr->width, info_ptr->height,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   890
       info_ptr->bit_depth, info_ptr->color_type, info_ptr->interlace_type,
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   891
       info_ptr->compression_type, info_ptr->filter_type);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   892
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   893
   return (1);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   896
#ifdef PNG_oFFs_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   898
png_get_oFFs(png_const_structrp png_ptr, png_const_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   899
    png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   901
   png_debug1(1, "in %s retrieval function", "oFFs");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   902
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   903
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   904
       (info_ptr->valid & PNG_INFO_oFFs) != 0 &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   905
       offset_x != NULL && offset_y != NULL && unit_type != NULL)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
   {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
      *offset_x = info_ptr->x_offset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
      *offset_y = info_ptr->y_offset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
      *unit_type = (int)info_ptr->offset_unit_type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
      return (PNG_INFO_oFFs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   912
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   917
#ifdef PNG_pCAL_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   919
png_get_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   920
    png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams,
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   921
    png_charp *units, png_charpp *params)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   923
   png_debug1(1, "in %s retrieval function", "pCAL");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   924
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   925
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   926
       (info_ptr->valid & PNG_INFO_pCAL) != 0 &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   927
       purpose != NULL && X0 != NULL && X1 != NULL && type != NULL &&
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   928
       nparams != NULL && units != NULL && params != NULL)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
   {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
      *purpose = info_ptr->pcal_purpose;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
      *X0 = info_ptr->pcal_X0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
      *X1 = info_ptr->pcal_X1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
      *type = (int)info_ptr->pcal_type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
      *nparams = (int)info_ptr->pcal_nparams;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
      *units = info_ptr->pcal_units;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
      *params = info_ptr->pcal_params;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
      return (PNG_INFO_pCAL);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   939
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   944
#ifdef PNG_sCAL_SUPPORTED
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   945
#  ifdef PNG_FIXED_POINT_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   946
#    if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   947
         defined(PNG_FLOATING_POINT_SUPPORTED)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   949
png_get_sCAL_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   950
    int *unit, png_fixed_point *width, png_fixed_point *height)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   952
   if (png_ptr != NULL && info_ptr != NULL &&
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   953
       (info_ptr->valid & PNG_INFO_sCAL) != 0)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   954
   {
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   955
      *unit = info_ptr->scal_unit;
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   956
      /*TODO: make this work without FP support; the API is currently eliminated
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   957
       * if neither floating point APIs nor internal floating point arithmetic
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   958
       * are enabled.
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   959
       */
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   960
      *width = png_fixed(png_ptr, atof(info_ptr->scal_s_width), "sCAL width");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   961
      *height = png_fixed(png_ptr, atof(info_ptr->scal_s_height),
43321
2b8d397c03a4 8167228: Update to libpng 1.6.28
prr
parents: 40436
diff changeset
   962
          "sCAL height");
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   963
      return (PNG_INFO_sCAL);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   964
   }
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   965
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   966
   return(0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
}
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   968
#    endif /* FLOATING_ARITHMETIC */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   969
#  endif /* FIXED_POINT */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   970
#  ifdef PNG_FLOATING_POINT_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   972
png_get_sCAL(png_const_structrp png_ptr, png_const_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   973
    int *unit, double *width, double *height)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   975
   if (png_ptr != NULL && info_ptr != NULL &&
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   976
       (info_ptr->valid & PNG_INFO_sCAL) != 0)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   977
   {
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   978
      *unit = info_ptr->scal_unit;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   979
      *width = atof(info_ptr->scal_s_width);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   980
      *height = atof(info_ptr->scal_s_height);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   981
      return (PNG_INFO_sCAL);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   982
   }
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   983
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   984
   return(0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
}
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   986
#  endif /* FLOATING POINT */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   987
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   988
png_get_sCAL_s(png_const_structrp png_ptr, png_const_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   989
    int *unit, png_charpp width, png_charpp height)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   990
{
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   991
   if (png_ptr != NULL && info_ptr != NULL &&
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
   992
       (info_ptr->valid & PNG_INFO_sCAL) != 0)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   993
   {
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   994
      *unit = info_ptr->scal_unit;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   995
      *width = info_ptr->scal_s_width;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   996
      *height = info_ptr->scal_s_height;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   997
      return (PNG_INFO_sCAL);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
   998
   }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1000
   return(0);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1001
}
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1002
#endif /* sCAL */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1003
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1004
#ifdef PNG_pHYs_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1006
png_get_pHYs(png_const_structrp png_ptr, png_const_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1007
    png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
   png_uint_32 retval = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1011
   png_debug1(1, "in %s retrieval function", "pHYs");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1012
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
   if (png_ptr != NULL && info_ptr != NULL &&
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1014
       (info_ptr->valid & PNG_INFO_pHYs) != 0)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
   {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
      if (res_x != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
         *res_x = info_ptr->x_pixels_per_unit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
         retval |= PNG_INFO_pHYs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
      }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1021
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
      if (res_y != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
         *res_y = info_ptr->y_pixels_per_unit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
         retval |= PNG_INFO_pHYs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
      }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1027
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
      if (unit_type != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
         *unit_type = (int)info_ptr->phys_unit_type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
         retval |= PNG_INFO_pHYs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1034
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
   return (retval);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
}
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1037
#endif /* pHYs */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1040
png_get_PLTE(png_const_structrp png_ptr, png_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1041
    png_colorp *palette, int *num_palette)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1043
   png_debug1(1, "in %s retrieval function", "PLTE");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1044
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1045
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1046
       (info_ptr->valid & PNG_INFO_PLTE) != 0 && palette != NULL)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
   {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
      *palette = info_ptr->palette;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
      *num_palette = info_ptr->num_palette;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1050
      png_debug1(3, "num_palette = %d", *num_palette);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
      return (PNG_INFO_PLTE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1053
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1057
#ifdef PNG_sBIT_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1059
png_get_sBIT(png_const_structrp png_ptr, png_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1060
    png_color_8p *sig_bit)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1062
   png_debug1(1, "in %s retrieval function", "sBIT");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1063
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1064
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1065
       (info_ptr->valid & PNG_INFO_sBIT) != 0 && sig_bit != NULL)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
   {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
      *sig_bit = &(info_ptr->sig_bit);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
      return (PNG_INFO_sBIT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1070
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1075
#ifdef PNG_TEXT_SUPPORTED
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1076
int PNGAPI
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1077
png_get_text(png_const_structrp png_ptr, png_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1078
    png_textp *text_ptr, int *num_text)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
   if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
   {
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1082
      png_debug1(1, "in 0x%lx retrieval function",
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1083
         (unsigned long)png_ptr->chunk_name);
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1084
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
      if (text_ptr != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
         *text_ptr = info_ptr->text;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1087
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
      if (num_text != NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
         *num_text = info_ptr->num_text;
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1090
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1091
      return info_ptr->num_text;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1093
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1094
   if (num_text != NULL)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1095
      *num_text = 0;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1096
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
   return(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1101
#ifdef PNG_tIME_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1103
png_get_tIME(png_const_structrp png_ptr, png_inforp info_ptr,
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1104
    png_timep *mod_time)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1106
   png_debug1(1, "in %s retrieval function", "tIME");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1107
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1108
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1109
       (info_ptr->valid & PNG_INFO_tIME) != 0 && mod_time != NULL)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1110
   {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
      *mod_time = &(info_ptr->mod_time);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1112
      return (PNG_INFO_tIME);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1113
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1114
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1115
   return (0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1116
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1117
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1119
#ifdef PNG_tRNS_SUPPORTED
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1121
png_get_tRNS(png_const_structrp png_ptr, png_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1122
    png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1123
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1124
   png_uint_32 retval = 0;
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1125
   if (png_ptr != NULL && info_ptr != NULL &&
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1126
       (info_ptr->valid & PNG_INFO_tRNS) != 0)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1127
   {
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1128
      png_debug1(1, "in %s retrieval function", "tRNS");
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1129
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1130
      if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1131
      {
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1132
         if (trans_alpha != NULL)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1133
         {
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1134
            *trans_alpha = info_ptr->trans_alpha;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1135
            retval |= PNG_INFO_tRNS;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1136
         }
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1137
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1138
         if (trans_color != NULL)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1139
            *trans_color = &(info_ptr->trans_color);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1140
      }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1141
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1142
      else /* if (info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1143
      {
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1144
         if (trans_color != NULL)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1145
         {
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1146
            *trans_color = &(info_ptr->trans_color);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1147
            retval |= PNG_INFO_tRNS;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1148
         }
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1149
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1150
         if (trans_alpha != NULL)
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1151
            *trans_alpha = NULL;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1152
      }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1153
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1154
      if (num_trans != NULL)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1155
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1156
         *num_trans = info_ptr->num_trans;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1157
         retval |= PNG_INFO_tRNS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1158
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1159
   }
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1160
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1161
   return (retval);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1162
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1163
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1164
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1165
#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1166
int PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1167
png_get_unknown_chunks(png_const_structrp png_ptr, png_inforp info_ptr,
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1168
    png_unknown_chunkpp unknowns)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1169
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1170
   if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1171
   {
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1172
      *unknowns = info_ptr->unknown_chunks;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1173
      return info_ptr->unknown_chunks_num;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1174
   }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1175
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1176
   return (0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1177
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1178
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1179
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1180
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1181
png_byte PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1182
png_get_rgb_to_gray_status (png_const_structrp png_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1183
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1184
   return (png_byte)(png_ptr ? png_ptr->rgb_to_gray_status : 0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1185
}
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1186
#endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1187
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1188
#ifdef PNG_USER_CHUNKS_SUPPORTED
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1189
png_voidp PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1190
png_get_user_chunk_ptr(png_const_structrp png_ptr)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1191
{
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1192
   return (png_ptr ? png_ptr->user_chunk_ptr : NULL);
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1193
}
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1194
#endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1195
51304
66d9993dd4ad 8208353: Upgrade JDK 11 to libpng 1.6.35
prr
parents: 48280
diff changeset
  1196
size_t PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1197
png_get_compression_buffer_size(png_const_structrp png_ptr)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1198
{
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1199
   if (png_ptr == NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1200
      return 0;
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1201
35296
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
  1202
#ifdef PNG_WRITE_SUPPORTED
40436
94ae0ede53a5 8155690: Update libPNG library to the latest up-to-date
azvegint
parents: 35296
diff changeset
  1203
   if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0)
35296
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
  1204
#endif
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1205
   {
35296
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
  1206
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
40436
94ae0ede53a5 8155690: Update libPNG library to the latest up-to-date
azvegint
parents: 35296
diff changeset
  1207
      return png_ptr->IDAT_read_size;
35296
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
  1208
#else
40436
94ae0ede53a5 8155690: Update libPNG library to the latest up-to-date
azvegint
parents: 35296
diff changeset
  1209
      return PNG_IDAT_READ_SIZE;
35296
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
  1210
#endif
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1211
   }
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1212
35296
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
  1213
#ifdef PNG_WRITE_SUPPORTED
40436
94ae0ede53a5 8155690: Update libPNG library to the latest up-to-date
azvegint
parents: 35296
diff changeset
  1214
   else
94ae0ede53a5 8155690: Update libPNG library to the latest up-to-date
azvegint
parents: 35296
diff changeset
  1215
      return png_ptr->zbuffer_size;
35296
659e92aaf7f4 8143941: Update splashscreen displays
azvegint
parents: 29913
diff changeset
  1216
#endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1217
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1218
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1219
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1220
/* These functions were added to libpng 1.2.6 and were enabled
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1221
 * by default in libpng-1.4.0 */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1222
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1223
png_get_user_width_max (png_const_structrp png_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1224
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1225
   return (png_ptr ? png_ptr->user_width_max : 0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1226
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1227
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1228
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1229
png_get_user_height_max (png_const_structrp png_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1230
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1231
   return (png_ptr ? png_ptr->user_height_max : 0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1232
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1233
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1234
/* This function was added to libpng 1.4.0 */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1235
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1236
png_get_chunk_cache_max (png_const_structrp png_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1237
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1238
   return (png_ptr ? png_ptr->user_chunk_cache_max : 0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1239
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1240
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1241
/* This function was added to libpng 1.4.1 */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1242
png_alloc_size_t PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1243
png_get_chunk_malloc_max (png_const_structrp png_ptr)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1244
{
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1245
   return (png_ptr ? png_ptr->user_chunk_malloc_max : 0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1246
}
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1247
#endif /* SET_USER_LIMITS */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1248
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1249
/* These functions were added to libpng 1.4.0 */
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1250
#ifdef PNG_IO_STATE_SUPPORTED
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1251
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1252
png_get_io_state (png_const_structrp png_ptr)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1253
{
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1254
   return png_ptr->io_state;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1255
}
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1256
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1257
png_uint_32 PNGAPI
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1258
png_get_io_chunk_type (png_const_structrp png_ptr)
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1259
{
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1260
   return png_ptr->chunk_name;
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1261
}
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1262
#endif /* IO_STATE */
10576
db3409425573 7088287: libpng need to be updated.
bae
parents: 5506
diff changeset
  1263
29913
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1264
#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1265
#  ifdef PNG_GET_PALETTE_MAX_SUPPORTED
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1266
int PNGAPI
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1267
png_get_palette_max(png_const_structp png_ptr, png_const_infop info_ptr)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1268
{
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1269
   if (png_ptr != NULL && info_ptr != NULL)
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1270
      return png_ptr->num_palette_max;
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1271
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1272
   return (-1);
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1273
}
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1274
#  endif
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1275
#endif
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1276
95258013e132 8069198: Upgrade image library
azvegint
parents: 25859
diff changeset
  1277
#endif /* READ || WRITE */