Linux Standard Base (LSB) - Part 1-6: Graphics and Gtk3 specification

The Trial Use Specification defines components which are not required parts of the LSB Specification.

Noyau de base normalisé Linux (LSB) — Partie 1-6: Spécification graphique et Gtk3

General Information

Status
Published
Publication Date
07-Oct-2021
Current Stage
9093 - International Standard confirmed
Start Date
05-Mar-2025
Completion Date
30-Oct-2025
Ref Project

Relations

Overview

ISO/IEC TS 23360-1-6:2021 - "Linux Standard Base (LSB) - Part 1-6: Graphics and Gtk3 specification" is a Trial Use Specification published by ISO/IEC and prepared by the Linux Foundation. It documents the graphics-related runtime libraries and interfaces that are on a standards track for inclusion in future LSB editions. The specification focuses on availability and interface definitions (APIs/ABIs) for common graphics libraries used by GTK3-based applications, including libpng15, libgdk-3, and libgtk-3, and describes how these components relate to the LSB binary and source standards.

Key topics and requirements

  • Scope: This is a Trial Use module (TUM) describing components that may or may not be required by current LSB implementations but are intended for future standardization.
  • Library runtime names (SONAMEs): The document specifies required SONAMEs such as libpng15.so.15, libgdk-3.so.0, and libgtk-3.so.0 so applications can rely on consistent shared-object names across conforming systems.
  • Interface listings: Detailed tables enumerate functions and symbols for libraries (for example, many libpng15 functions), with references to underlying GTK/GDK and libpng documentation for mandatory behavior.
  • Dynamic linker behavior: Libraries are expected to reside in an implementation-defined directory that the dynamic linker searches by default.
  • Documentation conventions and terminology: Defines terms used (ABI, API, implementation-defined, undefined, unspecified) and typographic conventions for presenting interfaces and symbol versions.
  • Normative references: Links to Gdk 3.6.4 and Gtk 3.6.4 references and ISO/IEC C standards (ISO/IEC 9899:1999); builds on POSIX definitions where applicable.

Applications and who uses it

  • Linux distribution maintainers and OS vendors - implement and package the specified GTK3 and PNG libraries with consistent SONAMEs to improve application portability.
  • Application developers - rely on stable ABI/API declarations to build GTK3 GUI applications that are portable across LSB-conformant systems.
  • System integrators and QA teams - use the specification to design compatibility tests and to validate that target systems provide required runtime libraries.
  • Independent software vendors (ISVs) and packagers - ensure binary compatibility for redistributed GTK3-based applications.

Related standards

  • ISO/IEC TS 23360-1:2006 (replaced by this edition)
  • ISO/IEC 9899:1999 (C language)
  • Gdk 3.6.4 and Gtk 3.6.4 references (normative/informative references)
  • POSIX/IEEE Std 1003.1 definitions (where referenced in the document)

Keywords: Linux Standard Base, LSB, ISO/IEC TS 23360-1-6, GTK3, libgtk-3, libgdk-3, libpng15, ABI, API, Linux compatibility, SONAME.

Technical specification
ISO/IEC TS 23360-1-6:2021 - Linux Standard Base (LSB) — Part 1-6: Graphics and Gtk3 specification Released:10/8/2021
English language
519 pages
sale 15% off
Preview
sale 15% off
Preview

Frequently Asked Questions

ISO/IEC TS 23360-1-6:2021 is a technical specification published by the International Organization for Standardization (ISO). Its full title is "Linux Standard Base (LSB) - Part 1-6: Graphics and Gtk3 specification". This standard covers: The Trial Use Specification defines components which are not required parts of the LSB Specification.

The Trial Use Specification defines components which are not required parts of the LSB Specification.

ISO/IEC TS 23360-1-6:2021 is classified under the following ICS (International Classification for Standards) categories: 35.080 - Software. The ICS classification helps identify the subject area and facilitates finding related standards.

ISO/IEC TS 23360-1-6:2021 has the following relationships with other standards: It is inter standard links to ISO 5211:2023, ISO/IEC 23360-1:2006. Understanding these relationships helps ensure you are using the most current and applicable version of the standard.

You can purchase ISO/IEC TS 23360-1-6:2021 directly from iTeh Standards. The document is available in PDF format and is delivered instantly after payment. Add the standard to your cart and complete the secure checkout process. iTeh Standards is an authorized distributor of ISO standards.

Standards Content (Sample)


TECHNICAL ISO/IEC TS
SPECIFICATION 23360-1-6
First edition
2021-10
Linux Standard Base (LSB) —
Part 1-6:
Graphics and Gtk3 specification
Noyau de base normalisé Linux (LSB) —
Partie 1-6: Spécification graphique et Gtk3
Reference number
© ISO/IEC 2021
© ISO/IEC 2021
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on
the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below
or ISO’s member body in the country of the requester.
ISO copyright office
CP 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Geneva
Phone: +41 22 749 01 11
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland
ii
© ISO/IEC 2021 – All rights reserved

