Lines Matching defs:xy

1227 png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ)
1232 if (png_muldiv(&xy->redx, XYZ->red_X, PNG_FP_1, d) == 0)
1234 if (png_muldiv(&xy->redy, XYZ->red_Y, PNG_FP_1, d) == 0)
1241 if (png_muldiv(&xy->greenx, XYZ->green_X, PNG_FP_1, d) == 0)
1243 if (png_muldiv(&xy->greeny, XYZ->green_Y, PNG_FP_1, d) == 0)
1250 if (png_muldiv(&xy->bluex, XYZ->blue_X, PNG_FP_1, d) == 0)
1252 if (png_muldiv(&xy->bluey, XYZ->blue_Y, PNG_FP_1, d) == 0)
1261 if (png_muldiv(&xy->whitex, whiteX, PNG_FP_1, dwhite) == 0)
1263 if (png_muldiv(&xy->whitey, whiteY, PNG_FP_1, dwhite) == 0)
1270 png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
1275 /* Check xy and, implicitly, z. Note that wide gamut color spaces typically
1278 * xy->whitey against 5, not 0, to avoid a possible integer overflow.
1280 if (xy->redx < 0 || xy->redx > PNG_FP_1) return 1;
1281 if (xy->redy < 0 || xy->redy > PNG_FP_1-xy->redx) return 1;
1282 if (xy->greenx < 0 || xy->greenx > PNG_FP_1) return 1;
1283 if (xy->greeny < 0 || xy->greeny > PNG_FP_1-xy->greenx) return 1;
1284 if (xy->bluex < 0 || xy->bluex > PNG_FP_1) return 1;
1285 if (xy->bluey < 0 || xy->bluey > PNG_FP_1-xy->bluex) return 1;
1286 if (xy->whitex < 0 || xy->whitex > PNG_FP_1) return 1;
1287 if (xy->whitey < 5 || xy->whitey > PNG_FP_1-xy->whitex) return 1;
1468 if (png_muldiv(&left, xy->greenx-xy->bluex, xy->redy - xy->bluey, 7) == 0)
1470 if (png_muldiv(&right, xy->greeny-xy->bluey, xy->redx - xy->bluex, 7) == 0)
1475 if (png_muldiv(&left, xy->greenx-xy->bluex, xy->whitey-xy->bluey, 7) == 0)
1477 if (png_muldiv(&right, xy->greeny-xy->bluey, xy->whitex-xy->bluex, 7) == 0)
1485 if (png_muldiv(&red_inverse, xy->whitey, denominator, left-right) == 0 ||
1486 red_inverse <= xy->whitey /* r+g+b scales = white scale */)
1490 if (png_muldiv(&left, xy->redy-xy->bluey, xy->whitex-xy->bluex, 7) == 0)
1492 if (png_muldiv(&right, xy->redx-xy->bluex, xy->whitey-xy->bluey, 7) == 0)
1494 if (png_muldiv(&green_inverse, xy->whitey, denominator, left-right) == 0 ||
1495 green_inverse <= xy->whitey)
1501 blue_scale = png_reciprocal(xy->whitey) - png_reciprocal(red_inverse) -
1508 if (png_muldiv(&XYZ->red_X, xy->redx, PNG_FP_1, red_inverse) == 0)
1510 if (png_muldiv(&XYZ->red_Y, xy->redy, PNG_FP_1, red_inverse) == 0)
1512 if (png_muldiv(&XYZ->red_Z, PNG_FP_1 - xy->redx - xy->redy, PNG_FP_1,
1516 if (png_muldiv(&XYZ->green_X, xy->greenx, PNG_FP_1, green_inverse) == 0)
1518 if (png_muldiv(&XYZ->green_Y, xy->greeny, PNG_FP_1, green_inverse) == 0)
1520 if (png_muldiv(&XYZ->green_Z, PNG_FP_1 - xy->greenx - xy->greeny, PNG_FP_1,
1524 if (png_muldiv(&XYZ->blue_X, xy->bluex, blue_scale, PNG_FP_1) == 0)
1526 if (png_muldiv(&XYZ->blue_Y, xy->bluey, blue_scale, PNG_FP_1) == 0)
1528 if (png_muldiv(&XYZ->blue_Z, PNG_FP_1 - xy->bluex - xy->bluey, blue_scale,
1608 * check is to round-trip xy -> XYZ -> xy and then check that the result is
1612 png_colorspace_check_xy(png_XYZ *XYZ, const png_xy *xy)
1618 result = png_XYZ_from_xy(XYZ, xy);
1626 if (png_colorspace_endpoints_match(xy, &xy_test,
1635 * (another side-effect) and the xy chromaticities are returned.
1638 png_colorspace_check_XYZ(png_xy *xy, png_XYZ *XYZ)
1647 result = png_xy_from_XYZ(xy, XYZ);
1652 return png_colorspace_check_xy(&XYZtemp, xy);
1667 png_colorspacerp colorspace, const png_xy *xy, const png_XYZ *XYZ,
1683 if (png_colorspace_endpoints_match(xy, &colorspace->end_points_xy,
1696 colorspace->end_points_xy = *xy;
1703 if (png_colorspace_endpoints_match(xy, &sRGB_xy, 1000) != 0)
1715 png_colorspacerp colorspace, const png_xy *xy, int preferred)
1725 switch (png_colorspace_check_xy(&XYZ, xy))
1728 return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, xy, &XYZ,
1755 png_xy xy;
1757 switch (png_colorspace_check_XYZ(&xy, &XYZ))
1760 return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, &xy, &XYZ,