Home | History | Annotate | Download | only in libpng16

Lines Matching refs:XYZ

1198 png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ)
1202 d = XYZ->red_X + XYZ->red_Y + XYZ->red_Z;
1203 if (png_muldiv(&xy->redx, XYZ->red_X, PNG_FP_1, d) == 0)
1205 if (png_muldiv(&xy->redy, XYZ->red_Y, PNG_FP_1, d) == 0)
1208 whiteX = XYZ->red_X;
1209 whiteY = XYZ->red_Y;
1211 d = XYZ->green_X + XYZ->green_Y + XYZ->green_Z;
1212 if (png_muldiv(&xy->greenx, XYZ->green_X, PNG_FP_1, d) == 0)
1214 if (png_muldiv(&xy->greeny, XYZ->green_Y, PNG_FP_1, d) == 0)
1217 whiteX += XYZ->green_X;
1218 whiteY += XYZ->green_Y;
1220 d = XYZ->blue_X + XYZ->blue_Y + XYZ->blue_Z;
1221 if (png_muldiv(&xy->bluex, XYZ->blue_X, PNG_FP_1, d) == 0)
1223 if (png_muldiv(&xy->bluey, XYZ->blue_Y, PNG_FP_1, d) == 0)
1226 whiteX += XYZ->blue_X;
1227 whiteY += XYZ->blue_Y;
1241 png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
1479 if (png_muldiv(&XYZ
1481 if (png_muldiv(&XYZ->red_Y, xy->redy, PNG_FP_1, red_inverse) == 0)
1483 if (png_muldiv(&XYZ->red_Z, PNG_FP_1 - xy->redx - xy->redy, PNG_FP_1,
1487 if (png_muldiv(&XYZ->green_X, xy->greenx, PNG_FP_1, green_inverse) == 0)
1489 if (png_muldiv(&XYZ->green_Y, xy->greeny, PNG_FP_1, green_inverse) == 0)
1491 if (png_muldiv(&XYZ->green_Z, PNG_FP_1 - xy->greenx - xy->greeny, PNG_FP_1,
1495 if (png_muldiv(&XYZ->blue_X, xy->bluex, blue_scale, PNG_FP_1) == 0)
1497 if (png_muldiv(&XYZ->blue_Y, xy->bluey, blue_scale, PNG_FP_1) == 0)
1499 if (png_muldiv(&XYZ->blue_Z, PNG_FP_1 - xy->bluex - xy->bluey, blue_scale,
1507 png_XYZ_normalize(png_XYZ *XYZ)
1511 if (XYZ->red_Y < 0 || XYZ->green_Y < 0 || XYZ->blue_Y < 0 ||
1512 XYZ->red_X < 0 || XYZ->green_X < 0 || XYZ->blue_X < 0 ||
1513 XYZ->red_Z < 0 || XYZ->green_Z < 0 || XYZ->blue_Z < 0)
1521 Y = XYZ->red_Y;
1522 if (0x7fffffff - Y < XYZ->green_X)
1524 Y += XYZ->green_Y;
1525 if (0x7fffffff - Y < XYZ->blue_X)
1527 Y += XYZ->blue_Y;
1531 if (png_muldiv(&XYZ->red_X, XYZ->red_X, PNG_FP_1, Y) == 0)
1533 if (png_muldiv(&XYZ->red_Y, XYZ->red_Y, PNG_FP_1, Y) == 0)
1535 if (png_muldiv(&XYZ->red_Z, XYZ->red_Z, PNG_FP_1, Y) == 0)
1538 if (png_muldiv(&XYZ->green_X, XYZ->green_X, PNG_FP_1, Y) == 0)
1540 if (png_muldiv(&XYZ->green_Y, XYZ->green_Y, PNG_FP_1, Y) == 0)
1542 if (png_muldiv(&XYZ->green_Z, XYZ->green_Z, PNG_FP_1, Y) == 0)
1545 if (png_muldiv(&XYZ->blue_X, XYZ->blue_X, PNG_FP_1, Y) == 0)
1547 if (png_muldiv(&XYZ->blue_Y, XYZ->blue_Y, PNG_FP_1, Y) == 0)
1549 if (png_muldiv(&XYZ->blue_Z, XYZ->blue_Z, PNG_FP_1, Y) == 0)
1574 * condition (where the determinant of the matrix to solve for XYZ ends up zero
1579 * check is to round-trip xy -> XYZ -> xy and then check that the result is
1583 png_colorspace_check_xy(png_XYZ *XYZ, const png_xy *xy)
1588 /* As a side-effect this routine also returns the XYZ endpoints. */
1589 result = png_XYZ_from_xy(XYZ, xy);
1593 result = png_xy_from_XYZ(&xy_test, XYZ);
1605 /* This is the check going the other way. The XYZ is modified to normalize it
1609 png_colorspace_check_XYZ(png_xy *xy, png_XYZ *XYZ)
1614 result = png_XYZ_normalize(XYZ);
1618 result = png_xy_from_XYZ(xy, XYZ);
1622 XYZtemp = *XYZ;
1638 png_colorspacerp colorspace, const png_xy *xy, const png_XYZ *XYZ,
1668 colorspace->end_points_XYZ = *XYZ;
1694 png_XYZ XYZ;
1696 switch (png_colorspace_check_xy(&XYZ, xy))
1699 return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, xy, &XYZ,
1703 /* We can't invert the chromaticities so we can't produce value XYZ
1725 png_XYZ XYZ = *XYZ_in;
1728 switch (png_colorspace_check_XYZ(&xy, &XYZ))
1731 return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, &xy, &XYZ,
1846 * These XYZ values, which are accurate to 5dp, produce rgb to gray
1852 static const png_XYZ sRGB_XYZ = /* D65 XYZ (*not* the D50 adapted values!) */
1927 * is XYZ(0.9642,1.0,0.8249), which scales to:
2027 * data to XYZ or L*a*b (according to which PCS the profile uses) and this
2111 * either in XYZ or Lab.
2116 case 0x58595a20: /* 'XYZ ' */
2461 png_error(png_ptr, "internal error handling cHRM->XYZ");