ISO/IEC 23360-1-6:2021(E)
Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that are
members of ISO or IEC participate in the development of International Standards through technical
committees established by the respective organization to deal with particular fields of technical activity.
ISO and IEC technical committees collaborate in fields of mutual interest. Other international
organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the
work.
The procedures used to develop this document and those intended for its further maintenance are
described in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for the
different types of document should be noted (see www.iso.org/directives or
www.iec.ch/members_experts/refdocs).
Attention is drawn to the possibility that some of the elements of this document may be the subject of
patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. Details
of any patent rights identified during the development of the document will be in the Introduction and/or
on the ISO list of patent declarations received (see www.iso.org/patents) or the IEC list of patent
declarations received (see patents.iec.ch).
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and
expressions related to conformity assessment, as well as information about ISO's adherence to the World
Trade Organization (WTO) principles in the Technical Barriers to Trade (TBT),
see www.iso.org/iso/foreword.html. In the IEC, see www.iec.ch/understanding-standards.
This document was prepared by the Linux Foundation as Linux Standard Base (LSB): Graphics and gtk3
specification and drafted in accordance with its editorial rules. It was assigned to Joint Technical
Committee ISO/IEC JTC 1, Information technology, Subcommittee SC 22, Programming languages, their
environments and system software interfaces, and adopted by National Bodies.
This first edition of ISO/IEC TS 23360-1-6 cancels and replaces ISO/IEC 23360-1:2006, which has been
technically revised.
This document is based on “The GNU Free Documentation License, version 1.1”. The license is available
at https://www.gnu.org/licenses/old-licenses/fdl-1.1.html
A list of all parts in the ISO/IEC 23660 series can be found on the ISO and IEC websites.
Any feedback or questions on this document should be directed to the user’s national standards body. A
complete listing of these bodies can be found at www.iso.org/members.html and www.iec.ch/national-
committees.
© ISO/IEC 2021 – All rights reserved iii

Contents
Foreword .iii
Introduction . v
I Introductory Elements . 1
1 Scope . 2
2 Normative References. 3
3 Requirements . 4
3.1 TUM Libraries . 4
3.2 Gtk3 Libraries . 4
4 Terms and Definitions . 5
5 Documentation Conventions . 7
II PNG15 library . 8
6 Libraries . 9
6.1 Interfaces for libpng15 . 9
6.2 Interface Definitions for libpng15 . 13
III GTK+ Stack Libraries . 78
7 Libraries . 79
7.1 Introduction . 79
7.2 Interfaces for libgdk-3 . 79
7.3 Data Definitions for libgdk-3 . 91
7.4 Interfaces for libgtk-3 . 171
7.5 Data Definitions for libgtk-3 . 245
Annex A Alphabetical Listing of Interfaces by Library . 446
A.1 libpng15 . 446
A.2 libgdk-3. 450
A.3 libgtk-3 . 459
iv
© 2021 ISO/IEC – All rights reserved

Introduction
The Trial Use Specification describes components which may or may not be
present on an otherwise conforming system. The purpose is to indicate that these
components are on a Standards Track, that is, they are intended to become part
of the LSB Specification in a future edition.
This document should be used in conjunction with the documents it references.
Information referenced in this way is as much a part of this document as is the
information explicitly included here.
© 2021 ISO/IEC – All rights reserved v

I Introductory Elements
© 2021 ISO/IEC – All rights reserved 1

1 Scope
The Trial Use Specification defines components which are not required parts of
the LSB Specification.
2 © 2021 ISO/IEC – All rights reserved

2 Normative References
The specifications listed below are referenced in whole or in part by the Trial Use
Specification. Such references may be normative or informative; a reference to
specification shall only be considered normative if it is explicitly cited as such.
The Trial Use Specification may make normative references to a portion of these
specifications (that is, to define a specific function or group of functions); in such
cases, only the explicitly referenced portion of the specification is to be considered
normative.
Table 2-1 Informative References
Name Title URL
Gdk 3.6.4 Reference Gdk 3.6.4 Reference http://developer.gnom
Manual Manual e.org/gdk3/3.6
Gtk 3.6.4 Reference Gtk 3.6.4 Reference http://developer.gnom
Manual Manual e.org/gtk3/3.6
ISO C (1999) ISO/IEC 9899:1999 -
Programming
Languages -- C
© 2021 ISO/IEC – All rights reserved 3

3 Requirements
3.1 TUM Libraries
The libraries listed in Table 3-1 shall be available on a Linux Standard Base system
which implements the Trial Use TUM module, with the specified runtime names.
This list may be supplemented or amended by the architecture-specific
specification.
Table 3-1 Standard Library Names
Library Runtime Name
libpng15 libpng15.so.15
These libraries will be in an implementation-defined directory which the
dynamic linker shall search by default.
3.2 Gtk3 Libraries
The libraries listed in Table 3-2 shall be available on a Linux Standard Base system
which implements the Trial Use Toolkit_Gtk3 module, with the specified runtime
names. This list may be supplemented or amended by the architecture-specific
specification.
Table 3-2 Standard Library Names
Library Runtime Name
libgdk-3 libgdk-3.so.0
libgtk-3 libgtk-3.so.0
These libraries will be in an implementation-defined directory which the
dynamic linker shall search by default.
4 © 2021 ISO/IEC – All rights reserved

4 Terms and Definitions
For the purposes of this document, the terms and definitions given in ISO/IEC
2382, ISO 80000–2, and the following apply.

ISO and IEC maintain terminological databases for use in standardization at the
following addresses:
— ISO Online browsing platform: available at https://www.iso.org/obp
— IEC Electropedia: available at http://www.electropedia.org/

