Lines Matching +full:- +full:c

4 Copyright (c) 2005-2023 Lode Vandevenne
6 This software is provided 'as-is', without any express or implied
30 extern "C" {
43 -DLODEPNG_NO_COMPILE_ZLIB for gcc or clang.
48 …/*pass -DLODEPNG_NO_COMPILE_ZLIB to the compiler to disable this, or comment out LODEPNG_COMPILE_Z…
54 …/*pass -DLODEPNG_NO_COMPILE_PNG to the compiler to disable this, or comment out LODEPNG_COMPILE_PN…
60 …/*pass -DLODEPNG_NO_COMPILE_DECODER to the compiler to disable this, or comment out LODEPNG_COMPIL…
66 …/*pass -DLODEPNG_NO_COMPILE_ENCODER to the compiler to disable this, or comment out LODEPNG_COMPIL…
72 …/*pass -DLODEPNG_NO_COMPILE_DISK to the compiler to disable this, or comment out LODEPNG_COMPILE_D…
78 /*pass -DLODEPNG_NO_COMPILE_ANCILLARY_CHUNKS to the compiler to disable this,
85 /*pass -DLODEPNG_NO_COMPILE_ERROR_TEXT to the compiler to disable this,
90 /*Compile the default allocators (C's free, malloc and realloc). If you disable this,
94 /*pass -DLODEPNG_NO_COMPILE_ALLOCATORS to the compiler to disable the built-in ones,
99 /*Disable built-in CRC function, in that case a custom implementation of
101 The default built-in CRC code comes with 8KB of lookup tables, so for memory constrained environmen…
103 in a comment in the lodepng.c(pp) file in the 'else' case of the searchable LODEPNG_COMPILE_CRC sec…
105 /*pass -DLODEPNG_NO_COMPILE_CRC to the compiler to disable the built-in one,
110 /*compile the C++ version (you can disable the C++ wrapper here even when compiling for C++)*/
113 … /*pass -DLODEPNG_NO_COMPILE_CPP to the compiler to disable C++ (not needed if a C-only compiler),
147 Note: for 16-bit per channel colors, uses big endian format like PNG does.
160 /*Same as lodepng_decode_memory, but always decodes to 32-bit RGBA raw image*/
164 /*Same as lodepng_decode_memory, but always decodes to 24-bit RGB raw image*/
173 NOTE: Wide-character filenames are not supported, you can use an external method
174 to handle such files and decode in-memory.*/
179 /*Same as lodepng_decode_file, but always decodes to 32-bit RGBA raw image.
181 NOTE: Wide-character filenames are not supported, you can use an external method
182 to handle such files and decode in-memory.*/
186 /*Same as lodepng_decode_file, but always decodes to 24-bit RGB raw image.
188 NOTE: Wide-character filenames are not supported, you can use an external method
189 to handle such files and decode in-memory.*/
201 Note: for 16-bit per channel colors, needs big endian format like PNG does.
217 /*Same as lodepng_encode_memory, but always encodes from 32-bit RGBA raw image.*/
221 /*Same as lodepng_encode_memory, but always encodes from 24-bit RGB raw image.*/
232 NOTE: Wide-character filenames are not supported, you can use an external method
233 to handle such files and encode in-memory.*/
238 /*Same as lodepng_encode_file, but always encodes from 32-bit RGBA raw image.
240 NOTE: Wide-character filenames are not supported, you can use an external method
241 to handle such files and encode in-memory.*/
245 /*Same as lodepng_encode_file, but always encodes from 24-bit RGB raw image.
247 NOTE: Wide-character filenames are not supported, you can use an external method
248 to handle such files and encode in-memory.*/
260 is the format to output the pixels to. Default is RGBA 8-bit per channel.*/
272 NOTE: Wide-character filenames are not supported, you can use an external method
273 to handle such files and decode in-memory.
292 Converts 32-bit RGBA raw pixel data into a PNG file on disk.
297 NOTE: Wide-character filenames are not supported, you can use an external method
298 to handle such files and decode in-memory.
333 Should return 0 if success, any non-0 if error (numeric value not exposed).*/
339 Should return 0 if success, any non-0 if error (numeric value not exposed).*/
418 …s color uses the same bit depth as the bitdepth value in this struct, which can be 1-bit to 16-bit.
460 Check if the given color info indicates the possibility of having non-opaque pixels in the PNG imag…
463 In detail, it returns true only if it's a color type with alpha, or has a palette with non-opaque v…
473 unsigned year; /*2 bytes used (0-65535)*/
474 unsigned month; /*1-12*/
475 unsigned day; /*1-31*/
476 unsigned hour; /*0-23*/
477 unsigned minute; /*0-59*/
478 unsigned second; /*0-60 (to allow for leap seconds)*/
509 When encoding, avoid setting this to an expensive color, such as a non-gray value
522 Non-international text chunks (tEXt and zTXt)
539 Standard text chunk keywords and strings are encoded using Latin-1.
547 Similar to the non-international text chunks, but with additional strings
549 keys: Latin-1, langtags: ASCII, transkeys and strings: UTF-8.
550 keys must be 1-79 characters (plus the additional null terminator), the other
556 char ** itext_transkeys; /*keyword translated to the international language - UTF-8 string*/
557 char ** itext_strings; /*the actual international text - UTF-8 string*/
613 … encoding, the ICC profile is required by the PNG specification to be an "RGB" profile for non-gray
617 …error if the pixel data has non-gray pixels for a GRAY profile, or a silent less-optimal compressi…
624 char * iccp_name; /* Null terminated string with profile name, 1-79 bytes */
636 …d, these values give the bit depth of the original data. Since PNG only stores 1, 2, 4, 8 or 16-bit
644 Decoders using this value, if able to work with data that's e.g. 10-bit or 12-bit, should right
646 sbit and work e.g. with the 8-bit or 16-bit data from the PNG directly, since thanks
663 …For example, setting these fields to 10-bit will force the encoder to keep using a 16-bit per chan…
664 color mode, even if the pixel data would in fact fit in a more efficient 8-bit mode.
687 or any non-standard PNG chunk.
724 For 16-bit per channel colors, uses big endian format like PNG does.
787 Brute-force-search PNG filters by compressing each filter for each scanline.
801 …unsigned short key_r; /*key values, always as 16-bit, in 8-bit case the byte is duplicated, e.g. 6…
808 …unsigned bits; /*bits per channel (not for palette). 1,2 or 4 for grayscale only. 16 if 16-bit per…
907 chunk_pointer - start_of_file as pos).
909 Ignores unsupported, unknown, non-metadata or IHDR chunks (without error).
933 -4 bytes length: length of the data of the chunk in bytes (chunk itself is 12 bytes longer)
934 -4 bytes chunk type (ASCII a-z,A-Z only, see below)
935 -length bytes of data (may be 0 bytes if length was 0)
936 -4 bytes of CRC, computed on chunk name + data
942 -First byte: uppercase = critical, lowercase = ancillary
943 -Second byte: uppercase = public, lowercase = private
944 -Third byte: must be uppercase
945 -Fourth byte: uppercase = unsafe to copy, lowercase = safe to copy
955 /*puts the 4-byte type in null terminated string*/
989 In a non-corrupt PNG file, the last chunk should have name "IEND".
1008 and data separately. The type is a 4-letter string.
1058 Find length-limited Huffman code for given frequencies. This function is in the
1081 NOTE: Wide-character filenames are not supported, you can use an external method
1082 to handle such files and decode in-memory.
1094 NOTE: Wide-character filenames are not supported, you can use an external method
1095 to handle such files and encode in-memory
1101 /* The LodePNG C++ wrapper uses std::vectors instead of manually allocated memory buffers. */
1139 NOTE: Wide-character filenames are not supported, you can use an external method
1140 to handle such files and decode in-memory
1148 NOTE: Wide-character filenames are not supported, you can use an external method
1149 to handle such files and encode in-memory
1157 /* Zlib-decompress an unsigned char buffer */
1161 /* Zlib-decompress an std::vector */
1167 /* Zlib-compress an unsigned char buffer */
1171 /* Zlib-compress an std::vector */
1181 [.] test if there are no memory leaks or security exploits - done a lot but needs to be checked oft…
1182 [.] check compatibility with various compilers - done but needs to be redone for every newer versi…
1183 [X] converting color to 16-bit per channel types
1186 [ ] make sure encoder generates no chunks with size > (2^31)-1
1195 [ ] let the C++ wrapper catch exceptions coming from the standard library and return LodePNG error …
1198 [X] provide alternatives for C library functions not present on some platforms (memcpy, ...)
1204 } /* extern "C" */
1211 ---------------------
1214 --------------------
1219 2. C and C++ version
1227 6.4. A note about 16-bits per channel and endianness
1232 10.1. decoder C++ example
1233 10.2. decoder C example
1240 --------
1246 Specification (Second Edition) - W3C Recommendation 10 November 2003.
1251 http://www.w3.org/TR/2003/REC-PNG-20031110
1253 http://www.gzip.org/zlib/rfc-zlib.html
1255 http://www.gzip.org/zlib/rfc-deflate.html
1260 LodePNG works both in C (ISO C90) and C++, with a C++ wrapper that adds
1264 -lodepng.h: the header file for both C and C++
1265 -lodepng.c(pp): give it the name lodepng.c or lodepng.cpp (or .cc) depending on your usage
1283 begin), life-critical systems, ...
1286 -----------------------
1290 *) decoding of PNGs with any color type, bit depth and interlace mode, to a 24- or 32-bit color raw…
1292 *) encoding of PNGs, from any raw image to 24- or 32-bit color, or the same color type as the raw i…
1321 ---------------------------
1325 *) some features needed to make a conformant PNG-Editor might be still missing.
1330 2. C and C++ version
1331 --------------------
1333 The C version uses buffers allocated with alloc that you need to free()
1335 using a struct from the C version to avoid exploits and memory leaks.
1337 The C++ version has extra functions with std::vectors in the interface and the
1340 These files work without modification for both C and C++ compilers because all
1341 the additional C++ code is in "#ifdef __cplusplus" blocks that make C-compilers
1342 ignore it, and the C code is made to compile both with strict ISO C90 and C++.
1344 To use the C++ version, you need to rename the source file to lodepng.cpp
1345 (instead of lodepng.c), and compile it with a C++ compiler.
1347 To use the C version, you need to rename the source file to lodepng.c (instead
1348 of lodepng.cpp), and compile it with a C compiler.
1352 -----------
1357 When using LodePNG, care has to be taken with the C version of LodePNG, as well
1358 as the C-style structs when working with C++. The following conventions are used
1359 for all C-style structs:
1361 -if a struct has a corresponding init function, always call the init function when making a new one
1362 -if a struct has a corresponding cleanup function, call it before the struct disappears to avoid me…
1363 -if a struct has a corresponding copy function, use the copy function instead of "=".
1368 -----------
1373 above. For C, simple decoding can be done with functions such as
1375 LodePNGState and lodepng_decode. For C++, all decoding can be done with the
1385 --------------------
1396 -------------------------
1404 By default, 32-bit color is used for the result.
1407 ------------------------------
1419 -----------
1424 above. For C, simple encoding can be done with functions such as
1426 LodePNGState and lodepng_encode. For C++, all encoding can be done with the
1440 --------------------
1458 -------------------------
1464 By default, 32-bit color is assumed, meaning your input has to be in RGBA
1468 ------------------------------
1470 The following settings are supported (some are in sub-structs):
1479 *) windowsize: the window size used by the LZ77 encoder (1 - 32768). Has value
1492 --------------------
1512 By default, when decoding, you get the raw image in 32-bit RGBA or 24-bit RGB
1515 the input image to be 32-bit RGBA or 24-bit RGB. So, unless you want to control
1519 --------------------
1521 A PNG image can have many color types, ranging from 1-bit color to 64-bit color,
1539 ----------------------
1565 -the decoder converts from PNG to raw image
1566 -the encoder converts from raw image to PNG
1567 -the colortype and bitdepth in LodePNGColorMode info_raw, are those of the raw image
1568 -the colortype and bitdepth in the color field of LodePNGInfo info_png, are those of the PNG
1569 -when encoding, the color type in LodePNGInfo is ignored if auto_convert
1571 -when decoding, the color type in LodePNGInfo is set by the decoder to that of the original
1573 -if the color type of the LodePNGColorMode and PNG image aren't the same, a conversion
1576 -even though some conversions aren't supported, LodePNG supports loading PNGs from any
1579 -both encoder and decoder use the same color converter.
1586 -color to grayscale when non-gray pixels are present: no error is thrown, but
1589 no error is given is to allow converting from three-channel grayscale images to
1590 one-channel even if there are numerical imprecisions.
1591 -anything to palette when the palette does not have an exact match for a from-color
1595 -anything to 8-bit RGB, 8-bit RGBA, 16-bit RGB, 16-bit RGBA
1596 -any gray or gray+alpha, to gray or gray+alpha
1597 -anything to a palette, as long as the palette has the requested colors in it
1598 -removing alpha channel
1599 -higher to smaller bitdepth, and vice versa
1602 -In the encoder, you can make it save a PNG with any color type by giving the
1605 -In the decoder, you can make it store the pixel data in the same color type
1610 -----------------
1612 In the PNG file format, if a less than 8-bit per pixel color type is used and the scanlines
1616 will NOT have these padding bits, e.g. in the case of a 1-bit image with a width
1620 6.4. A note about 16-bits per channel and endianness
1621 ----------------------------------------------------
1623 LodePNG uses unsigned char arrays for 16-bit per channel colors too, just like
1624 for any other color format. The 16-bit values are stored in big endian (most
1630 LodePNG on purpose, there are myriads of formats, including endianness of 16-bit
1636 always needed, many applications and libraries support big endian 16-bit colors
1642 ---------------
1645 OK, or a non-zero code if there was an error.
1656 only 0 or non-0 matter.
1660 -------------------------
1675 -----------------------------
1729 function creates a new chunk with the given parameters and appends it. Type is the 4-letter
1733 -----------------------
1765 -------------------
1767 No libraries other than the current standard C library are needed to compile
1768 LodePNG. For the C++ version, only the standard C++ library is needed on top.
1769 Add the files lodepng.c(pp) and lodepng.h to your project, include
1772 It is compatible with C90 and up, and C++03 and up.
1779 std::vectors and std::strings in C++ can be incompatible.
1786 warnings with compiler options "-Wall -Wextra -pedantic -ansi", with gcc and g++
1787 version 4.7.1 on Linux, 32-bit and 64-bit.
1791 Fully supported and warning-free.
1798 *) Visual Studio and Visual C++ Express Edition
1800 LodePNG should be warning-free with warning level W4. Two warnings were disabled
1802 where it wants to use a non-standard function fopen_s instead of the standard C
1807 This is not standard C++ and will not be added to the stock LodePNG. You can
1808 disable it for lodepng.cpp only by right clicking it, Properties, C/C++,
1817 C and C++.
1826 ------------
1831 NOTE: these examples do not support wide-character filenames, you can use an
1832 external method to handle such files and encode or decode in-memory
1834 10.1. decoder C++ example
1835 -------------------------
1854 10.2. decoder C example
1855 -----------------------
1876 ----------------------------
1920 -----------
1935 wide-character filenames (support for this is not planned, opening files is
1943 if gray ICC profile) and non-ICC LodePNGColorProfile renamed to
1960 *) 18 apr 2015: Boundary PM instead of just package-merge for faster encoding.
1984 redundant C++ codec classes. Reduced amount of structs. Everything changed,
1996 *) 17 aug 2011: (!) changed some C zlib related function names.
1998 *) 17 apr 2011: code cleanup. Bugfixes. Convert low to 16-bit per sample colors.
2006 *) 26 okt 2010: (!) changed some C function and struct names (more consistent).
2022 *) 13 jan 2008: Added ability to encode Adam7-interlaced images. Improved
2024 *) 07 jan 2008: (!) changed LodePNG to use ISO C90 instead of C++. A
2025 C++ wrapper around this provides an interface almost identical to before.
2026 Having LodePNG be pure ISO C90 makes it more portable. The C and C++ code
2027 are together in these files but it works both for C and C++ compilers.
2029 *) 30 aug 2007: bug fixed which makes this Borland C++ compatible
2032 *) 08 jun 2007: fixed bug with 2- and 4-bit color, and small interlaced images
2049 *) 27 jan 2007: Made the Adler-32 test faster so that a timewaste is gone.
2051 greyscale type to 8-bit greyscale with or without alpha.
2064 Fixed a bug of the decoder with 16-bit per color.
2089 *) 12 aug 2005: Initial release (C++, decoder only)
2093 -----------------------
2104 Copyright (c) 2005-2022 Lode Vandevenne