Lines Matching refs:XYZ

1132 png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ)

1136 d = XYZ->red_X + XYZ->red_Y + XYZ->red_Z;
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;
1140 whiteX = XYZ->red_X;
1141 whiteY = XYZ->red_Y;
1143 d = XYZ->green_X + XYZ->green_Y + XYZ->green_Z;
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;
1147 whiteX += XYZ->green_X;
1148 whiteY += XYZ->green_Y;
1150 d = XYZ->blue_X + XYZ->blue_Y + XYZ->blue_Z;
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;
1154 whiteX += XYZ->blue_X;
1155 whiteY += XYZ->blue_Y;
1167 png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
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,
1427 png_XYZ_normalize(png_XYZ *XYZ)
1431 if (XYZ->red_Y < 0 || XYZ->green_Y < 0 || XYZ->blue_Y < 0 ||
1432 XYZ->red_X < 0 || XYZ->green_X < 0 || XYZ->blue_X < 0 ||
1433 XYZ->red_Z < 0 || XYZ->green_Z < 0 || XYZ->blue_Z < 0)
1441 Y = XYZ->red_Y;
1442 if (0x7fffffff - Y < XYZ->green_X) return 1;
1443 Y += XYZ->green_Y;
1444 if (0x7fffffff - Y < XYZ->blue_X) return 1;
1445 Y += XYZ->blue_Y;
1449 if (!png_muldiv(&XYZ->red_X, XYZ->red_X, PNG_FP_1, Y)) return 1;
1450 if (!png_muldiv(&XYZ->red_Y, XYZ->red_Y, PNG_FP_1, Y)) return 1;
1451 if (!png_muldiv(&XYZ->red_Z, XYZ->red_Z, PNG_FP_1, Y)) return 1;
1453 if (!png_muldiv(&XYZ->green_X, XYZ->green_X, PNG_FP_1, Y)) return 1;
1454 if (!png_muldiv(&XYZ->green_Y, XYZ->green_Y, PNG_FP_1, Y)) return 1;
1455 if (!png_muldiv(&XYZ->green_Z, XYZ->green_Z, PNG_FP_1, Y)) return 1;
1457 if (!png_muldiv(&XYZ->blue_X, XYZ->blue_X, PNG_FP_1, Y)) return 1;
1458 if (!png_muldiv(&XYZ->blue_Y, XYZ->blue_Y, PNG_FP_1, Y)) return 1;
1459 if (!png_muldiv(&XYZ->blue_Z, XYZ->blue_Z, PNG_FP_1, Y)) return 1;
1481 * condition (where the determinant of the matrix to solve for XYZ ends up zero
1486 * check is to round-trip xy -> XYZ -> xy and then check that the result is
1490 png_colorspace_check_xy(png_XYZ *XYZ, const png_xy *xy)
1495 /* As a side-effect this routine also returns the XYZ endpoints. */
1496 result = png_XYZ_from_xy(XYZ, xy);
1499 result = png_xy_from_XYZ(&xy_test, XYZ);
1510 /* This is the check going the other way. The XYZ is modified to normalize it
1514 png_colorspace_check_XYZ(png_xy *xy, png_XYZ *XYZ)
1519 result = png_XYZ_normalize(XYZ);
1522 result = png_xy_from_XYZ(xy, XYZ);
1525 XYZtemp = *XYZ;
1541 png_colorspacerp colorspace, const png_xy *xy, const png_XYZ *XYZ,
1569 colorspace->end_points_XYZ = *XYZ;
1595 png_XYZ XYZ;
1597 switch (png_colorspace_check_xy(&XYZ, xy))
1600 return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, xy, &XYZ,
1604 /* We can't invert the chromaticities so we can't produce value XYZ
1627 png_XYZ XYZ = *XYZ_in;
1630 switch (png_colorspace_check_XYZ(&xy, &XYZ))
1633 return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, &xy, &XYZ,
1747 * These XYZ values, which are accurate to 5dp, produce rgb to gray
1753 static const png_XYZ sRGB_XYZ = /* D65 XYZ (*not* the D50 adapted values!) */
1828 * is XYZ(0.9642,1.0,0.8249), which scales to:
1927 * data to XYZ or L*a*b (according to which PCS the profile uses) and this
2011 * either in XYZ or Lab.
2016 case 0x58595A20: /* 'XYZ ' */
2350 png_error(png_ptr, "internal error handling cHRM->XYZ");