4.1
archLSB
Some LSB specification documents have both a generic, architecture-neutral
part and an architecture-specific part. The latter describes elements whose
definitions may be unique to a particular processor architecture. The term
archLSB may be used in the generic part to refer to the corresponding section
of the architecture-specific part.
4.2
Binary Standard, ABI
The total set of interfaces that are available to be used in the compiled binary
code of a conforming application, including the run-time details such as
calling conventions, binary format, C++ name mangling, etc.
4.3
Implementation-defined
Describes a value or behavior that is not defined by this document but is
selected by an implementor. The value or behavior may vary among
implementations that conform to this document. An application should not
rely on the existence of the value or behavior. An application that relies on
such a value or behavior cannot be assured to be portable across conforming
implementations. The implementor shall document such a value or behavior
so that it can be used correctly by an application.
4.4
Shell Script
A file that is read by an interpreter (e.g., awk). The first line of the shell script
includes a reference to its interpreter binary.
4.5
Source Standard, API
The total set of interfaces that are available to be used in the source code of a
conforming application. Due to translations, the Binary Standard and the
Source Standard may contain some different interfaces.
© 2021 ISO/IEC – All rights reserved 5

4.6
Undefined
Describes the nature of a value or behavior not defined by this document
which results from use of an invalid program construct or invalid data input.
The value or behavior may vary among implementations that conform to this
document. An application should not rely on the existence or validity of the
value or behavior. An application that relies on any particular value or
behavior cannot be assured to be portable across conforming
implementations.
4.7
Unspecified
Describes the nature of a value or behavior not specified by this document
which results from use of a valid program construct or valid data input. The
value or behavior may vary among implementations that conform to this
document. An application should not rely on the existence or validity of the
value or behavior. An application that relies on any particular value or
behavior cannot be assured to be portable across conforming
implementations.
In addition, for the portions of this specification which build on IEEE Std 1003.1-
2001, the definitions given in IEEE Std 1003.1-2001, Base Definitions, Chapter 3
apply.
6 © 2021 ISO/IEC – All rights reserved

5 Documentation Conventions
Throughout this document, the following typographic conventions are used:
function()
the name of a function
command
the name of a command or utility
CONSTANT
a constant value
parameter
a parameter
variable
a variable
Throughout this specification, several tables of interfaces are presented. Each
entry in these tables has the following format:
name
the name of the interface
(symver)
An optional symbol version identifier, if required.
[refno]
A reference number indexing the table of referenced specifications that
follows this table.
For example,
forkpty(GLIBC_2.0) [SUSv4]
refers to the interface named forkpty() with symbol version GLIBC_2.0 that is
defined in the reference indicated by the tag SUSv4.
Note: For symbols with versions which differ between architectures, the symbol
versions are defined in the architecture specific parts of of this module specification
only. In the generic part, they will appear without symbol versions.

© 2021 ISO/IEC – All rights reserved 7

II PNG15 library
8 © 2021 ISO/IEC – All rights reserved

6 Libraries
6.1 Interfaces for libpng15
Table 6-1 defines the library name and shared object name for the libpng15 library
Table 6-1 libpng15 Definition
Library: libpng15
SONAME: libpng15.so.15
The behavior of the interfaces in this library is specified by the following specifi-
cations:
[LSB] This Specification
6.1.1 libpng15 interfaces
6.1.1.1 Interfaces for libpng15 interfaces
An LSB conforming implementation shall provide the generic functions for
libpng15 interfaces specified in Table 6-2, with the full mandatory functionality
as described in the referenced underlying specification.
Table 6-2 libpng15 - libpng15 interfaces Function Interfaces
png_access_version_nu png_benign_error(PNG png_build_grayscale_p
mber(PNG15_0) [LSB] 15_0) [LSB] alette(PNG15_0) [LSB]
png_calloc(PNG15_0) png_chunk_benign_err png_chunk_error(PNG
[LSB] or(PNG15_0) [LSB] 15_0) [LSB]
png_chunk_warning(P png_convert_from_stru png_convert_from_time
NG15_0) [LSB] ct_tm(PNG15_0) [LSB] _t(PNG15_0) [LSB]
png_convert_to_rfc1123 png_create_info_struct( png_create_read_struct(
(PNG15_0) [LSB] PNG15_0) [LSB] PNG15_0) [LSB]
png_create_read_struct png_create_write_struct png_create_write_struct
_2(PNG15_0) [LSB] (PNG15_0) [LSB] _2(PNG15_0) [LSB]
png_data_freer(PNG15 png_destroy_info_struc png_destroy_read_stru
_0) [LSB] t(PNG15_0) [LSB] ct(PNG15_0) [LSB]
png_destroy_write_stru png_error(PNG15_0) png_free(PNG15_0)
ct(PNG15_0) [LSB] [LSB] [LSB]
png_free_data(PNG15_ png_free_default(PNG1 png_get_IHDR(PNG15
0) [LSB] 5_0) [LSB] _0) [LSB]
png_get_PLTE(PNG15_ png_get_bKGD(PNG15 png_get_bit_depth(PN
0) [LSB] _0) [LSB] G15_0) [LSB]
png_get_cHRM(PNG15 png_get_cHRM_XYZ(P png_get_cHRM_XYZ_fi
_0) [LSB] NG15_0) [LSB] xed(PNG15_0) [LSB]
png_get_cHRM_fixed(P png_get_channels(PNG png_get_chunk_cache_
NG15_0) [LSB] 15_0) [LSB] max(PNG15_0) [LSB]
© 2021 ISO/IEC – All rights reserved 9

