VGfloat rgba[][4])
{
VGint i;
+ union util_color uc;
switch (dataFormat) {
case VG_sRGBX_8888: {
b = (*src >> 8) & 0xff;
a = 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
}
b = (*src >> 8) & 0xff;
a = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
b = (*src >> 8) & 0xff;
a = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
clr[2] = ((*src >> 0) & 31)/31.;
clr[3] = 1.f;
- util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
}
clr[2] = ((*src >> 1) & 31)/31.;
clr[3] = ((*src >> 0) & 1)/1.;
- util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
}
clr[2] = ((*src >> 4) & 15)/15.;
clr[3] = ((*src >> 0) & 15)/15.;
- util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
}
VGubyte *src = (VGubyte *)data;
src += offset;
for (i = 0; i < n; ++i) {
- util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
}
b = (*src >> 8) & 0xff;
a = 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
}
b = (*src >> 8) & 0xff;
a = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
b = (*src >> 8) & 0xff;
a = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
VGubyte *src = (VGubyte *)data;
src += offset;
for (i = 0; i < n; ++i) {
- util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
}
VGubyte *src = (VGubyte *)data;
src += offset;
for (i = 0; i < n; ++i) {
- util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
}
clr[2] = clr[0];
clr[3] = 1.f;
- util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i+j]);
+ util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i+j][0] = uc.f[0];
+ rgba[i+j][1] = uc.f[1];
+ rgba[i+j][2] = uc.f[2];
+ rgba[i+j][3] = uc.f[3];
}
++src;
}
clr[2] = 0.f;
clr[3] = (((*src) & (1<<shift)) >> shift);
- util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i+j]);
+ util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i+j][0] = uc.f[0];
+ rgba[i+j][1] = uc.f[1];
+ rgba[i+j][2] = uc.f[2];
+ rgba[i+j][3] = uc.f[3];
}
++src;
}
clr[2] = 0.f;
clr[3] = ((*src) & (bitter)) >> shift;
- util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i +j]);
+ util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i+j][0] = uc.f[0];
+ rgba[i+j][1] = uc.f[1];
+ rgba[i+j][2] = uc.f[2];
+ rgba[i+j][3] = uc.f[3];
}
++src;
}
g = (*src >> 8) & 0xff;
b = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
g = (*src >> 8) & 0xff;
b = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
g = (*src >> 8) & 0xff;
b = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
g = (*src >> 8) & 0xff;
b = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
r = (*src >> 8) & 0xff;
a = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
r = (*src >> 8) & 0xff;
a = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
r = (*src >> 8) & 0xff;
a = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
r = (*src >> 8) & 0xff;
a = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
g = (*src >> 8) & 0xff;
r = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
g = (*src >> 8) & 0xff;
r = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
g = (*src >> 8) & 0xff;
r = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;
g = (*src >> 8) & 0xff;
r = (*src >> 0) & 0xff;
- util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- (union util_color *)rgba[i]);
+ util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc);
+ rgba[i][0] = uc.f[0];
+ rgba[i][1] = uc.f[1];
+ rgba[i][2] = uc.f[2];
+ rgba[i][3] = uc.f[3];
++src;
}
return;