app: Use pixel_region_has_alpha()
For increased readability.
This commit is contained in:
parent
7a2208d1bd
commit
50acd95e9d
5 changed files with 10 additions and 7 deletions
|
|
@ -180,7 +180,7 @@ color_balance (ColorBalance *cb,
|
|||
h = srcPR->h;
|
||||
src = srcPR->data;
|
||||
dest = destPR->data;
|
||||
alpha = (srcPR->bytes == 4) ? TRUE : FALSE;
|
||||
alpha = pixel_region_has_alpha (srcPR);
|
||||
|
||||
while (h--)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ colorize (Colorize *colorize,
|
|||
h = srcPR->h;
|
||||
src = srcPR->data;
|
||||
dest = destPR->data;
|
||||
alpha = (srcPR->bytes == 4) ? TRUE : FALSE;
|
||||
alpha = pixel_region_has_alpha (srcPR);
|
||||
|
||||
while (h--)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,15 +51,18 @@ desaturate_region (GimpDesaturateMode *mode,
|
|||
switch (*mode)
|
||||
{
|
||||
case GIMP_DESATURATE_LIGHTNESS:
|
||||
desaturate_region_lightness (srcPR, destPR, srcPR->bytes == 4);
|
||||
desaturate_region_lightness (srcPR, destPR,
|
||||
pixel_region_has_alpha (srcPR));
|
||||
break;
|
||||
|
||||
case GIMP_DESATURATE_LUMINOSITY:
|
||||
desaturate_region_luminosity (srcPR, destPR, srcPR->bytes == 4);
|
||||
desaturate_region_luminosity (srcPR, destPR,
|
||||
pixel_region_has_alpha (srcPR));
|
||||
break;
|
||||
|
||||
case GIMP_DESATURATE_AVERAGE:
|
||||
desaturate_region_average (srcPR, destPR, srcPR->bytes == 4);
|
||||
desaturate_region_average (srcPR, destPR,
|
||||
pixel_region_has_alpha (srcPR));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ hue_saturation (HueSaturation *hs,
|
|||
h = srcPR->h;
|
||||
src = srcPR->data;
|
||||
dest = destPR->data;
|
||||
alpha = (srcPR->bytes == 4) ? TRUE : FALSE;
|
||||
alpha = pixel_region_has_alpha (srcPR);
|
||||
|
||||
while (h--)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ threshold (Threshold *tr,
|
|||
h = srcPR->h;
|
||||
src = srcPR->data;
|
||||
dest = destPR->data;
|
||||
has_alpha = (srcPR->bytes == 2 || srcPR->bytes == 4);
|
||||
has_alpha = pixel_region_has_alpha (srcPR);
|
||||
alpha = has_alpha ? srcPR->bytes - 1 : srcPR->bytes;
|
||||
|
||||
while (h--)
|
||||
|
|
|
|||
Loading…
Reference in a new issue