png_get_chunk_malloc png_get_color_type(PN png_get_compression_
_max(PNG15_0) [LSB] G15_0) [LSB] buffer_size(PNG15_0)
[LSB]
png_get_compression_t png_get_copyright(PN png_get_current_pass_
ype(PNG15_0) [LSB] G15_0) [LSB] number(PNG15_0)
[LSB]
png_get_current_row_n png_get_error_ptr(PNG png_get_filter_type(PN
umber(PNG15_0) [LSB] 15_0) [LSB] G15_0) [LSB]
png_get_gAMA(PNG15 png_get_gAMA_fixed( png_get_hIST(PNG15_0
_0) [LSB] PNG15_0) [LSB] ) [LSB]
png_get_header_ver(P png_get_header_versio png_get_iCCP(PNG15_
NG15_0) [LSB] n(PNG15_0) [LSB] 0) [LSB]
png_get_image_height( png_get_image_width( png_get_int_32(PNG15
PNG15_0) [LSB] PNG15_0) [LSB] _0) [LSB]
png_get_interlace_type( png_get_io_chunk_nam png_get_io_chunk_type
PNG15_0) [LSB] e(PNG15_0) [LSB] (PNG15_0) [LSB]
png_get_io_ptr(PNG15 png_get_io_state(PNG1 png_get_libpng_ver(PN
_0) [LSB] 5_0) [LSB] G15_0) [LSB]
png_get_mem_ptr(PNG png_get_oFFs(PNG15_0 png_get_pCAL(PNG15
15_0) [LSB] ) [LSB] _0) [LSB]
png_get_pHYs(PNG15_ png_get_pHYs_dpi(PN png_get_pixel_aspect_r
0) [LSB] G15_0) [LSB] atio(PNG15_0) [LSB]
png_get_pixel_aspect_r png_get_pixels_per_inc png_get_pixels_per_me
atio_fixed(PNG15_0) h(PNG15_0) [LSB] ter(PNG15_0) [LSB]
[LSB]
png_get_progressive_pt png_get_rgb_to_gray_st png_get_rowbytes(PN
r(PNG15_0) [LSB] atus(PNG15_0) [LSB] G15_0) [LSB]
png_get_rows(PNG15_ png_get_sBIT(PNG15_0 png_get_sCAL(PNG15_
0) [LSB] ) [LSB] 0) [LSB]
png_get_sCAL_fixed(P png_get_sCAL_s(PNG1 png_get_sPLT(PNG15_
NG15_0) [LSB] 5_0) [LSB] 0) [LSB]
png_get_sRGB(PNG15_ png_get_signature(PN png_get_tIME(PNG15_
0) [LSB] G15_0) [LSB] 0) [LSB]
png_get_tRNS(PNG15_ png_get_text(PNG15_0) png_get_uint_16(PNG1
0) [LSB] [LSB] 5_0) [LSB]
png_get_uint_31(PNG1 png_get_uint_32(PNG1 png_get_unknown_chu
5_0) [LSB] 5_0) [LSB] nks(PNG15_0) [LSB]
png_get_user_chunk_pt png_get_user_height_m png_get_user_transfor
r(PNG15_0) [LSB] ax(PNG15_0) [LSB] m_ptr(PNG15_0) [LSB]
png_get_user_width_m png_get_valid(PNG15_ png_get_x_offset_inche
ax(PNG15_0) [LSB] 0) [LSB] s(PNG15_0) [LSB]
png_get_x_offset_inche png_get_x_offset_micro png_get_x_offset_pixels
s_fixed(PNG15_0) [LSB] ns(PNG15_0) [LSB] (PNG15_0) [LSB]
10 © 2021 ISO/IEC – All rights reserved

png_get_x_pixels_per_i png_get_x_pixels_per_ png_get_y_offset_inche
nch(PNG15_0) [LSB] meter(PNG15_0) [LSB] s(PNG15_0) [LSB]
png_get_y_offset_inche png_get_y_offset_micro png_get_y_offset_pixels
s_fixed(PNG15_0) [LSB] ns(PNG15_0) [LSB] (PNG15_0) [LSB]
png_get_y_pixels_per_i png_get_y_pixels_per_ png_handle_as_unkno
nch(PNG15_0) [LSB] meter(PNG15_0) [LSB] wn(PNG15_0) [LSB]
png_info_init_3(PNG15 png_init_io(PNG15_0) png_longjmp(PNG15_0
_0) [LSB] [LSB] ) [LSB]
png_malloc(PNG15_0) png_malloc_default(PN png_malloc_warn(PNG
[LSB] G15_0) [LSB] 15_0) [LSB]
png_permit_mng_featu png_process_data(PNG png_process_data_paus
res(PNG15_0) [LSB] 15_0) [LSB] e(PNG15_0) [LSB]
png_process_data_skip( png_progressive_combi png_read_end(PNG15_
PNG15_0) [LSB] ne_row(PNG15_0) 0) [LSB]
[LSB]
png_read_image(PNG1 png_read_info(PNG15_ png_read_png(PNG15_
5_0) [LSB] 0) [LSB] 0) [LSB]
png_read_row(PNG15_ png_read_rows(PNG15 png_read_update_info(
0) [LSB] _0) [LSB] PNG15_0) [LSB]
png_reset_zstream(PN png_save_int_32(PNG1 png_save_uint_16(PNG
G15_0) [LSB] 5_0) [LSB] 15_0) [LSB]
png_save_uint_32(PNG png_set_IHDR(PNG15_ png_set_PLTE(PNG15_
15_0) [LSB] 0) [LSB] 0) [LSB]
png_set_add_alpha(PN png_set_alpha_mode(P png_set_alpha_mode_fi
G15_0) [LSB] NG15_0) [LSB] xed(PNG15_0) [LSB]
png_set_bKGD(PNG15 png_set_background(P png_set_background_fi
_0) [LSB] NG15_0) [LSB] xed(PNG15_0) [LSB]
png_set_benign_errors( png_set_bgr(PNG15_0) png_set_cHRM(PNG15
PNG15_0) [LSB] [LSB] _0) [LSB]
png_set_cHRM_XYZ(P png_set_cHRM_XYZ_fi png_set_cHRM_fixed(P
NG15_0) [LSB] xed(PNG15_0) [LSB] NG15_0) [LSB]
png_set_check_for_inva png_set_chunk_cache_ png_set_chunk_malloc_
lid_index(PNG15_0) max(PNG15_0) [LSB] max(PNG15_0) [LSB]
[LSB]
png_set_compression_b png_set_compression_l png_set_compression_
uffer_size(PNG15_0) evel(PNG15_0) [LSB] mem_level(PNG15_0)
[LSB] [LSB]
png_set_compression_ png_set_compression_s png_set_compression_
method(PNG15_0) trategy(PNG15_0) [LSB] window_bits(PNG15_0)
[LSB] [LSB]
png_set_crc_action(PN png_set_error_fn(PNG1 png_set_expand(PNG1
G15_0) [LSB] 5_0) [LSB] 5_0) [LSB]
© 2021 ISO/IEC – All rights reserved 11

