vdr-1.6 merge transparent color
Commit Message
Hi,
this patch merge all color that are transparent (alpha = 0) in ClosestColor.
This allow to save precious color Index on ff cards.
Matthieu
Comments
On 21.11.2009 21:37, matthieu castet wrote:
> Hi,
>
> this patch merge all color that are transparent (alpha = 0) in
> ClosestColor.
> This allow to save precious color Index on ff cards.
Please provide the patch in a way that works with VDR 1.7.10.
Actually I doubt that this would even work with VDR 1.6.0,
because in cPalette::ClosestColor() 'diff' is only defined
a few lines below the place where your patch attempts to use it.
Have you actually been able to compile this?
Klaus
@@ -141,6 +141,8 @@
int B1 = (Color & 0x000000FF);
for (int i = 0; i < numColors; i++) {
int A2 = (color[i] & 0xFF000000) >> 24;
+ if (A2 == 0 && A1 == 0)
+ diff = 0;
int R2 = (color[i] & 0x00FF0000) >> 16;
int G2 = (color[i] & 0x0000FF00) >> 8;
int B2 = (color[i] & 0x000000FF);
@@ -149,6 +151,8 @@
d = diff;
n = i;
}
+ if (d == 0)
+ break;
}
return d <= MaxDiff ? n : -1;
}