Lines Matching refs:xy
1132 png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ)
1137 if (!png_muldiv(&xy->redx, XYZ->red_X, PNG_FP_1, d)) return 1;
1138 if (!png_muldiv(&xy->redy, XYZ->red_Y, PNG_FP_1, d)) return 1;
1144 if (!png_muldiv(&xy->greenx, XYZ->green_X, PNG_FP_1, d)) return 1;
1145 if (!png_muldiv(&xy->greeny, XYZ->green_Y, PNG_FP_1, d)) return 1;
1151 if (!png_muldiv(&xy->bluex, XYZ->blue_X, PNG_FP_1, d)) return 1;
1152 if (!png_muldiv(&xy->bluey, XYZ->blue_Y, PNG_FP_1, d)) return 1;
1160 if (!png_muldiv(&xy->whitex, whiteX, PNG_FP_1, dwhite)) return 1;
1161 if (!png_muldiv(&xy->whitey, whiteY, PNG_FP_1, dwhite)) return 1;
1167 png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
1176 if (xy->redx < 0 || xy->redx > PNG_FP_1) return 1;
1177 if (xy->redy < 0 || xy->redy > PNG_FP_1-xy->redx) return 1;
1178 if (xy->greenx < 0 || xy->greenx > PNG_FP_1) return 1;
1179 if (xy->greeny < 0 || xy->greeny > PNG_FP_1-xy->greenx) return 1;
1180 if (xy->bluex < 0 || xy->bluex > PNG_FP_1) return 1;
1181 if (xy->bluey < 0 || xy->bluey > PNG_FP_1-xy->bluex) return 1;
1182 if (xy->whitex < 0 || xy->whitex > PNG_FP_1) return 1;
1183 if (xy->whitey < 0 || xy->whitey > PNG_FP_1-xy->whitex) return 1;
1364 if (!png_muldiv(&left, xy->greenx-xy->bluex, xy->redy - xy->bluey, 7))
1366 if (!png_muldiv(&right, xy->greeny-xy->bluey, xy->redx - xy->bluex, 7))
1371 if (!png_muldiv(&left, xy->greenx-xy->bluex, xy->whitey-xy->bluey, 7))
1373 if (!png_muldiv(&right, xy->greeny-xy->bluey, xy->whitex-xy->bluex, 7))
1381 if (!png_muldiv(&red_inverse, xy->whitey, denominator, left-right) ||
1382 red_inverse <= xy->whitey /* r+g+b scales = white scale */)
1386 if (!png_muldiv(&left, xy->redy-xy->bluey, xy->whitex-xy->bluex, 7))
1388 if (!png_muldiv(&right, xy->redx-xy->bluex, xy->whitey-xy->bluey, 7))
1390 if (!png_muldiv(&green_inverse, xy->whitey, denominator, left-right) ||
1391 green_inverse <= xy->whitey)
1397 blue_scale = png_reciprocal(xy->whitey) - png_reciprocal(red_inverse) -
1403 if (!png_muldiv(&XYZ->red_X, xy->redx, PNG_FP_1, red_inverse)) return 1;
1404 if (!png_muldiv(&XYZ->red_Y, xy->redy, PNG_FP_1, red_inverse)) return 1;
1405 if (!png_muldiv(&XYZ->red_Z, PNG_FP_1 - xy->redx - xy->redy, PNG_FP_1,
1409 if (!png_muldiv(&XYZ->green_X, xy->greenx, PNG_FP_1, green_inverse))
1411 if (!png_muldiv(&XYZ->green_Y, xy->greeny, PNG_FP_1, green_inverse))
1413 if (!png_muldiv(&XYZ->green_Z, PNG_FP_1 - xy->greenx - xy->greeny, PNG_FP_1,
1417 if (!png_muldiv(&XYZ->blue_X, xy->bluex, blue_scale, PNG_FP_1)) return 1;
1418 if (!png_muldiv(&XYZ->blue_Y, xy->bluey, blue_scale, PNG_FP_1)) return 1;
1419 if (!png_muldiv(&XYZ->blue_Z, PNG_FP_1 - xy->bluex - xy->bluey, blue_scale,
1490 png_colorspace_check_xy(png_XYZ *XYZ, const png_xy *xy)
1496 result = png_XYZ_from_xy(XYZ, xy);
1502 if (png_colorspace_endpoints_match(xy, &xy_test,
1514 png_colorspace_check_XYZ(png_xy *xy, png_XYZ *XYZ)
1522 result = png_xy_from_XYZ(xy, XYZ);
1526 return png_colorspace_check_xy(&XYZtemp, xy);
1541 png_colorspacerp colorspace, const png_xy *xy, const png_XYZ *XYZ,
1556 if (!png_colorspace_endpoints_match(xy, &colorspace->end_points_xy, 100))
1568 colorspace->end_points_xy = *xy;
1575 if (png_colorspace_endpoints_match(xy, &sRGB_xy, 1000))
1587 png_colorspacerp colorspace, const png_xy *xy, int preferred)
1597 switch (png_colorspace_check_xy(&XYZ, xy))
1600 return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, xy, &XYZ,
1628 png_xy xy;
1630 switch (png_colorspace_check_XYZ(&xy, &XYZ))
1633 return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, &xy, &XYZ,