png_set_expand_16(PN png_set_expand_gray_ png_set_filler(PNG15_0
G15_0) [LSB] 1_2_4_to_8(PNG15_0) ) [LSB]
[LSB]
png_set_filter(PNG15_0 png_set_filter_heuristic png_set_filter_heuristic
) [LSB] s(PNG15_0) [LSB] s_fixed(PNG15_0) [LSB]
png_set_flush(PNG15_0 png_set_gAMA(PNG15 png_set_gAMA_fixed(P
) [LSB] _0) [LSB] NG15_0) [LSB]
png_set_gamma(PNG1 png_set_gamma_fixed( png_set_gray_to_rgb(P
5_0) [LSB] PNG15_0) [LSB] NG15_0) [LSB]
png_set_hIST(PNG15_0 png_set_iCCP(PNG15_ png_set_interlace_hand
) [LSB] 0) [LSB] ling(PNG15_0) [LSB]
png_set_invalid(PNG15 png_set_invert_alpha(P png_set_invert_mono(P
_0) [LSB] NG15_0) [LSB] NG15_0) [LSB]
png_set_keep_unknow png_set_longjmp_fn(P png_set_mem_fn(PNG1
n_chunks(PNG15_0) NG15_0) [LSB] 5_0) [LSB]
[LSB]
png_set_oFFs(PNG15_0 png_set_pCAL(PNG15_ png_set_pHYs(PNG15_
) [LSB] 0) [LSB] 0) [LSB]
png_set_packing(PNG1 png_set_packswap(PN png_set_palette_to_rgb(
5_0) [LSB] G15_0) [LSB] PNG15_0) [LSB]
png_set_progressive_re png_set_quantize(PNG png_set_read_fn(PNG1
ad_fn(PNG15_0) [LSB] 15_0) [LSB] 5_0) [LSB]
png_set_read_status_fn png_set_read_user_chu png_set_read_user_tran
(PNG15_0) [LSB] nk_fn(PNG15_0) [LSB] sform_fn(PNG15_0)
[LSB]
png_set_rgb_to_gray(P png_set_rgb_to_gray_fi png_set_rows(PNG15_0
NG15_0) [LSB] xed(PNG15_0) [LSB] ) [LSB]
png_set_sBIT(PNG15_0 png_set_sCAL(PNG15_ png_set_sCAL_fixed(P
) [LSB] 0) [LSB] NG15_0) [LSB]
png_set_sCAL_s(PNG1 png_set_sPLT(PNG15_ png_set_sRGB(PNG15_
5_0) [LSB] 0) [LSB] 0) [LSB]
png_set_sRGB_gAMA_ png_set_scale_16(PNG1 png_set_shift(PNG15_0
and_cHRM(PNG15_0) 5_0) [LSB] ) [LSB]
[LSB]
png_set_sig_bytes(PNG png_set_strip_16(PNG1 png_set_strip_alpha(P
15_0) [LSB] 5_0) [LSB] NG15_0) [LSB]
png_set_swap(PNG15_ png_set_swap_alpha(P png_set_tIME(PNG15_0
0) [LSB] NG15_0) [LSB] ) [LSB]
png_set_tRNS(PNG15_ png_set_tRNS_to_alpha png_set_text(PNG15_0)
0) [LSB] (PNG15_0) [LSB] [LSB]
png_set_text_compressi png_set_text_compressi png_set_text_compressi
on_level(PNG15_0) on_mem_level(PNG15_ on_method(PNG15_0)
[LSB] 0) [LSB] [LSB]
12 © 2021 ISO/IEC – All rights reserved

png_set_text_compressi png_set_text_compressi png_set_unknown_chu
on_strategy(PNG15_0) on_window_bits(PNG1 nk_location(PNG15_0)
[LSB] 5_0) [LSB] [LSB]
png_set_unknown_chu png_set_user_limits(PN png_set_user_transfor
nks(PNG15_0) [LSB] G15_0) [LSB] m_info(PNG15_0) [LSB]
png_set_write_fn(PNG1 png_set_write_status_f png_set_write_user_tra
5_0) [LSB] n(PNG15_0) [LSB] nsform_fn(PNG15_0)
[LSB]
png_sig_cmp(PNG15_0 png_start_read_image( png_warning(PNG15_0
) [LSB] PNG15_0) [LSB] ) [LSB]
png_write_chunk(PNG png_write_chunk_data( png_write_chunk_end(
15_0) [LSB] PNG15_0) [LSB] PNG15_0) [LSB]
png_write_chunk_start( png_write_end(PNG15 png_write_flush(PNG1
PNG15_0) [LSB] _0) [LSB] 5_0) [LSB]
png_write_image(PNG png_write_info(PNG15 png_write_info_before_
15_0) [LSB] _0) [LSB] PLTE(PNG15_0) [LSB]
png_write_png(PNG15 png_write_row(PNG15 png_write_rows(PNG1
_0) [LSB] _0) [LSB] 5_0) [LSB]

