Release 0.13.2

This commit is contained in:
matze19999 committed 2026-10-12 18:19:11 +02:00
1 parent c3040680a0
commit 2f6efd9864
12 files changed
+25 -19

No files matched your search

+3 -3
View File
@@ -7,10 +7,10 @@ static inline void dark_color_filter(unsigned char color[3]) {
for (unsigned c = 1; c < 3; c++)
if (color[c] > peak)
peak = color[c];
if (peak >= 24)
if (peak >= 32)
return;
unsigned gain = peak > 12 ? peak - 12 : 0;
unsigned gain = peak > 16 ? peak - 16 : 0;
for (unsigned c = 0; c < 3; c++)
color[c] = (unsigned char)((color[c] * gain + 6) / 12);
color[c] = (unsigned char)((color[c] * gain + 8) / 16);
}
#endif
+8 -5
View File
@@ -5,17 +5,20 @@ int main(void) {
for (unsigned v = 0; v <= 255; v++) {
unsigned char gray[3] = {v, v, v};
dark_color_filter(gray);
unsigned expected = v <= 12 ? 0 : v >= 24 ? v : (v * (v - 12) + 6) / 12;
unsigned expected = v <= 16 ? 0 : v >= 32 ? v : (v * (v - 16) + 8) / 16;
for (unsigned c = 0; c < 3; c++) assert(gray[c] == expected);
}
unsigned char residual[3] = {4, 8, 2};
dark_color_filter(residual);
assert(!residual[0] && !residual[1] && !residual[2]);
unsigned char transition[3] = {9, 18, 6};
unsigned char measured[3] = {13, 14, 7};
dark_color_filter(measured);
assert(!measured[0] && !measured[1] && !measured[2]);
unsigned char transition[3] = {12, 24, 8};
dark_color_filter(transition);
assert(transition[0] == 5 && transition[1] == 9 && transition[2] == 3);
unsigned char saturated[3] = {0, 24, 0};
assert(transition[0] == 6 && transition[1] == 12 && transition[2] == 4);
unsigned char saturated[3] = {0, 32, 0};
dark_color_filter(saturated);
assert(saturated[0] == 0 && saturated[1] == 24 && saturated[2] == 0);
assert(saturated[0] == 0 && saturated[1] == 32 && saturated[2] == 0);
puts("PASS: near-black suppression, gradual transition, unchanged brighter colors");
}
+1 -1
View File
@@ -1,4 +1,4 @@
#ifndef HYPERDRM_VERSION_H
#define HYPERDRM_VERSION_H
#define HYPERDRM_VERSION "0.13.1"
#define HYPERDRM_VERSION "0.13.2"
#endif