Lines Matching refs:XYZ

1239 png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ)
1243 d = XYZ->red_X + XYZ->red_Y + XYZ->red_Z;
1244 if (png_muldiv(&xy->redx, XYZ->red_X, PNG_FP_1, d) == 0)
1246 if (png_muldiv(&xy->redy, XYZ->red_Y, PNG_FP_1, d) == 0)
1249 whiteX = XYZ->red_X;
1250 whiteY = XYZ->red_Y;
1252 d = XYZ->green_X + XYZ->green_Y + XYZ->green_Z;
1253 if (png_muldiv(&xy->greenx, XYZ->green_X, PNG_FP_1, d) == 0)
1255 if (png_muldiv(&xy->greeny, XYZ->green_Y, PNG_FP_1, d) == 0)
1258 whiteX += XYZ->green_X;
1259 whiteY += XYZ->green_Y;
1261 d = XYZ->blue_X + XYZ->blue_Y + XYZ->blue_Z;
1262 if (png_muldiv(&xy->bluex, XYZ->blue_X, PNG_FP_1, d) == 0)
1264 if (png_muldiv(&xy->bluey, XYZ->blue_Y, PNG_FP_1, d) == 0)
1267 whiteX += XYZ->blue_X;
1268 whiteY += XYZ->blue_Y;
1282 png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
1520 if (png_muldiv(&XYZ->red_X, xy->redx, PNG_FP_1, red_inverse) == 0)
1522 if (png_muldiv(&XYZ->red_Y, xy->redy, PNG_FP_1, red_inverse) == 0)
1524 if (png_muldiv(&XYZ->red_Z, PNG_FP_1 - xy->redx - xy->redy, PNG_FP_1,
1528 if (png_muldiv(&XYZ->green_X, xy->greenx, PNG_FP_1, green_inverse) == 0)
1530 if (png_muldiv(&XYZ->green_Y, xy->greeny, PNG_FP_1, green_inverse) == 0)
1532 if (png_muldiv(&XYZ->green_Z, PNG_FP_1 - xy->greenx - xy->greeny, PNG_FP_1,
1536 if (png_muldiv(&XYZ->blue_X, xy->bluex, blue_scale, PNG_FP_1) == 0)
1538 if (png_muldiv(&XYZ->blue_Y, xy->bluey, blue_scale, PNG_FP_1) == 0)
1540 if (png_muldiv(&XYZ->blue_Z, PNG_FP_1 - xy->bluex - xy->bluey, blue_scale,
1548 png_XYZ_normalize(png_XYZ *XYZ)
1552 if (XYZ->red_Y < 0 || XYZ->green_Y < 0 || XYZ->blue_Y < 0 ||
1553 XYZ->red_X < 0 || XYZ->green_X < 0 || XYZ->blue_X < 0 ||
1554 XYZ->red_Z < 0 || XYZ->green_Z < 0 || XYZ->blue_Z < 0)
1562 Y = XYZ->red_Y;
1563 if (0x7fffffff - Y < XYZ->green_X)
1565 Y += XYZ->green_Y;
1566 if (0x7fffffff - Y < XYZ->blue_X)
1568 Y += XYZ->blue_Y;
1572 if (png_muldiv(&XYZ->red_X, XYZ->red_X, PNG_FP_1, Y) == 0)
1574 if (png_muldiv(&XYZ->red_Y, XYZ->red_Y, PNG_FP_1, Y) == 0)
1576 if (png_muldiv(&XYZ->red_Z, XYZ->red_Z, PNG_FP_1, Y) == 0)
1579 if (png_muldiv(&XYZ->green_X, XYZ->green_X, PNG_FP_1, Y) == 0)
1581 if (png_muldiv(&XYZ->green_Y, XYZ->green_Y, PNG_FP_1, Y) == 0)
1583 if (png_muldiv(&XYZ->green_Z, XYZ->green_Z, PNG_FP_1, Y) == 0)
1586 if (png_muldiv(&XYZ->blue_X, XYZ->blue_X, PNG_FP_1, Y) == 0)
1588 if (png_muldiv(&XYZ->blue_Y, XYZ->blue_Y, PNG_FP_1, Y) == 0)
1590 if (png_muldiv(&XYZ->blue_Z, XYZ->blue_Z, PNG_FP_1, Y) == 0)
1624 png_colorspace_check_xy(png_XYZ *XYZ, const png_xy *xy)
1630 result = png_XYZ_from_xy(XYZ, xy);
1634 result = png_xy_from_XYZ(&xy_test, XYZ);
1650 png_colorspace_check_XYZ(png_xy *xy, png_XYZ *XYZ)
1655 result = png_XYZ_normalize(XYZ);
1659 result = png_xy_from_XYZ(xy, XYZ);
1663 XYZtemp = *XYZ;
1679 png_colorspacerp colorspace, const png_xy *xy, const png_XYZ *XYZ,
1709 colorspace->end_points_XYZ = *XYZ;
1735 png_XYZ XYZ;
1737 switch (png_colorspace_check_xy(&XYZ, xy))
1740 return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, xy, &XYZ,
1766 png_XYZ XYZ = *XYZ_in;
1769 switch (png_colorspace_check_XYZ(&xy, &XYZ))
1772 return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, &xy, &XYZ,