#define FbGen(x,y,i,ax,ay,t,u,v) ((t) = (FbIntMult(FbGet8(y,i),ay,(u)) + \
FbIntMult(FbGet8(x,i),ax,(v))), \
- (uint32_t) ((uint8_t) ((t) | \
- (0 - ((t) >> 8)))) << (i))
-
+ (comp4_t) ((comp1_t) ((t) | \
+ (0 - ((t) >> G_SHIFT)))) << (i))
/*
The methods below use some tricks to be able to do two color
/*
x_c = (x_c * a) / 255
*/
-#define FbByteMul(x, a) do { \
- uint32_t t = ((x & 0xff00ff) * a) + 0x800080; \
- t = (t + ((t >> 8) & 0xff00ff)) >> 8; \
- t &= 0xff00ff; \
- \
- x = (((x >> 8) & 0xff00ff) * a) + 0x800080; \
- x = (x + ((x >> 8) & 0xff00ff)); \
- x &= 0xff00ff00; \
- x += t; \
+#define FbByteMul(x, a) do { \
+ comp4_t t = ((x & RB_MASK) * a) + RB_ONE_HALF; \
+ t = (t + ((t >> COMPONENT_SIZE) & RB_MASK)) >> COMPONENT_SIZE; \
+ t &= RB_MASK; \
+ \
+ x = (((x >> COMPONENT_SIZE) & RB_MASK) * a) + RB_ONE_HALF; \
+ x = (x + ((x >> COMPONENT_SIZE) & RB_MASK)); \
+ x &= RB_MASK << COMPONENT_SIZE; \
+ x += t; \
} while (0)
/*
x_c = (x_c * a) / 255 + y
*/
-#define FbByteMulAdd(x, a, y) do { \
- uint32_t t = ((x & 0xff00ff) * a) + 0x800080; \
- t = (t + ((t >> 8) & 0xff00ff)) >> 8; \
- t &= 0xff00ff; \
- t += y & 0xff00ff; \
- t |= 0x1000100 - ((t >> 8) & 0xff00ff); \
- t &= 0xff00ff; \
- \
- x = (((x >> 8) & 0xff00ff) * a) + 0x800080; \
- x = (x + ((x >> 8) & 0xff00ff)) >> 8; \
- x &= 0xff00ff; \
- x += (y >> 8) & 0xff00ff; \
- x |= 0x1000100 - ((x >> 8) & 0xff00ff); \
- x &= 0xff00ff; \
- x <<= 8; \
- x += t; \
+#define FbByteMulAdd(x, a, y) do { \
+ comp4_t t = ((x & RB_MASK) * a) + RB_ONE_HALF; \
+ t = (t + ((t >> COMPONENT_SIZE) & RB_MASK)) >> COMPONENT_SIZE; \
+ t &= RB_MASK; \
+ t += y & RB_MASK; \
+ t |= RB_MASK_PLUS_ONE - ((t >> COMPONENT_SIZE) & RB_MASK); \
+ t &= RB_MASK; \
+ \
+ x = (((x >> COMPONENT_SIZE) & RB_MASK) * a) + RB_ONE_HALF; \
+ x = (x + ((x >> COMPONENT_SIZE) & RB_MASK)) >> COMPONENT_SIZE; \
+ x &= RB_MASK; \
+ x += (y >> COMPONENT_SIZE) & RB_MASK; \
+ x |= RB_MASK_PLUS_ONE - ((x >> COMPONENT_SIZE) & RB_MASK); \
+ x &= RB_MASK; \
+ x <<= COMPONENT_SIZE; \
+ x += t; \
} while (0)
/*
x_c = (x_c * a + y_c * b) / 255
*/
#define FbByteAddMul(x, a, y, b) do { \
- uint32_t t; \
- uint32_t r = (x >> 24) * a + (y >> 24) * b + 0x80; \
- r += (r >> 8); \
- r >>= 8; \
- \
- t = (x & 0xff00) * a + (y & 0xff00) * b; \
- t += (t >> 8) + 0x8000; \
- t >>= 16; \
- \
- t |= r << 16; \
- t |= 0x1000100 - ((t >> 8) & 0xff00ff); \
- t &= 0xff00ff; \
- t <<= 8; \
- \
- r = ((x >> 16) & 0xff) * a + ((y >> 16) & 0xff) * b + 0x80; \
- r += (r >> 8); \
- r >>= 8; \
- \
- x = (x & 0xff) * a + (y & 0xff) * b + 0x80; \
- x += (x >> 8); \
- x >>= 8; \
- x |= r << 16; \
- x |= 0x1000100 - ((x >> 8) & 0xff00ff); \
- x &= 0xff00ff; \
+ comp4_t t; \
+ comp4_t r = (x >> A_SHIFT) * a + (y >> A_SHIFT) * b + ONE_HALF; \
+ r += (r >> G_SHIFT); \
+ r >>= G_SHIFT; \
+ \
+ t = (x & G_MASK) * a + (y & G_MASK) * b; \
+ t += (t >> G_SHIFT) + (ONE_HALF << G_SHIFT); \
+ t >>= B_SHIFT; \
+ \
+ t |= r << B_SHIFT; \
+ t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK); \
+ t &= RB_MASK; \
+ t <<= G_SHIFT; \
+ \
+ r = ((x >> B_SHIFT) & MASK) * a + \
+ ((y >> B_SHIFT) & MASK) * b + ONE_HALF; \
+ r += (r >> G_SHIFT); \
+ r >>= G_SHIFT; \
+ \
+ x = (x & MASK) * a + (y & MASK) * b + ONE_HALF; \
+ x += (x >> G_SHIFT); \
+ x >>= G_SHIFT; \
+ x |= r << B_SHIFT; \
+ x |= RB_MASK_PLUS_ONE - ((x >> G_SHIFT) & RB_MASK); \
+ x &= RB_MASK; \
x |= t; \
} while (0)
x_c = (x_c * a + y_c *b) / 256
*/
#define FbByteAddMul_256(x, a, y, b) do { \
- uint32_t t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; \
- t >>= 8; \
- t &= 0xff00ff; \
- \
- x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; \
- x &= 0xff00ff00; \
+ comp4_t t = (x & RB_MASK) * a + (y & RB_MASK) * b; \
+ t >>= G_SHIFT; \
+ t &= RB_MASK; \
+ \
+ x = ((x >> G_SHIFT) & RB_MASK) * a + \
+ ((y >> G_SHIFT) & RB_MASK) * b; \
+ x &= AG_MASK; \
x += t; \
} while (0)
/*
x_c = (x_c * a_c) / 255
*/
-#define FbByteMulC(x, a) do { \
- uint32_t t; \
- uint32_t r = (x & 0xff) * (a & 0xff); \
- r |= (x & 0xff0000) * ((a >> 16) & 0xff); \
- r += 0x800080; \
- r = (r + ((r >> 8) & 0xff00ff)) >> 8; \
- r &= 0xff00ff; \
- \
- x >>= 8; \
- t = (x & 0xff) * ((a >> 8) & 0xff); \
- t |= (x & 0xff0000) * (a >> 24); \
- t += 0x800080; \
- t = t + ((t >> 8) & 0xff00ff); \
- x = r | (t & 0xff00ff00); \
- \
+#define FbByteMulC(x, a) do { \
+ comp4_t t; \
+ comp4_t r = (x & MASK) * (a & MASK); \
+ r |= (x & B_MASK) * ((a >> B_SHIFT) & MASK); \
+ r += RB_ONE_HALF; \
+ r = (r + ((r >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \
+ r &= RB_MASK; \
+ \
+ x >>= G_SHIFT; \
+ t = (x & MASK) * ((a >> G_SHIFT) & MASK); \
+ t |= (x & B_MASK) * (a >> A_SHIFT); \
+ t += RB_ONE_HALF; \
+ t = t + ((t >> G_SHIFT) & RB_MASK); \
+ x = r | (t & AG_MASK); \
} while (0)
/*
x_c = (x_c * a) / 255 + y
*/
-#define FbByteMulAddC(x, a, y) do { \
- uint32_t t; \
- uint32_t r = (x & 0xff) * (a & 0xff); \
- r |= (x & 0xff0000) * ((a >> 16) & 0xff); \
- r += 0x800080; \
- r = (r + ((r >> 8) & 0xff00ff)) >> 8; \
- r &= 0xff00ff; \
- r += y & 0xff00ff; \
- r |= 0x1000100 - ((r >> 8) & 0xff00ff); \
- r &= 0xff00ff; \
- \
- x >>= 8; \
- t = (x & 0xff) * ((a >> 8) & 0xff); \
- t |= (x & 0xff0000) * (a >> 24); \
- t += 0x800080; \
- t = (t + ((t >> 8) & 0xff00ff)) >> 8; \
- t &= 0xff00ff; \
- t += (y >> 8) & 0xff00ff; \
- t |= 0x1000100 - ((t >> 8) & 0xff00ff); \
- t &= 0xff00ff; \
- x = r | (t << 8); \
+#define FbByteMulAddC(x, a, y) do { \
+ comp4_t t; \
+ comp4_t r = (x & MASK) * (a & MASK); \
+ r |= (x & B_MASK) * ((a >> B_SHIFT) & MASK); \
+ r += RB_ONE_HALF; \
+ r = (r + ((r >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \
+ r &= RB_MASK; \
+ r += y & RB_MASK; \
+ r |= RB_MASK_PLUS_ONE - ((r >> G_SHIFT) & RB_MASK); \
+ r &= RB_MASK; \
+ \
+ x >>= G_SHIFT; \
+ t = (x & MASK) * ((a >> G_SHIFT) & MASK); \
+ t |= (x & B_MASK) * (a >> A_SHIFT); \
+ t += RB_ONE_HALF; \
+ t = (t + ((t >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \
+ t &= RB_MASK; \
+ t += (y >> G_SHIFT) & RB_MASK; \
+ t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK); \
+ t &= RB_MASK; \
+ x = r | (t << G_SHIFT); \
} while (0)
/*
x_c = (x_c * a_c + y_c * b) / 255
*/
#define FbByteAddMulC(x, a, y, b) do { \
- uint32_t t; \
- uint32_t r = (x >> 24) * (a >> 24) + (y >> 24) * b; \
- r += (r >> 8) + 0x80; \
- r >>= 8; \
- \
- t = (x & 0xff00) * ((a >> 8) & 0xff) + (y & 0xff00) * b; \
- t += (t >> 8) + 0x8000; \
- t >>= 16; \
- \
- t |= r << 16; \
- t |= 0x1000100 - ((t >> 8) & 0xff00ff); \
- t &= 0xff00ff; \
- t <<= 8; \
- \
- r = ((x >> 16) & 0xff) * ((a >> 16) & 0xff) + ((y >> 16) & 0xff) * b + 0x80; \
- r += (r >> 8); \
- r >>= 8; \
- \
- x = (x & 0xff) * (a & 0xff) + (y & 0xff) * b + 0x80; \
- x += (x >> 8); \
- x >>= 8; \
- x |= r << 16; \
- x |= 0x1000100 - ((x >> 8) & 0xff00ff); \
- x &= 0xff00ff; \
+ comp4_t t; \
+ comp4_t r = (x >> A_SHIFT) * (a >> A_SHIFT) + \
+ (y >> A_SHIFT) * b; \
+ r += (r >> G_SHIFT) + ONE_HALF; \
+ r >>= G_SHIFT; \
+ \
+ t = (x & G_MASK) * ((a >> G_SHIFT) & MASK) + (y & G_MASK) * b; \
+ t += (t >> G_SHIFT) + (ONE_HALF << G_SHIFT); \
+ t >>= B_SHIFT; \
+ \
+ t |= r << B_SHIFT; \
+ t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK); \
+ t &= RB_MASK; \
+ t <<= G_SHIFT; \
+ \
+ r = ((x >> B_SHIFT) & MASK) * ((a >> B_SHIFT) & MASK) + \
+ ((y >> B_SHIFT) & MASK) * b + ONE_HALF; \
+ r += (r >> G_SHIFT); \
+ r >>= G_SHIFT; \
+ \
+ x = (x & MASK) * (a & MASK) + (y & MASK) * b + ONE_HALF; \
+ x += (x >> G_SHIFT); \
+ x >>= G_SHIFT; \
+ x |= r << B_SHIFT; \
+ x |= RB_MASK_PLUS_ONE - ((x >> G_SHIFT) & RB_MASK); \
+ x &= RB_MASK; \
x |= t; \
} while (0)
x_c = min(x_c + y_c, 255)
*/
#define FbByteAdd(x, y) do { \
- uint32_t t; \
- uint32_t r = (x & 0xff00ff) + (y & 0xff00ff); \
- r |= 0x1000100 - ((r >> 8) & 0xff00ff); \
- r &= 0xff00ff; \
- \
- t = ((x >> 8) & 0xff00ff) + ((y >> 8) & 0xff00ff); \
- t |= 0x1000100 - ((t >> 8) & 0xff00ff); \
- r |= (t & 0xff00ff) << 8; \
+ comp4_t t; \
+ comp4_t r = (x & RB_MASK) + (y & RB_MASK); \
+ r |= RB_MASK_PLUS_ONE - ((r >> G_SHIFT) & RB_MASK); \
+ r &= RB_MASK; \
+ \
+ t = ((x >> G_SHIFT) & RB_MASK) + ((y >> G_SHIFT) & RB_MASK); \
+ t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK); \
+ r |= (t & RB_MASK) << G_SHIFT; \
x = r; \
} while (0)
* Combine src and mask
*/
FASTCALL static void
-pixman_fbCombineMaskU (uint32_t *src, const uint32_t *mask, int width)
+pixman_fbCombineMaskU (comp4_t *src, const comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t a = *(mask + i) >> 24;
- uint32_t s = *(src + i);
+ comp4_t a = *(mask + i) >> A_SHIFT;
+ comp4_t s = *(src + i);
FbByteMul(s, a);
*(src + i) = s;
}
*/
FASTCALL static void
-fbCombineClear (uint32_t *dest, const uint32_t *src, int width)
+fbCombineClear (comp4_t *dest, const comp4_t *src, int width)
{
- memset(dest, 0, width*sizeof(uint32_t));
+ memset(dest, 0, width*sizeof(comp4_t));
}
FASTCALL static void
-fbCombineSrcU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineSrcU (comp4_t *dest, const comp4_t *src, int width)
{
- memcpy(dest, src, width*sizeof(uint32_t));
+ memcpy(dest, src, width*sizeof(comp4_t));
}
/* if the Src is opaque, call fbCombineSrcU */
FASTCALL static void
-fbCombineOverU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineOverU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t ia = Alpha(~s);
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t ia = Alpha(~s);
FbByteMulAdd(d, ia, s);
*(dest + i) = d;
/* if the Dst is opaque, this is a noop */
FASTCALL static void
-fbCombineOverReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineOverReverseU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t ia = Alpha(~*(dest + i));
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t ia = Alpha(~*(dest + i));
FbByteMulAdd(s, ia, d);
*(dest + i) = s;
}
/* if the Dst is opaque, call fbCombineSrcU */
FASTCALL static void
-fbCombineInU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineInU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t a = Alpha(*(dest + i));
+ comp4_t s = *(src + i);
+ comp4_t a = Alpha(*(dest + i));
FbByteMul(s, a);
*(dest + i) = s;
}
/* if the Src is opaque, this is a noop */
FASTCALL static void
-fbCombineInReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineInReverseU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint32_t a = Alpha(*(src + i));
+ comp4_t d = *(dest + i);
+ comp4_t a = Alpha(*(src + i));
FbByteMul(d, a);
*(dest + i) = d;
}
/* if the Dst is opaque, call fbCombineClear */
FASTCALL static void
-fbCombineOutU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineOutU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t a = Alpha(~*(dest + i));
+ comp4_t s = *(src + i);
+ comp4_t a = Alpha(~*(dest + i));
FbByteMul(s, a);
*(dest + i) = s;
}
/* if the Src is opaque, call fbCombineClear */
FASTCALL static void
-fbCombineOutReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineOutReverseU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint32_t a = Alpha(~*(src + i));
+ comp4_t d = *(dest + i);
+ comp4_t a = Alpha(~*(src + i));
FbByteMul(d, a);
*(dest + i) = d;
}
/* if the Dst is opaque, call fbCombineOverU */
/* if both the Src and Dst are opaque, call fbCombineSrcU */
FASTCALL static void
-fbCombineAtopU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineAtopU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t dest_a = Alpha(d);
- uint32_t src_ia = Alpha(~s);
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t dest_a = Alpha(d);
+ comp4_t src_ia = Alpha(~s);
FbByteAddMul(s, dest_a, d, src_ia);
*(dest + i) = s;
/* if the Dst is opaque, call fbCombineInReverseU */
/* if both the Src and Dst are opaque, call fbCombineDstU */
FASTCALL static void
-fbCombineAtopReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineAtopReverseU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t src_a = Alpha(s);
- uint32_t dest_ia = Alpha(~d);
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t src_a = Alpha(s);
+ comp4_t dest_ia = Alpha(~d);
FbByteAddMul(s, dest_ia, d, src_a);
*(dest + i) = s;
/* if the Dst is opaque, call fbCombineOverReverseU */
/* if both the Src and Dst are opaque, call fbCombineClear */
FASTCALL static void
-fbCombineXorU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineXorU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t src_ia = Alpha(~s);
- uint32_t dest_ia = Alpha(~d);
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t src_ia = Alpha(~s);
+ comp4_t dest_ia = Alpha(~d);
FbByteAddMul(s, dest_ia, d, src_ia);
*(dest + i) = s;
}
FASTCALL static void
-fbCombineAddU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineAddU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
FbByteAdd(d, s);
*(dest + i) = d;
}
/* if the Dst is opaque, call fbCombineAddU */
/* if both the Src and Dst are opaque, call fbCombineAddU */
FASTCALL static void
-fbCombineSaturateU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineSaturateU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint16_t sa, da;
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp2_t sa, da;
- sa = s >> 24;
- da = ~d >> 24;
+ sa = s >> A_SHIFT;
+ da = ~d >> A_SHIFT;
if (sa > da)
{
sa = FbIntDiv(da, sa);
#define CombineXor (CombineAOut|CombineBOut)
/* portion covered by a but not b */
-FASTCALL static uint8_t
-fbCombineDisjointOutPart (uint8_t a, uint8_t b)
+FASTCALL static comp1_t
+fbCombineDisjointOutPart (comp1_t a, comp1_t b)
{
/* min (1, (1-b) / a) */
b = ~b; /* 1 - b */
if (b >= a) /* 1 - b >= a -> (1-b)/a >= 1 */
- return 0xff; /* 1 */
+ return MASK; /* 1 */
return FbIntDiv(b,a); /* (1-b) / a */
}
/* portion covered by both a and b */
-FASTCALL static uint8_t
-fbCombineDisjointInPart (uint8_t a, uint8_t b)
+FASTCALL static comp1_t
+fbCombineDisjointInPart (comp1_t a, comp1_t b)
{
/* max (1-(1-b)/a,0) */
/* = - min ((1-b)/a - 1, 0) */
}
/* portion covered by a but not b */
-FASTCALL static uint8_t
-fbCombineConjointOutPart (uint8_t a, uint8_t b)
+FASTCALL static comp1_t
+fbCombineConjointOutPart (comp1_t a, comp1_t b)
{
/* max (1-b/a,0) */
/* = 1-min(b/a,1) */
}
/* portion covered by both a and b */
-FASTCALL static uint8_t
-fbCombineConjointInPart (uint8_t a, uint8_t b)
+FASTCALL static comp1_t
+fbCombineConjointInPart (comp1_t a, comp1_t b)
{
/* min (1,b/a) */
if (b >= a) /* b >= a -> b/a >= 1 */
- return 0xff; /* 1 */
+ return MASK; /* 1 */
return FbIntDiv(b,a); /* b/a */
}
FASTCALL static void
-fbCombineDisjointGeneralU (uint32_t *dest, const uint32_t *src, int width, uint8_t combine)
+fbCombineDisjointGeneralU (comp4_t *dest, const comp4_t *src, int width, comp1_t combine)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t m,n,o,p;
- uint16_t Fa, Fb, t, u, v;
- uint8_t sa = s >> 24;
- uint8_t da = d >> 24;
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t m,n,o,p;
+ comp2_t Fa, Fb, t, u, v;
+ comp1_t sa = s >> A_SHIFT;
+ comp1_t da = d >> A_SHIFT;
switch (combine & CombineA) {
default:
Fa = fbCombineDisjointInPart (sa, da);
break;
case CombineA:
- Fa = 0xff;
+ Fa = MASK;
break;
}
Fb = fbCombineDisjointInPart (da, sa);
break;
case CombineB:
- Fb = 0xff;
+ Fb = MASK;
break;
}
m = FbGen (s,d,0,Fa,Fb,t, u, v);
- n = FbGen (s,d,8,Fa,Fb,t, u, v);
- o = FbGen (s,d,16,Fa,Fb,t, u, v);
- p = FbGen (s,d,24,Fa,Fb,t, u, v);
+ n = FbGen (s,d,G_SHIFT,Fa,Fb,t, u, v);
+ o = FbGen (s,d,B_SHIFT,Fa,Fb,t, u, v);
+ p = FbGen (s,d,A_SHIFT,Fa,Fb,t, u, v);
s = m|n|o|p;
*(dest + i) = s;
}
}
FASTCALL static void
-fbCombineDisjointOverU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointOverU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint16_t a = s >> 24;
+ comp4_t s = *(src + i);
+ comp2_t a = s >> A_SHIFT;
if (a != 0x00)
{
- if (a != 0xff)
+ if (a != MASK)
{
- uint32_t d = *(dest + i);
- a = fbCombineDisjointOutPart (d >> 24, a);
+ comp4_t d = *(dest + i);
+ a = fbCombineDisjointOutPart (d >> A_SHIFT, a);
FbByteMulAdd(d, a, s);
s = d;
}
}
FASTCALL static void
-fbCombineDisjointInU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointInU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineAIn);
}
FASTCALL static void
-fbCombineDisjointInReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointInReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineBIn);
}
FASTCALL static void
-fbCombineDisjointOutU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointOutU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineAOut);
}
FASTCALL static void
-fbCombineDisjointOutReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointOutReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineBOut);
}
FASTCALL static void
-fbCombineDisjointAtopU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointAtopU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineAAtop);
}
FASTCALL static void
-fbCombineDisjointAtopReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointAtopReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineBAtop);
}
FASTCALL static void
-fbCombineDisjointXorU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointXorU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineXor);
}
FASTCALL static void
-fbCombineConjointGeneralU (uint32_t *dest, const uint32_t *src, int width, uint8_t combine)
+fbCombineConjointGeneralU (comp4_t *dest, const comp4_t *src, int width, comp1_t combine)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t m,n,o,p;
- uint16_t Fa, Fb, t, u, v;
- uint8_t sa = s >> 24;
- uint8_t da = d >> 24;
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t m,n,o,p;
+ comp2_t Fa, Fb, t, u, v;
+ comp1_t sa = s >> A_SHIFT;
+ comp1_t da = d >> A_SHIFT;
switch (combine & CombineA) {
default:
Fa = fbCombineConjointInPart (sa, da);
break;
case CombineA:
- Fa = 0xff;
+ Fa = MASK;
break;
}
Fb = fbCombineConjointInPart (da, sa);
break;
case CombineB:
- Fb = 0xff;
+ Fb = MASK;
break;
}
m = FbGen (s,d,0,Fa,Fb,t, u, v);
- n = FbGen (s,d,8,Fa,Fb,t, u, v);
- o = FbGen (s,d,16,Fa,Fb,t, u, v);
- p = FbGen (s,d,24,Fa,Fb,t, u, v);
+ n = FbGen (s,d,G_SHIFT,Fa,Fb,t, u, v);
+ o = FbGen (s,d,B_SHIFT,Fa,Fb,t, u, v);
+ p = FbGen (s,d,A_SHIFT,Fa,Fb,t, u, v);
s = m|n|o|p;
*(dest + i) = s;
}
}
FASTCALL static void
-fbCombineConjointOverU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointOverU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineAOver);
}
FASTCALL static void
-fbCombineConjointOverReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointOverReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineBOver);
}
FASTCALL static void
-fbCombineConjointInU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointInU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineAIn);
}
FASTCALL static void
-fbCombineConjointInReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointInReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineBIn);
}
FASTCALL static void
-fbCombineConjointOutU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointOutU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineAOut);
}
FASTCALL static void
-fbCombineConjointOutReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointOutReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineBOut);
}
FASTCALL static void
-fbCombineConjointAtopU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointAtopU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineAAtop);
}
FASTCALL static void
-fbCombineConjointAtopReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointAtopReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineBAtop);
}
FASTCALL static void
-fbCombineConjointXorU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointXorU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineXor);
}
/********************************************************************************/
FASTCALL static void
-fbCombineMaskC (uint32_t *src, uint32_t *mask)
+fbCombineMaskC (comp4_t *src, comp4_t *mask)
{
- uint32_t a = *mask;
+ comp4_t a = *mask;
- uint32_t x;
- uint16_t xa;
+ comp4_t x;
+ comp2_t xa;
if (!a)
{
}
x = *(src);
- if (a == 0xffffffff)
+ if (a == ~0)
{
- x = x >> 24;
- x |= x << 8;
- x |= x << 16;
+ x = x >> A_SHIFT;
+ x |= x << G_SHIFT;
+ x |= x << B_SHIFT;
*(mask) = x;
return;
}
- xa = x >> 24;
+ xa = x >> A_SHIFT;
FbByteMulC(x, a);
*(src) = x;
FbByteMul(a, xa);
}
FASTCALL static void
-fbCombineMaskValueC (uint32_t *src, const uint32_t *mask)
+fbCombineMaskValueC (comp4_t *src, const comp4_t *mask)
{
- uint32_t a = *mask;
- uint32_t x;
+ comp4_t a = *mask;
+ comp4_t x;
if (!a)
{
return;
}
- if (a == 0xffffffff)
+ if (a == ~0)
return;
x = *(src);
}
FASTCALL static void
-fbCombineMaskAlphaC (const uint32_t *src, uint32_t *mask)
+fbCombineMaskAlphaC (const comp4_t *src, comp4_t *mask)
{
- uint32_t a = *(mask);
- uint32_t x;
+ comp4_t a = *(mask);
+ comp4_t x;
if (!a)
return;
- x = *(src) >> 24;
- if (x == 0xff)
+ x = *(src) >> A_SHIFT;
+ if (x == MASK)
return;
- if (a == 0xffffffff)
+ if (a == ~0)
{
- x = x >> 24;
- x |= x << 8;
- x |= x << 16;
+ x = x >> A_SHIFT;
+ x |= x << G_SHIFT;
+ x |= x << B_SHIFT;
*(mask) = x;
return;
}
FASTCALL static void
-fbCombineClearC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineClearC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
- memset(dest, 0, width*sizeof(uint32_t));
+ memset(dest, 0, width*sizeof(comp4_t));
}
FASTCALL static void
-fbCombineSrcC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineSrcC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
fbCombineMaskValueC (&s, &m);
}
FASTCALL static void
-fbCombineOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineOverC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t a;
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t a;
fbCombineMaskC (&s, &m);
a = ~m;
- if (a != 0xffffffff)
+ if (a != ~0)
{
if (a)
{
- uint32_t d = *(dest + i);
+ comp4_t d = *(dest + i);
FbByteMulAddC(d, a, s);
s = d;
}
}
FASTCALL static void
-fbCombineOverReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineOverReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint32_t a = ~d >> 24;
+ comp4_t d = *(dest + i);
+ comp4_t a = ~d >> A_SHIFT;
if (a)
{
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
fbCombineMaskValueC (&s, &m);
- if (a != 0xff)
+ if (a != MASK)
{
FbByteMulAdd(s, a, d);
}
}
FASTCALL static void
-fbCombineInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineInC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint16_t a = d >> 24;
- uint32_t s = 0;
+ comp4_t d = *(dest + i);
+ comp2_t a = d >> A_SHIFT;
+ comp4_t s = 0;
if (a)
{
- uint32_t m = *(mask + i);
+ comp4_t m = *(mask + i);
s = *(src + i);
fbCombineMaskValueC (&s, &m);
- if (a != 0xff)
+ if (a != MASK)
{
FbByteMul(s, a);
}
}
FASTCALL static void
-fbCombineInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineInReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t a;
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t a;
fbCombineMaskAlphaC (&s, &m);
a = m;
- if (a != 0xffffffff)
+ if (a != ~0)
{
- uint32_t d = 0;
+ comp4_t d = 0;
if (a)
{
d = *(dest + i);
}
FASTCALL static void
-fbCombineOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineOutC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint16_t a = ~d >> 24;
- uint32_t s = 0;
+ comp4_t d = *(dest + i);
+ comp2_t a = ~d >> A_SHIFT;
+ comp4_t s = 0;
if (a)
{
- uint32_t m = *(mask + i);
+ comp4_t m = *(mask + i);
s = *(src + i);
fbCombineMaskValueC (&s, &m);
- if (a != 0xff)
+ if (a != MASK)
{
FbByteMul(s, a);
}
}
FASTCALL static void
-fbCombineOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineOutReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t a;
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t a;
fbCombineMaskAlphaC (&s, &m);
a = ~m;
- if (a != 0xffffffff)
+ if (a != ~0)
{
- uint32_t d = 0;
+ comp4_t d = 0;
if (a)
{
d = *(dest + i);
}
FASTCALL static void
-fbCombineAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineAtopC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t ad;
- uint16_t as = d >> 24;
+ comp4_t d = *(dest + i);
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t ad;
+ comp2_t as = d >> A_SHIFT;
fbCombineMaskC (&s, &m);
}
FASTCALL static void
-fbCombineAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineAtopReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t ad;
- uint16_t as = ~d >> 24;
+ comp4_t d = *(dest + i);
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t ad;
+ comp2_t as = ~d >> A_SHIFT;
fbCombineMaskC (&s, &m);
}
FASTCALL static void
-fbCombineXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineXorC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t ad;
- uint16_t as = ~d >> 24;
+ comp4_t d = *(dest + i);
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t ad;
+ comp2_t as = ~d >> A_SHIFT;
fbCombineMaskC (&s, &m);
}
FASTCALL static void
-fbCombineAddC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineAddC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t d = *(dest + i);
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t d = *(dest + i);
fbCombineMaskValueC (&s, &m);
}
FASTCALL static void
-fbCombineSaturateC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineSaturateC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s, d;
- uint16_t sa, sr, sg, sb, da;
- uint16_t t, u, v;
- uint32_t m,n,o,p;
+ comp4_t s, d;
+ comp2_t sa, sr, sg, sb, da;
+ comp2_t t, u, v;
+ comp4_t m,n,o,p;
d = *(dest + i);
s = *(src + i);
fbCombineMaskC (&s, &m);
- sa = (m >> 24);
- sr = (m >> 16) & 0xff;
- sg = (m >> 8) & 0xff;
- sb = (m ) & 0xff;
- da = ~d >> 24;
+ sa = (m >> A_SHIFT);
+ sr = (m >> B_SHIFT) & MASK;
+ sg = (m >> G_SHIFT) & MASK;
+ sb = m & MASK;
+ da = ~d >> A_SHIFT;
if (sb <= da)
m = FbAdd(s,d,0,t);
else
- m = FbGen (s, d, 0, (da << 8) / sb, 0xff, t, u, v);
+ m = FbGen (s, d, 0, (da << G_SHIFT) / sb, MASK, t, u, v);
if (sg <= da)
- n = FbAdd(s,d,8,t);
+ n = FbAdd(s,d,G_SHIFT,t);
else
- n = FbGen (s, d, 8, (da << 8) / sg, 0xff, t, u, v);
+ n = FbGen (s, d, G_SHIFT, (da << G_SHIFT) / sg, MASK, t, u, v);
if (sr <= da)
- o = FbAdd(s,d,16,t);
+ o = FbAdd(s,d,B_SHIFT,t);
else
- o = FbGen (s, d, 16, (da << 8) / sr, 0xff, t, u, v);
+ o = FbGen (s, d, B_SHIFT, (da << G_SHIFT) / sr, MASK, t, u, v);
if (sa <= da)
- p = FbAdd(s,d,24,t);
+ p = FbAdd(s,d,A_SHIFT,t);
else
- p = FbGen (s, d, 24, (da << 8) / sa, 0xff, t, u, v);
+ p = FbGen (s, d, A_SHIFT, (da << G_SHIFT) / sa, MASK, t, u, v);
*(dest + i) = m|n|o|p;
}
}
FASTCALL static void
-fbCombineDisjointGeneralC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width, uint8_t combine)
+fbCombineDisjointGeneralC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width, comp1_t combine)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s, d;
- uint32_t m,n,o,p;
- uint32_t Fa, Fb;
- uint16_t t, u, v;
- uint32_t sa;
- uint8_t da;
+ comp4_t s, d;
+ comp4_t m,n,o,p;
+ comp4_t Fa, Fb;
+ comp2_t t, u, v;
+ comp4_t sa;
+ comp1_t da;
s = *(src + i);
m = *(mask + i);
d = *(dest + i);
- da = d >> 24;
+ da = d >> A_SHIFT;
fbCombineMaskC (&s, &m);
Fa = 0;
break;
case CombineAOut:
- m = fbCombineDisjointOutPart ((uint8_t) (sa >> 0), da);
- n = fbCombineDisjointOutPart ((uint8_t) (sa >> 8), da) << 8;
- o = fbCombineDisjointOutPart ((uint8_t) (sa >> 16), da) << 16;
- p = fbCombineDisjointOutPart ((uint8_t) (sa >> 24), da) << 24;
+ m = fbCombineDisjointOutPart ((comp1_t) (sa >> 0), da);
+ n = fbCombineDisjointOutPart ((comp1_t) (sa >> G_SHIFT), da) << G_SHIFT;
+ o = fbCombineDisjointOutPart ((comp1_t) (sa >> B_SHIFT), da) << B_SHIFT;
+ p = fbCombineDisjointOutPart ((comp1_t) (sa >> A_SHIFT), da) << A_SHIFT;
Fa = m|n|o|p;
break;
case CombineAIn:
- m = fbCombineDisjointInPart ((uint8_t) (sa >> 0), da);
- n = fbCombineDisjointInPart ((uint8_t) (sa >> 8), da) << 8;
- o = fbCombineDisjointInPart ((uint8_t) (sa >> 16), da) << 16;
- p = fbCombineDisjointInPart ((uint8_t) (sa >> 24), da) << 24;
+ m = fbCombineDisjointInPart ((comp1_t) (sa >> 0), da);
+ n = fbCombineDisjointInPart ((comp1_t) (sa >> G_SHIFT), da) << G_SHIFT;
+ o = fbCombineDisjointInPart ((comp1_t) (sa >> B_SHIFT), da) << B_SHIFT;
+ p = fbCombineDisjointInPart ((comp1_t) (sa >> A_SHIFT), da) << A_SHIFT;
Fa = m|n|o|p;
break;
case CombineA:
- Fa = 0xffffffff;
+ Fa = ~0;
break;
}
Fb = 0;
break;
case CombineBOut:
- m = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 0));
- n = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 8)) << 8;
- o = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 16)) << 16;
- p = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 24)) << 24;
+ m = fbCombineDisjointOutPart (da, (comp1_t) (sa >> 0));
+ n = fbCombineDisjointOutPart (da, (comp1_t) (sa >> G_SHIFT)) << G_SHIFT;
+ o = fbCombineDisjointOutPart (da, (comp1_t) (sa >> B_SHIFT)) << B_SHIFT;
+ p = fbCombineDisjointOutPart (da, (comp1_t) (sa >> A_SHIFT)) << A_SHIFT;
Fb = m|n|o|p;
break;
case CombineBIn:
- m = fbCombineDisjointInPart (da, (uint8_t) (sa >> 0));
- n = fbCombineDisjointInPart (da, (uint8_t) (sa >> 8)) << 8;
- o = fbCombineDisjointInPart (da, (uint8_t) (sa >> 16)) << 16;
- p = fbCombineDisjointInPart (da, (uint8_t) (sa >> 24)) << 24;
+ m = fbCombineDisjointInPart (da, (comp1_t) (sa >> 0));
+ n = fbCombineDisjointInPart (da, (comp1_t) (sa >> G_SHIFT)) << G_SHIFT;
+ o = fbCombineDisjointInPart (da, (comp1_t) (sa >> B_SHIFT)) << B_SHIFT;
+ p = fbCombineDisjointInPart (da, (comp1_t) (sa >> A_SHIFT)) << A_SHIFT;
Fb = m|n|o|p;
break;
case CombineB:
- Fb = 0xffffffff;
+ Fb = ~0;
break;
}
m = FbGen (s,d,0,FbGet8(Fa,0),FbGet8(Fb,0),t, u, v);
- n = FbGen (s,d,8,FbGet8(Fa,8),FbGet8(Fb,8),t, u, v);
- o = FbGen (s,d,16,FbGet8(Fa,16),FbGet8(Fb,16),t, u, v);
- p = FbGen (s,d,24,FbGet8(Fa,24),FbGet8(Fb,24),t, u, v);
+ n = FbGen (s,d,G_SHIFT,FbGet8(Fa,G_SHIFT),FbGet8(Fb,G_SHIFT),t, u, v);
+ o = FbGen (s,d,B_SHIFT,FbGet8(Fa,B_SHIFT),FbGet8(Fb,B_SHIFT),t, u, v);
+ p = FbGen (s,d,A_SHIFT,FbGet8(Fa,A_SHIFT),FbGet8(Fb,A_SHIFT),t, u, v);
s = m|n|o|p;
*(dest + i) = s;
}
}
FASTCALL static void
-fbCombineDisjointOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointOverC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineAOver);
}
FASTCALL static void
-fbCombineDisjointInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointInC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineAIn);
}
FASTCALL static void
-fbCombineDisjointInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointInReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineBIn);
}
FASTCALL static void
-fbCombineDisjointOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointOutC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineAOut);
}
FASTCALL static void
-fbCombineDisjointOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointOutReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineBOut);
}
FASTCALL static void
-fbCombineDisjointAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointAtopC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineAAtop);
}
FASTCALL static void
-fbCombineDisjointAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointAtopReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineBAtop);
}
FASTCALL static void
-fbCombineDisjointXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointXorC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineXor);
}
FASTCALL static void
-fbCombineConjointGeneralC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width, uint8_t combine)
+fbCombineConjointGeneralC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width, comp1_t combine)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s, d;
- uint32_t m,n,o,p;
- uint32_t Fa, Fb;
- uint16_t t, u, v;
- uint32_t sa;
- uint8_t da;
+ comp4_t s, d;
+ comp4_t m,n,o,p;
+ comp4_t Fa, Fb;
+ comp2_t t, u, v;
+ comp4_t sa;
+ comp1_t da;
s = *(src + i);
m = *(mask + i);
d = *(dest + i);
- da = d >> 24;
+ da = d >> A_SHIFT;
fbCombineMaskC (&s, &m);
Fa = 0;
break;
case CombineAOut:
- m = fbCombineConjointOutPart ((uint8_t) (sa >> 0), da);
- n = fbCombineConjointOutPart ((uint8_t) (sa >> 8), da) << 8;
- o = fbCombineConjointOutPart ((uint8_t) (sa >> 16), da) << 16;
- p = fbCombineConjointOutPart ((uint8_t) (sa >> 24), da) << 24;
+ m = fbCombineConjointOutPart ((comp1_t) (sa >> 0), da);
+ n = fbCombineConjointOutPart ((comp1_t) (sa >> G_SHIFT), da) << G_SHIFT;
+ o = fbCombineConjointOutPart ((comp1_t) (sa >> B_SHIFT), da) << B_SHIFT;
+ p = fbCombineConjointOutPart ((comp1_t) (sa >> A_SHIFT), da) << A_SHIFT;
Fa = m|n|o|p;
break;
case CombineAIn:
- m = fbCombineConjointInPart ((uint8_t) (sa >> 0), da);
- n = fbCombineConjointInPart ((uint8_t) (sa >> 8), da) << 8;
- o = fbCombineConjointInPart ((uint8_t) (sa >> 16), da) << 16;
- p = fbCombineConjointInPart ((uint8_t) (sa >> 24), da) << 24;
+ m = fbCombineConjointInPart ((comp1_t) (sa >> 0), da);
+ n = fbCombineConjointInPart ((comp1_t) (sa >> G_SHIFT), da) << G_SHIFT;
+ o = fbCombineConjointInPart ((comp1_t) (sa >> B_SHIFT), da) << B_SHIFT;
+ p = fbCombineConjointInPart ((comp1_t) (sa >> A_SHIFT), da) << A_SHIFT;
Fa = m|n|o|p;
break;
case CombineA:
- Fa = 0xffffffff;
+ Fa = ~0;
break;
}
Fb = 0;
break;
case CombineBOut:
- m = fbCombineConjointOutPart (da, (uint8_t) (sa >> 0));
- n = fbCombineConjointOutPart (da, (uint8_t) (sa >> 8)) << 8;
- o = fbCombineConjointOutPart (da, (uint8_t) (sa >> 16)) << 16;
- p = fbCombineConjointOutPart (da, (uint8_t) (sa >> 24)) << 24;
+ m = fbCombineConjointOutPart (da, (comp1_t) (sa >> 0));
+ n = fbCombineConjointOutPart (da, (comp1_t) (sa >> G_SHIFT)) << G_SHIFT;
+ o = fbCombineConjointOutPart (da, (comp1_t) (sa >> B_SHIFT)) << B_SHIFT;
+ p = fbCombineConjointOutPart (da, (comp1_t) (sa >> A_SHIFT)) << A_SHIFT;
Fb = m|n|o|p;
break;
case CombineBIn:
- m = fbCombineConjointInPart (da, (uint8_t) (sa >> 0));
- n = fbCombineConjointInPart (da, (uint8_t) (sa >> 8)) << 8;
- o = fbCombineConjointInPart (da, (uint8_t) (sa >> 16)) << 16;
- p = fbCombineConjointInPart (da, (uint8_t) (sa >> 24)) << 24;
+ m = fbCombineConjointInPart (da, (comp1_t) (sa >> 0));
+ n = fbCombineConjointInPart (da, (comp1_t) (sa >> G_SHIFT)) << G_SHIFT;
+ o = fbCombineConjointInPart (da, (comp1_t) (sa >> B_SHIFT)) << B_SHIFT;
+ p = fbCombineConjointInPart (da, (comp1_t) (sa >> A_SHIFT)) << A_SHIFT;
Fb = m|n|o|p;
break;
case CombineB:
- Fb = 0xffffffff;
+ Fb = ~0;
break;
}
m = FbGen (s,d,0,FbGet8(Fa,0),FbGet8(Fb,0),t, u, v);
- n = FbGen (s,d,8,FbGet8(Fa,8),FbGet8(Fb,8),t, u, v);
- o = FbGen (s,d,16,FbGet8(Fa,16),FbGet8(Fb,16),t, u, v);
- p = FbGen (s,d,24,FbGet8(Fa,24),FbGet8(Fb,24),t, u, v);
+ n = FbGen (s,d,G_SHIFT,FbGet8(Fa,G_SHIFT),FbGet8(Fb,G_SHIFT),t, u, v);
+ o = FbGen (s,d,B_SHIFT,FbGet8(Fa,B_SHIFT),FbGet8(Fb,B_SHIFT),t, u, v);
+ p = FbGen (s,d,A_SHIFT,FbGet8(Fa,A_SHIFT),FbGet8(Fb,A_SHIFT),t, u, v);
s = m|n|o|p;
*(dest + i) = s;
}
}
FASTCALL static void
-fbCombineConjointOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointOverC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineAOver);
}
FASTCALL static void
-fbCombineConjointOverReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointOverReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineBOver);
}
FASTCALL static void
-fbCombineConjointInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointInC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineAIn);
}
FASTCALL static void
-fbCombineConjointInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointInReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineBIn);
}
FASTCALL static void
-fbCombineConjointOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointOutC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineAOut);
}
FASTCALL static void
-fbCombineConjointOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointOutReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineBOut);
}
FASTCALL static void
-fbCombineConjointAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointAtopC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineAAtop);
}
FASTCALL static void
-fbCombineConjointAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointAtopReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineBAtop);
}
FASTCALL static void
-fbCombineConjointXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointXorC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineXor);
}