png_write_sig(PNG15_
0) [LSB]
An LSB conforming implementation shall provide the generic deprecated
functions for libpng15 interfaces specified in Table 6-3, with the full mandatory
functionality as described in the referenced underlying specification.
Note: These interfaces are deprecated, and applications should avoid using them.
These interfaces may be withdrawn in future releases of this specification.
Table 6-3 libpng15 - libpng15 interfaces Deprecated Function Interfaces

png_get_io_chunk_nam
e(PNG15_0) [LSB]
6.2 Interface Definitions for libpng15
The interfaces defined on the following pages are included in libpng15 and are
defined by this specification. Unless otherwise noted, these interfaces shall be
included in the source standard.
Other interfaces listed in Section 6.1 shall behave as described in the referenced
base document.
© 2021 ISO/IEC – All rights reserved 13

png_access_version_number
Name
png_access_version_number — return version of the run-time library
Synopsis
#include
png_uint_32 png_access_version_number(void);
Description
png_access_version_number() returns version of the libpng15 library available at
run-time.
Return Value
png_access_version_number() returns integer constructed from the major
version, minor version with leading zero and leading number with leading zero.
For example, the version number for version 1.2.8 is 10208.
png_convert_from_struct_tm
Name
png_convert_from_struct_tm — convert struct tm to png_time
Synopsis
#include
void png_convert_from_struct_tm(png_timep ptime, struct tm * ttime);
Description
This interface shall convert from the struct tm time format to the png_time format.
The parameter ttime shall specify the struct tm value to convert to png_time
format.
The output parameter ptime shall contain the converted value.
png_convert_from_time_t
Name
png_convert_from_time_t — convert time_t to png_time
Synopsis
#include
void png_convert_from_time_t(png_timep ptime, time_t ttime);
Description
This interface shall convert from the time_t time format to the png_time format.
The parameter ttime shall specify the time_t value to convert to png_time format.
The output parameter ptime shall contain the converted value.
14 © 2021 ISO/IEC – All rights reserved

png_create_info_struct
Name
png_create_info_struct — allocate and initialize a png_info structure
Synopsis
#include
png_infop png_create_info_struct(png_structp png_ptr);
Description
png_create_info_struct() shall allocate and initialize a png_info structure.
Return Value
Returns the pointer to png_info structure. Returns NULL if it fails to create the
structure.
Errors
png_create_info_struct() shall return NULL if the allocation fails. The application
should check for the return value.
© 2021 ISO/IEC – All rights reserved 15

png_create_read_struct
Name
png_create_read_struct — allocate and initialize a png_struct structure
for reading PNG file
Synopsis
#include
png_structp png_create_read_struct(png_const_charp user_png_ver,
png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn);
Description
png_create_read_struct() shall allocate and initialize a png_struct structure. The
function shall return NULL if the allocation fails. The application should check
for the return value. For handling errors and warnings, the application can pass
desired error handling routines as arguments to png_create_read_struct().
Otherwise, the default error handling uses stderr and longjmp. The error
handling routine must NOT return to the calling routine.
user_png_ver
version string of the library. Must be PNG_LIBPNG_VER_STRING
error_ptr
user defined struct for error functions.
error_fn
user defined function for printing errors and aborting.
warn_fn
user defined function for warnings.
Return Value
Returns the pointer to png_struct structure. Returns NULL if it fails to create the
structure.
Errors
png_create_read_struct() shall return NULL if the allocation fails. The application
should check for the return value.
16 © 2021 ISO/IEC – All rights reserved

png_create_read_struct_2
Name
png_create_read_struct_2 — register custom read function
Synopsis
#include
png_structp png_create_read_struct_2(png_const_charp user_png_ver,
png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn,
png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn);
Description
This interface shall register a custom read function and allocate and initialize a
png_struct structure. For handling errors and warnings, as well as allocating and
deallocating memory, the application can pass functions as arguments.
Otherwise, the default error handling functions stderr and longjmp() will be
used. The error handling routine must not return to the calling routine.
The parameter user_png_ver shall specify the version string of the library, which
must be PNG_LIBPNG_VER_STRING.
The parameter error_ptr shall specify a user-defined structure for error
functions.
The parameter error_fn shall specify an optional user-defined function for
printing errors and aborting.
The parameter warn_fn shall specify an optional user-defined function for
warnings.
The parameter mem_ptr shall specify the memory to allocate.
The parameter malloc_fn shall specify an optional user-defined memory
allocation function.
The parameter free_fn shall specify an optional user-defined memory
deallocation function.
Application Usage (informative)
You should define PNG_USER_MEM_SUPPORTED before you call
png_create_read_struct2().
© 2021 ISO/IEC – All rights reserved 17

png_create_write_struct
Name
png_create_write_struct — allocate and initialize a png_struct structure
for writing PNG file
Synopsis
#include
png_structp png_create_write_struct(png_const_charp user_png_ver,
png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn);
Description
png_create_write_struct() shall allocate and initialize a png_struct structure. The
function shall return NULL if the allocation fails. The application should check
for the return value.
user_png_ver
version string of the library. Must be PNG_LIBPNG_VER_STRING
error_ptr
user defined struct for error functions.
error_fn
user defined function for printing errors and aborting.
warn_fn
user defined function for warnings.
Return Value
Returns the pointer to png_struct structure. Returns NULL if it fails to create the
structure.
18 © 2021 ISO/IEC – All rights reserved

