Lines Matching refs:primaries
60 * properties of RGB color models: color gamut primaries, transfer functions,
222 * shows the location of the color space's primaries and white point.</p>
983 * Its primaries are within 1e-3 of the true
984 * {@link Named#SRGB sRGB} primaries.
1288 * @return A {@link ColorSpace} instance with the same name, primaries,
1911 * <li>Three chromaticities of the red, green and blue primaries, which
1925 * <p>In this implementation, the chromaticity of the primaries and the white
1928 * and its luminance, the Y component. Since the primaries and the white
1932 * primaries and white point in the CIE XYZ space. The tristimulus XYZ values
1937 * <figcaption style="text-align: center;">sRGB primaries and white point</figcaption>
2239 * <p>Creates a new RGB color space using a specified set of primaries
2242 * <p>The primaries and white point can be specified in the CIE xyY space
2251 * <p>When the primaries and/or white point are specified in xyY, the Y component
2259 * @param primaries RGB primaries as an array of 6 (xy) or 9 (XYZ) floats
2269 * <li>The primaries array is null or has a length that is neither 6 or 9.</li>
2279 @NonNull @Size(min = 6, max = 9) float[] primaries,
2285 this(name, primaries, whitePoint, oetf, eotf, min, max, MIN_ID);
2316 * <p>Creates a new RGB color space using a specified set of primaries
2319 * <p>The primaries and white point can be specified in the CIE xyY space
2328 * <p>When the primaries and/or white point are specified in xyY, the Y component
2333 * @param primaries RGB primaries as an array of 6 (xy) or 9 (XYZ) floats
2340 * <li>The primaries array is null or has a length that is neither 6 or 9.</li>
2349 @NonNull @Size(min = 6, max = 9) float[] primaries,
2352 this(name, primaries, whitePoint, function, MIN_ID);
2356 * <p>Creates a new RGB color space using a specified set of primaries
2359 * <p>The primaries and white point can be specified in the CIE xyY space
2368 * <p>When the primaries and/or white point are specified in xyY, the Y component
2373 * @param primaries RGB primaries as an array of 6 (xy) or 9 (XYZ) floats
2381 * <li>The primaries array is null or has a length that is neither 6 or 9.</li>
2391 @NonNull @Size(min = 6, max = 9) float[] primaries,
2395 this(name, primaries, whitePoint,
2438 * <p>Creates a new RGB color space using a specified set of primaries
2441 * <p>The primaries and white point can be specified in the CIE xyY space
2450 * <p>When the primaries and/or white point are specified in xyY, the Y component
2455 * @param primaries RGB primaries as an array of 6 (xy) or 9 (XYZ) floats
2462 * <li>The primaries array is null or has a length that is neither 6 or 9.</li>
2471 @NonNull @Size(min = 6, max = 9) float[] primaries,
2474 this(name, primaries, whitePoint, gamma, 0.0f, 1.0f, MIN_ID);
2478 * <p>Creates a new RGB color space using a specified set of primaries
2481 * <p>The primaries and white point can be specified in the CIE xyY space
2490 * <p>When the primaries and/or white point are specified in xyY, the Y component
2495 * @param primaries RGB primaries as an array of 6 (xy) or 9 (XYZ) floats
2505 * <li>The primaries array is null or has a length that is neither 6 or 9.</li>
2516 @NonNull @Size(min = 6, max = 9) float[] primaries,
2522 this(name, primaries, whitePoint,
2534 * <p>Creates a new RGB color space using a specified set of primaries
2537 * <p>The primaries and white point can be specified in the CIE xyY space
2546 * <p>When the primaries and/or white point are specified in xyY, the Y component
2551 * @param primaries RGB primaries as an array of 6 (xy) or 9 (XYZ) floats
2562 * <li>The primaries array is null or has a length that is neither 6 or 9.</li>
2573 @NonNull @Size(min = 6, max = 9) float[] primaries,
2583 if (primaries == null || (primaries.length != 6 && primaries.length != 9)) {
2584 throw new IllegalArgumentException("The color space's primaries must be " +
2604 mPrimaries = xyPrimaries(primaries);
2694 * Copies the primaries of this color space in specified array. The Y
2699 * @param primaries The destination array, cannot be null, its length
2708 public float[] getPrimaries(@NonNull @Size(min = 6) float[] primaries) {
2709 System.arraycopy(mPrimaries, 0, primaries, 0, mPrimaries.length);
2710 return primaries;
2714 * Returns the primaries of this color space as a new array of 6 floats.
3065 * @param primaries The set of RGB primaries in xyY as an array of 6 floats
3078 @NonNull @Size(6) float[] primaries,
3086 if (!compare(primaries, SRGB_PRIMARIES)) {
3100 * Computes whether the specified CIE xyY or XYZ primaries (with Y set to 1) form
3106 * @param primaries RGB primaries in CIE xyY as an array of 6 floats
3114 private static boolean isWideGamut(@NonNull @Size(6) float[] primaries,
3116 return (area(primaries) / area(NTSC_1953_PRIMARIES) > 0.9f &&
3117 contains(primaries, SRGB_PRIMARIES)) || (min < 0.0f && max > 1.0f);
3121 * Computes the area of the triangle represented by a set of RGB primaries
3124 * @param primaries The triangle's vertices, as RGB primaries in an array of 6 floats
3129 private static float area(@NonNull @Size(6) float[] primaries) {
3130 float Rx = primaries[0];
3131 float Ry = primaries[1];
3132 float Gx = primaries[2];
3133 float Gy = primaries[3];
3134 float Bx = primaries[4];
3135 float By = primaries[5];
3241 * Computes the primaries of a color space identified only by
3247 * primaries in CIE xyY
3285 * Converts the specified RGB primaries point to xyY if needed. The primaries
3289 * @param primaries The primaries in xyY or XYZ
3290 * @return A new array of 6 floats containing the primaries in xyY
3294 private static float[] xyPrimaries(@NonNull @Size(min = 6, max = 9) float[] primaries) {
3298 if (primaries.length == 9) {
3301 sum = primaries[0] + primaries[1] + primaries[2];
3302 xyPrimaries[0] = primaries[0] / sum;
3303 xyPrimaries[1] = primaries[1] / sum;
3305 sum = primaries[3] + primaries[4] + primaries[5];
3306 xyPrimaries[2] = primaries[3] / sum;
3307 xyPrimaries[3] = primaries[4] / sum;
3309 sum = primaries[6] + primaries[7] + primaries[8];
3310 xyPrimaries[4] = primaries[6] / sum;
3311 xyPrimaries[5] = primaries[7] / sum;
3313 System.arraycopy(primaries, 0, xyPrimaries, 0, 6);
3346 * primaries and a white point, both specified in the CIE xyY space.
3347 * The Y component of the primaries and white point is implied to be 1.
3349 * @param primaries The RGB primaries in xyY, as an array of 6 floats
3356 @NonNull @Size(6) float[] primaries,
3358 float Rx = primaries[0];
3359 float Ry = primaries[1];
3360 float Gx = primaries[2];
3361 float Gy = primaries[3];
3362 float Bx = primaries[4];
3363 float By = primaries[5];
3947 float[] primaries = new float[6];
3955 setTransform(canvas, width, height, primaries);
3958 drawLocus(canvas, width, height, paint, path, primaries);
3959 drawGamuts(canvas, width, height, paint, path, primaries, whitePoint);
4012 * @param primaries A pre-allocated array of 6 floats to avoid temporary allocations
4018 @NonNull @Size(6) float[] primaries, @NonNull @Size(2) float[] whitePoint) {
4029 getPrimaries(rgb, primaries, mUcs);
4032 path.moveTo(width * primaries[0], height - height * primaries[1]);
4033 path.lineTo(width * primaries[2], height - height * primaries[3]);
4034 path.lineTo(width * primaries[4], height - height * primaries[5]);
4055 * Returns the primaries of the specified RGB color space. This method handles
4058 * @param rgb The color space whose primaries to extract
4059 * @param primaries A pre-allocated array of 6 floats that will hold the result
4060 * @param asUcs True if the primaries should be returned in Luv, false for xyY
4065 @NonNull @Size(6) float[] primaries, boolean asUcs) {
4069 primaries[0] = 1.41f;
4070 primaries[1] = 0.33f;
4071 primaries[2] = 0.27f;
4072 primaries[3] = 1.24f;
4073 primaries[4] = -0.23f;
4074 primaries[5] = -0.57f;
4076 rgb.getPrimaries(primaries);
4078 if (asUcs) xyYToUv(primaries);
4090 * @param primaries A pre-allocated array of 6 floats to avoid temporary allocations
4094 @NonNull Path path, @NonNull @Size(6) float[] primaries) {
4114 getPrimaries(rgb, primaries, mUcs);
4120 path.moveTo(width * primaries[0], height - height * primaries[1]);
4121 path.lineTo(width * primaries[2], height - height * primaries[3]);
4122 path.lineTo(width * primaries[4], height - height * primaries[5]);
4240 * @param primaries Array of 6 floats used to avoid temporary allocations
4243 @NonNull @Size(6) float[] primaries) {
4251 getPrimaries(rgb, primaries, mUcs);
4253 primariesBounds.left = Math.min(primariesBounds.left, primaries[4]);
4254 primariesBounds.top = Math.min(primariesBounds.top, primaries[5]);
4255 primariesBounds.right = Math.max(primariesBounds.right, primaries[0]);
4256 primariesBounds.bottom = Math.max(primariesBounds.bottom, primaries[3]);