diff options
author | Lode <lvandeve@gmail.com> | 2019-12-08 18:39:57 +0300 |
---|---|---|
committer | Lode <lvandeve@gmail.com> | 2019-12-08 18:39:57 +0300 |
commit | 2e541f53ebedf6ebae375a381ca2fd6d82b460bc (patch) | |
tree | 14ca27af5563c514da960dd55d85c285e221592b /lodepng.cpp | |
parent | f78cffe5e149b84a1e390dbd46c6c1b008c7e76f (diff) |
make auto_choose_color static since it's only internal
Diffstat (limited to 'lodepng.cpp')
-rw-r--r-- | lodepng.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lodepng.cpp b/lodepng.cpp index 74c7fde..29f50c5 100644 --- a/lodepng.cpp +++ b/lodepng.cpp @@ -3829,9 +3829,16 @@ static void lodepng_color_stats_add(LodePNGColorStats* stats, } #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ -unsigned auto_choose_color(LodePNGColorMode* mode_out, - const LodePNGColorMode* mode_in, - const LodePNGColorStats* stats) { +/*Computes a minimal PNG color model that can contain all colors as indicated by the stats. +The stats should be computed with lodepng_compute_color_stats. +mode_in is raw color profile of the image the stats were computed on, to copy palette order from when relevant. +Minimal PNG color model means the color type and bit depth that gives smallest amount of bits in the output image, +e.g. gray if only grayscale pixels, palette if less than 256 colors, color key if only single transparent color, ... +This is used if auto_convert is enabled (it is by default). +*/ +static unsigned auto_choose_color(LodePNGColorMode* mode_out, + const LodePNGColorMode* mode_in, + const LodePNGColorStats* stats) { unsigned error = 0; unsigned palettebits; size_t i, n; |