/* Fetch functions */
-static force_inline uint32_t
+static uint32_t
bits_image_fetch_pixel_raw (bits_image_t *image, int x, int y)
{
uint32_t pixel[2];
return pixel;
}
+static force_inline uint32_t
+get_pixel (bits_image_t *image, int x, int y)
+{
+ return image->fetch_pixel_32 (image, x, y);
+}
+
static force_inline pixman_bool_t
repeat (pixman_repeat_t repeat, int size, int *coord)
{
if (repeat (image->common.repeat, image->width, &x0) &&
repeat (image->common.repeat, image->height, &y0))
{
- return bits_image_fetch_pixel_alpha (image, x0, y0);
+ return get_pixel (image, x0, y0);
}
else
{
tl = tr = bl = br = 0;
if (x1r && y1r)
- tl = bits_image_fetch_pixel_alpha (image, x1, y1);
+ tl = get_pixel (image, x1, y1);
if (x1r && y2r)
- bl = bits_image_fetch_pixel_alpha (image, x1, y2);
+ bl = get_pixel (image, x1, y2);
if (x2r && y1r)
- tr = bits_image_fetch_pixel_alpha (image, x2, y1);
+ tr = get_pixel (image, x2, y1);
if (x2r && y2r)
- br = bits_image_fetch_pixel_alpha (image, x2, y2);
+ br = get_pixel (image, x2, y2);
idistx = 256 - distx;
idisty = 256 - disty;
if (f)
{
uint32_t pixel =
- bits_image_fetch_pixel_alpha (image, rx, ry);
+ get_pixel (image, rx, ry);
srtot += RED_8 (pixel) * f;
sgtot += GREEN_8 (pixel) * f;
_pixman_bits_image_setup_raw_accessors (bits);
+ image->bits.fetch_pixel_raw_32 = bits_image_fetch_pixel_raw;
+ image->bits.fetch_pixel_32 = bits_image_fetch_pixel_raw;
+
if (bits->common.alpha_map)
{
image->common.get_scanline_64 =
_pixman_image_get_scanline_generic_64;
image->common.get_scanline_32 =
bits_image_fetch_transformed;
+
+ image->bits.fetch_pixel_32 = bits_image_fetch_pixel_alpha;
}
else if ((bits->common.repeat != PIXMAN_REPEAT_NONE) &&
bits->width == 1 &&
uint32_t * buffer,
int n_pixels);
+typedef uint32_t (*fetch_pixel_32_t) (bits_image_t *image,
+ int x,
+ int y);
+
typedef void (*store_scanline_t) (bits_image_t * image,
int x,
int y,
fetch_pixels_t fetch_pixels_raw_32;
fetch_pixels_t fetch_pixels_raw_64;
+ /* Fetch a pixel, disregarding alpha maps, transformations etc. */
+ fetch_pixel_32_t fetch_pixel_raw_32;
+
+ /* Fetch a pixel, taking alpha maps into account */
+ fetch_pixel_32_t fetch_pixel_32;
+
/* Fetch raw scanlines, with no regard for transformations, alpha maps etc. */
fetch_scanline_t fetch_scanline_raw_32;
fetch_scanline_t fetch_scanline_raw_64;