app: remove combine_mask_and_region() and its helper functions
This commit is contained in:
@ -142,77 +142,6 @@ apply_mask_to_alpha_channel (guchar *src,
|
||||
}
|
||||
|
||||
|
||||
inline void
|
||||
combine_mask_and_alpha_channel_stipple (guchar *src,
|
||||
const guchar *mask,
|
||||
guint opacity,
|
||||
guint length,
|
||||
guint bytes)
|
||||
{
|
||||
/* align with alpha channel */
|
||||
src += bytes - 1;
|
||||
|
||||
if (opacity != 255)
|
||||
while (length --)
|
||||
{
|
||||
gint tmp;
|
||||
gint mask_val = INT_MULT(*mask, opacity, tmp);
|
||||
|
||||
*src = *src + INT_MULT((255 - *src) , mask_val, tmp);
|
||||
|
||||
src += bytes;
|
||||
mask++;
|
||||
}
|
||||
else
|
||||
while (length --)
|
||||
{
|
||||
gint tmp;
|
||||
|
||||
*src = *src + INT_MULT((255 - *src) , *mask, tmp);
|
||||
|
||||
src += bytes;
|
||||
mask++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline void
|
||||
combine_mask_and_alpha_channel_stroke (guchar *src,
|
||||
const guchar *mask,
|
||||
guint opacity,
|
||||
guint length,
|
||||
guint bytes)
|
||||
{
|
||||
/* align with alpha channel */
|
||||
src += bytes - 1;
|
||||
|
||||
if (opacity != 255)
|
||||
while (length --)
|
||||
{
|
||||
if (opacity > *src)
|
||||
{
|
||||
gint tmp;
|
||||
gint mask_val = INT_MULT (*mask, opacity, tmp);
|
||||
|
||||
*src = *src + INT_MULT ((opacity - *src) , mask_val, tmp);
|
||||
}
|
||||
|
||||
src += bytes;
|
||||
mask++;
|
||||
}
|
||||
else
|
||||
while (length --)
|
||||
{
|
||||
gint tmp;
|
||||
|
||||
*src = *src + INT_MULT ((255 - *src) , *mask, tmp);
|
||||
|
||||
src += bytes;
|
||||
mask++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline void
|
||||
copy_gray_to_inten_a_pixels (const guchar *src,
|
||||
guchar *dest,
|
||||
|
@ -2013,62 +2013,6 @@ apply_mask_to_region (PixelRegion *src,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
combine_mask_and_sub_region_stipple (gint *opacityp,
|
||||
PixelRegion *src,
|
||||
PixelRegion *mask)
|
||||
{
|
||||
guchar *s = src->data;
|
||||
const guchar *m = mask->data;
|
||||
gint h = src->h;
|
||||
guint opacity = *opacityp;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
combine_mask_and_alpha_channel_stipple (s, m, opacity,
|
||||
src->w, src->bytes);
|
||||
s += src->rowstride;
|
||||
m += mask->rowstride;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
combine_mask_and_sub_region_stroke (gint *opacityp,
|
||||
PixelRegion *src,
|
||||
PixelRegion *mask)
|
||||
{
|
||||
guchar *s = src->data;
|
||||
const guchar *m = mask->data;
|
||||
gint h = src->h;
|
||||
guint opacity = *opacityp;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
combine_mask_and_alpha_channel_stroke (s, m, opacity, src->w, src->bytes);
|
||||
s += src->rowstride;
|
||||
m += mask->rowstride;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
combine_mask_and_region (PixelRegion *src,
|
||||
PixelRegion *mask,
|
||||
guint opacity,
|
||||
gboolean stipple)
|
||||
{
|
||||
if (stipple)
|
||||
pixel_regions_process_parallel ((PixelProcessorFunc)
|
||||
combine_mask_and_sub_region_stipple,
|
||||
&opacity, 2, src, mask);
|
||||
else
|
||||
pixel_regions_process_parallel ((PixelProcessorFunc)
|
||||
combine_mask_and_sub_region_stroke,
|
||||
&opacity, 2, src, mask);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
copy_gray_to_region (PixelRegion *src,
|
||||
PixelRegion *dest)
|
||||
|
@ -26,19 +26,6 @@ void apply_mask_to_alpha_channel (guchar *src,
|
||||
guint length,
|
||||
guint bytes);
|
||||
|
||||
/* combine the mask data with the alpha channel of the pixel data */
|
||||
void combine_mask_and_alpha_channel_stipple (guchar *src,
|
||||
const guchar *mask,
|
||||
guint opacity,
|
||||
guint length,
|
||||
guint bytes);
|
||||
|
||||
void combine_mask_and_alpha_channel_stroke (guchar *src,
|
||||
const guchar *mask,
|
||||
guint opacity,
|
||||
guint length,
|
||||
guint bytes);
|
||||
|
||||
/* copy gray pixels to intensity-alpha pixels. This function
|
||||
* essentially takes a source that is only a grayscale image and
|
||||
* copies it to the destination, expanding to RGB if necessary and
|
||||
@ -252,12 +239,6 @@ void apply_mask_to_region (PixelRegion *src,
|
||||
PixelRegion *mask,
|
||||
guint opacity);
|
||||
|
||||
/* Combine a mask with an image's alpha channel */
|
||||
void combine_mask_and_region (PixelRegion *src,
|
||||
PixelRegion *mask,
|
||||
guint opacity,
|
||||
gboolean stipple);
|
||||
|
||||
/* Copy a gray image to an intensity-alpha region */
|
||||
void copy_gray_to_region (PixelRegion *src,
|
||||
PixelRegion *dest);
|
||||
|
Reference in New Issue
Block a user