Lines Matching defs:XYZ

1196 png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ)
1200 d = XYZ->red_X + XYZ->red_Y + XYZ->red_Z;
1201 if (!png_muldiv(&xy->redx, XYZ->red_X, PNG_FP_1, d)) return 1;
1202 if (!png_muldiv(&xy->redy, XYZ->red_Y, PNG_FP_1, d)) return 1;
1204 whiteX = XYZ->red_X;
1205 whiteY = XYZ->red_Y;
1207 d = XYZ->green_X + XYZ->green_Y + XYZ->green_Z;
1208 if (!png_muldiv(&xy->greenx, XYZ->green_X, PNG_FP_1, d)) return 1;
1209 if (!png_muldiv(&xy->greeny, XYZ->green_Y, PNG_FP_1, d)) return 1;
1211 whiteX += XYZ->green_X;
1212 whiteY += XYZ->green_Y;
1214 d = XYZ->blue_X + XYZ->blue_Y + XYZ->blue_Z;
1215 if (!png_muldiv(&xy->bluex, XYZ->blue_X, PNG_FP_1, d)) return 1;
1216 if (!png_muldiv(&xy->bluey, XYZ->blue_Y, PNG_FP_1, d)) return 1;
1218 whiteX += XYZ->blue_X;
1219 whiteY += XYZ->blue_Y;
1231 png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
1468 if (!png_muldiv(&XYZ->red_X, xy->redx, PNG_FP_1, red_inverse)) return 1;
1469 if (!png_muldiv(&XYZ->red_Y, xy->redy, PNG_FP_1, red_inverse)) return 1;
1470 if (!png_muldiv(&XYZ->red_Z, PNG_FP_1 - xy->redx - xy->redy, PNG_FP_1,
1474 if (!png_muldiv(&XYZ->green_X, xy->greenx, PNG_FP_1, green_inverse))
1476 if (!png_muldiv(&XYZ->green_Y, xy->greeny, PNG_FP_1, green_inverse))
1478 if (!png_muldiv(&XYZ->green_Z, PNG_FP_1 - xy->greenx - xy->greeny, PNG_FP_1,
1482 if (!png_muldiv(&XYZ->blue_X, xy->bluex, blue_scale, PNG_FP_1)) return 1;
1483 if (!png_muldiv(&XYZ->blue_Y, xy->bluey, blue_scale, PNG_FP_1)) return 1;
1484 if (!png_muldiv(&XYZ->blue_Z, PNG_FP_1 - xy->bluex - xy->bluey, blue_scale,
1492 png_XYZ_normalize(png_XYZ *XYZ)
1496 if (XYZ->red_Y < 0 || XYZ->green_Y < 0 || XYZ->blue_Y < 0 ||
1497 XYZ->red_X < 0 || XYZ->green_X < 0 || XYZ->blue_X < 0 ||
1498 XYZ->red_Z < 0 || XYZ->green_Z < 0 || XYZ->blue_Z < 0)
1506 Y = XYZ->red_Y;
1507 if (0x7fffffff - Y < XYZ->green_X) return 1;
1508 Y += XYZ->green_Y;
1509 if (0x7fffffff - Y < XYZ->blue_X) return 1;
1510 Y += XYZ->blue_Y;
1514 if (!png_muldiv(&XYZ->red_X, XYZ->red_X, PNG_FP_1, Y)) return 1;
1515 if (!png_muldiv(&XYZ->red_Y, XYZ->red_Y, PNG_FP_1, Y)) return 1;
1516 if (!png_muldiv(&XYZ->red_Z, XYZ->red_Z, PNG_FP_1, Y)) return 1;
1518 if (!png_muldiv(&XYZ->green_X, XYZ->green_X, PNG_FP_1, Y)) return 1;
1519 if (!png_muldiv(&XYZ->green_Y, XYZ->green_Y, PNG_FP_1, Y)) return 1;
1520 if (!png_muldiv(&XYZ->green_Z, XYZ->green_Z, PNG_FP_1, Y)) return 1;
1522 if (!png_muldiv(&XYZ->blue_X, XYZ->blue_X, PNG_FP_1, Y)) return 1;
1523 if (!png_muldiv(&XYZ->blue_Y, XYZ->blue_Y, PNG_FP_1, Y)) return 1;
1524 if (!png_muldiv(&XYZ->blue_Z, XYZ->blue_Z, PNG_FP_1, Y)) return 1;
1546 * condition (where the determinant of the matrix to solve for XYZ ends up zero
1551 * check is to round-trip xy -> XYZ -> xy and then check that the result is
1555 png_colorspace_check_xy(png_XYZ *XYZ, const png_xy *xy)
1560 /* As a side-effect this routine also returns the XYZ endpoints. */
1561 result = png_XYZ_from_xy(XYZ, xy);
1564 result = png_xy_from_XYZ(&xy_test, XYZ);
1575 /* This is the check going the other way. The XYZ is modified to normalize it
1579 png_colorspace_check_XYZ(png_xy *xy, png_XYZ *XYZ)
1584 result = png_XYZ_normalize(XYZ);
1587 result = png_xy_from_XYZ(xy, XYZ);
1590 XYZtemp = *XYZ;
1606 png_colorspacerp colorspace, const png_xy *xy, const png_XYZ *XYZ,
1634 colorspace->end_points_XYZ = *XYZ;
1660 png_XYZ XYZ;
1662 switch (png_colorspace_check_xy(&XYZ, xy))
1665 return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, xy, &XYZ,
1669 /* We can't invert the chromaticities so we can't produce value XYZ
1692 png_XYZ XYZ = *XYZ_in;
1695 switch (png_colorspace_check_XYZ(&xy, &XYZ))
1698 return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, &xy, &XYZ,
1814 * These XYZ values, which are accurate to 5dp, produce rgb to gray
1820 static const png_XYZ sRGB_XYZ = /* D65 XYZ (*not* the D50 adapted values!) */
1895 * is XYZ(0.9642,1.0,0.8249), which scales to:
1994 * data to XYZ or L*a*b (according to which PCS the profile uses) and this
2078 * either in XYZ or Lab.
2083 case 0x58595A20: /* 'XYZ ' */
2418 png_error(png_ptr, "internal error handling cHRM->XYZ");