png_create_write_struct_2
Name
png_create_write_struct_2 — register custom write function
Synopsis
#include
png_structp png_create_write_struct_2(png_const_charp user_png_ver,
png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn,
png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn);
Description
This interface shall register a custom write function and allocate and initialize a
png_struct structure. For handling errors and warnings, as well as allocating and
deallocating memory, the application can pass functions as arguments.
Otherwise, the default error handling functions stderr and longjmp() will be
used. The error handling routine must not return to the calling routine.
The parameter user_png_ver shall specify the version string of the library, which
must be PNG_LIBPNG_VER_STRING.
The parameter error_ptr shall specify a user-defined structure for error
functions.
The parameter error_fn shall specify an optional user-defined function for
printing errors and aborting.
The parameter warn_fn shall specify an optional user-defined function for
warnings.
The parameter mem_ptr shall specify the memory to allocate.
The parameter malloc_fn shall specify an optional user-defined memory
allocation function.
The parameter free_fn shall specify an optional user-defined memory
deallocation function.
Return Value
On success, returns a pointer to the png_struct that was created.
On failure, returns NULL.
© 2021 ISO/IEC – All rights reserved 19

png_data_freer
Name
png_data_freer — change the default behavior for freeing data
Synopsis
#include
void png_data_freer(png_structp png_ptr, png_infop info_ptr, int freer,
png_uint_32 mask);
Description
This interface shall change the default behavior for freeing allocated data, from
only freeing data allocated internally by libpng, to either freeing user-allocated
data or to not freeing any data at all.
This interface can enable deallocation of user data allocated with png_malloc()
or png_zalloc() and passed to libpng with one of the png_set_*() interfaces.
Users can call it both before and after passing the data. Calling it after reading
PNG data but before passing the data controls whether the user or the interface
is responsible for the existing data. Calling it after passing the data controls
whether the user or the interface should deallocate the data.
If the user becomes responsible for data allocated by libpng, png_free() must be
called to free it. If libpng becomes responsible for user-allocated data, the data
must only have been allocated with png_malloc() or png_zalloc().
The parameter png_ptr shall specify the PNG file.
The parameter info_ptr shall specify the PNG info structure.
The parameter freer shall specify one of these constants:
PNG_DESTROY_WILL_FREE_DATA, PNG_SET_WILL_FREE_DATA,
PNG_USER_WILL_FREE_DATA.
The parameter mask shall specify the data to free, as described under
png_free_data().
Application Usage (informative)
A row_pointers array allocated in a single block must not be freed with
png_set_rows() or png_read_destroy(), because they would attempt to free
the elements of the array as well.
Do not free text_ptr with libpng if some of its members were allocated
separately, because this will actually only free text_ptr.key. If responsibility for
freeing text_ptr moves from libpng to the user, the user must not free the
members separately.
20 © 2021 ISO/IEC – All rights reserved

png_destroy_info_struct
Name
png_destroy_info_struct — free memory in PNG info structure
Synopsis
#include
void png_destroy_info_struct(png_structp png_ptr, png_infopp
info_ptr_ptr);
Description
This interface shall free any memory in a single PNG info structure.
The parameter png_ptr shall specify the PNG file.
The parameter info_ptr_ptr shall point to a pointer to the png_info_struct to
destroy.
png_destroy_read_struct
Name
png_destroy_read_struct — free the memory associated with read
png_struct
Synopsis
#include
void png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp
info_ptr_ptr, png_infopp end_info_ptr_ptr);
Description
png_destroy_read_struct() frees the memory associated with the read png_struct
struct that holds information from the given PNG file, the associated png_info
struct for holding the image information and png_info struct for holding the
information at end of the given PNG file.
png_destroy_write_struct
Name
png_destroy_write_struct — free the memory associated with write
png_struct
Synopsis
#include
void png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp
info_ptr_ptr);
Description
png_destroy_write_struct() frees the memory associated with the write
png_struct struct that holds information for writing the PNG file and the
associated png_info struct for holding the image information.
© 2021 ISO/IEC – All rights reserved 21

png_error
Name
png_error — default function to handle fatal errors
Synopsis
#include
void png_error(png_structp png_ptr, png_const_charp error_message);
Description
png_error() is the default error handling function for fatal errors. The default
error handling functionality may be changed by using png_set_error_fn() to
replace the error function at run-time.
Return Value
Errors
png_free
Name
png_free — free a pointer allocated by png_malloc()
Synopsis
#include
void png_free(png_structp png_ptr, png_voidp ptr);
Description
png_free() shall free memory pointed to by "ptr" previously allocated by
png_malloc().
22 © 2021 ISO/IEC – All rights reserved

png_free_data
Name
png_free_data — free internally allocated data
Synopsis
#include
void png_free_data(png_structp png_ptr, png_infop info_ptr,
png_uint_32 free_me, int num);
Description
This interface shall free data that was internally allocated by libpng.
The parameter png_ptr shall specify the PNG file.
The parameter info_ptr shall specify the PNG info structure containing
members to free that are pointing to memory allocated by libpng.
The parameter mask shall specify the data to free with a mask consisting of the
logical OR of at least one of the following constants: PNG_FREE_HIST,
PNG_FREE_ICCP, PNG_FREE_PCAL, PNG_FREE_PLTE, PNG_FREE_ROWS,
PNG_FREE_SCAL, PNG_FREE_SPLT, PNG_FREE_TEXT, PNG_FREE_TRNS,
PNG_FREE_UNKN. (To specify all constants, use PNG_FREE_ALL.)
The parameter num shall specify the sequence number of the item to free. The
value -1 specifies all items.
© 2021 ISO/IEC – All rights reserved 23

