File: add-missing-api.patch

package info (click to toggle)
lodepng 0.0~git20250402.c45ed79-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,292 kB
  • sloc: cpp: 12,644; ansic: 161; makefile: 51
file content (28 lines) | stat: -rw-r--r-- 1,422 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Description: add missing API lodepng_convert_rgb in header
 In <URL: https://github.com/lvandeve/lodepng/pull/170 > there
 is an alternative propsal to make the method static.
Author: Shengqi Chen <harry-chen@outlook.com>
Forwarded: no
Last-Update: 2024-09-12 
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/lodepng.h
+++ b/lodepng.h
@@ -807,6 +807,17 @@
                          const LodePNGColorMode* mode_out, const LodePNGColorMode* mode_in,
                          unsigned w, unsigned h);
 
+/* Converts a single rgb color without alpha from one type to another, color bits truncated to
+their bitdepth. In case of single channel (gray or palette), only the r channel is used. Slow
+function, do not use to process all pixels of an image. Alpha channel not supported on purpose:
+this is for bKGD, supporting alpha may prevent it from finding a color in the palette, from the
+specification it looks like bKGD should ignore the alpha values of the palette since it can use
+any palette index but doesn't have an alpha channel. Idem with ignoring color key. */
+unsigned lodepng_convert_rgb(
+    unsigned* r_out, unsigned* g_out, unsigned* b_out,
+    unsigned r_in, unsigned g_in, unsigned b_in,
+    const LodePNGColorMode* mode_out, const LodePNGColorMode* mode_in);
+
 #ifdef LODEPNG_COMPILE_DECODER
 /*
 Settings for the decoder. This contains settings for the PNG and the Zlib