png_get_IHDR
Name
png_get_IHDR — get PNG_IHDR chunk information from png_info structure
Synopsis
#include
png_uint_32 png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
png_uint_32 * width, png_uint_32 * height, int * bit_depth, int *
color_type, int * interlace_method, int * compression_method, int *
filter_method);
Description
png_get_IHDR() gets PNG_IHDR chunk type information from png_info
structure.
width
holds the width of the image in pixels up to 2^31.
height
holds the height of the image in pixels up to 2^31.
bit_depth
holds the bit depth of one of the image channels. Valid values are 1, 2, 4, 8,
16 and also depend on the color_type.
color_type
describes which color/alpha channels are present. Supported color types
shall include:
PNG_COLOR_TYPE_GRAY (bit depths 1, 2, 4, 8, 16)
PNG_COLOR_TYPE_GRAY_ALPHA (bit depths 8, 16)
PNG_COLOR_TYPE_PALETTE (bit depths 1, 2, 4, 8)
PNG_COLOR_TYPE_RGB (bit_depths 8, 16)
PNG_COLOR_TYPE_RGB_ALPHA (bit_depths 8, 16)
PNG_COLOR_MASK_PALETTE
PNG_COLOR_MASK_COLOR
PNG_COLOR_MASK_ALPHA
filter_method
holds the filter method. If this argument is NULL, the filter method will not
be retrieved. Valid values after retrieval are
PNG_FILTER_TYPE_BASE
PNG_INTRAPIXEL_DIFFERENCING
compression_method
holds the compression method. If this argument is NULL, the compression
method will not be retrieved. Valid values after retrieval are
PNG_COMPRESSION_TYPE_BASE
interlace_method
holds the interlace method. If this argument is NULL, the interlacing method
will not be retrieved. Valid values after retrieval are
24 © 2021 ISO/IEC – All rights reserved

PNG_INTERLACE_NONE
PNG_INTERLACE_ADAM7
Return Value
On success, png_get_HDR() shall return 1. Otherwise, png_get_IHDR() shall
return 0.
png_get_PLTE
Name
png_get_PLTE — get image palette information from png_info structure
Synopsis
#include
png_uint_32 png_get_PLTE(png_structp png_ptr, png_infop info_ptr,
png_colorp * palette, int * num_palette);
Description
png_get_PLTE() gets palette information from png_info structure. "palette" holds
an array of color values with "num_palette" entries.
Return Value
On successful retrieval of palette information, png_get_PLTE() shall return
PNG_INFO_PLTE. Otherwise, png_get_PLTE() shall return 0.
png_get_bKGD
Name
png_get_bKGD — get background color for given image
Synopsis
#include
png_uint_32 png_get_bKGD(png_structp png_ptr, png_infop info_ptr,
png_color_16p * background);
Description
png_get_bKGD() shall return the background color to "background" if the
validity flag for background is set.
Return Value
On success, png_get_bKGD() shall return PNG_INFO_bKGD. Otherwise,
png_get_bKGD() shall return 0.
© 2021 ISO/IEC – All rights reserved 25

png_get_bit_depth
Name
png_get_bit_depth — return image bit_depth
Synopsis
#include
png_byte png_get_bit_depth(png_structp png_ptr, png_infop info_ptr);
Description
Returns the image bit_depth.
Return Value
Returns 0 if png_ptr or info_ptr is NULL, bit_depth otherwise.
png_get_cHRM
Name
png_get_cHRM — get CIE chromacities and referenced white point for given
image
Synopsis
#include
png_uint_32 png_get_cHRM(png_structp png_ptr, png_infop info_ptr,
double * white_x, double * white_y, double * red_x, double * red_y,
double * green_x, double * green_y, double * blue_x, double * blue_y);
Description
png_get_cHRM() shall return the CIE x,y chromaticities of the red, green and blue
display primaries used in the image and the referenced white point from the
cHRM chunk in the image.
Return Value
On success, png_get_cHRM() shall return PNG_INFO_cHRM. Otherwise, the
function shall return 0.
png_get_channels
Name
png_get_channels — get number of color channels in image
Synopsis
#include
png_byte png_get_channels(png_structp png_ptr, png_infop info_ptr);
Description
png_get_channels() shall return the number of data channels per pixel for the
color type of the image. The number of channels shall range from 1-4 depending
on the color type as given below.
26 © 2021 ISO/IEC – All rights reserved

1 - PNG_COLOR_TYPE_GRAY or PNG_COLOR_TYPE_PALETTE
2 - PNG_COLOR_TYPE_GRAY_ALPHA
3 - PNG_COLOR_TYPE_RGB
4 - PNG_COLOR_TYPE_RGB_ALPHA or PNG_COLOR_TYPE_RGB+filler
byte
Return Value
On success, png_get_channels() shall return the number of channels ranging from
1-4. Otherwise, png_get_channels shall return 0.
png_get_color_type
Name
png_get_color_type — return image color type
Synopsis
#include
png_byte png_get_color_type(png_structp png_ptr, png_infop info_ptr);
Description
Returns the image color type.
Return Value
Returns 0 if png_ptr or info_ptr is NULL, color_type otherwise.
png_get_error_ptr
Name
png_get_error_ptr — return error_ptr for user-defined functions
Synopsis
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.

Loading comments...