java.awt.color.ColorSpace#getMaxValue ( )源码实例Demo

下面列出了java.awt.color.ColorSpace#getMaxValue ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openjdk-8   文件: DataConversionTests.java
public Context(TestEnvironment env, Result result, ColorSpace cs) {
    this.cs = cs;
    this.env = env;
    this.res = result;

    numComponents = cs.getNumComponents();

    val = new float[numComponents];

    for (int i = 0; i < numComponents; i++) {
        float min = cs.getMinValue(i);
        float max = cs.getMaxValue(i);

        val[i] = 0.5f * (max - min);
    }

    rgb = new float[]{0.5f, 0.5f, 0.5f};
    cie = new float[]{0.5f, 0.5f, 0.5f};
}
 
源代码2 项目: jdk8u_jdk   文件: DataConversionTests.java
public Context(TestEnvironment env, Result result, ColorSpace cs) {
    this.cs = cs;
    this.env = env;
    this.res = result;

    numComponents = cs.getNumComponents();

    val = new float[numComponents];

    for (int i = 0; i < numComponents; i++) {
        float min = cs.getMinValue(i);
        float max = cs.getMaxValue(i);

        val[i] = 0.5f * (max - min);
    }

    rgb = new float[]{0.5f, 0.5f, 0.5f};
    cie = new float[]{0.5f, 0.5f, 0.5f};
}
 
源代码3 项目: jdk8u-jdk   文件: DataConversionTests.java
public Context(TestEnvironment env, Result result, ColorSpace cs) {
    this.cs = cs;
    this.env = env;
    this.res = result;

    numComponents = cs.getNumComponents();

    val = new float[numComponents];

    for (int i = 0; i < numComponents; i++) {
        float min = cs.getMinValue(i);
        float max = cs.getMaxValue(i);

        val[i] = 0.5f * (max - min);
    }

    rgb = new float[]{0.5f, 0.5f, 0.5f};
    cie = new float[]{0.5f, 0.5f, 0.5f};
}
 
源代码4 项目: jdk8u60   文件: DataConversionTests.java
public Context(TestEnvironment env, Result result, ColorSpace cs) {
    this.cs = cs;
    this.env = env;
    this.res = result;

    numComponents = cs.getNumComponents();

    val = new float[numComponents];

    for (int i = 0; i < numComponents; i++) {
        float min = cs.getMinValue(i);
        float max = cs.getMaxValue(i);

        val[i] = 0.5f * (max - min);
    }

    rgb = new float[]{0.5f, 0.5f, 0.5f};
    cie = new float[]{0.5f, 0.5f, 0.5f};
}
 
源代码5 项目: openjdk-jdk8u   文件: DataConversionTests.java
public Context(TestEnvironment env, Result result, ColorSpace cs) {
    this.cs = cs;
    this.env = env;
    this.res = result;

    numComponents = cs.getNumComponents();

    val = new float[numComponents];

    for (int i = 0; i < numComponents; i++) {
        float min = cs.getMinValue(i);
        float max = cs.getMaxValue(i);

        val[i] = 0.5f * (max - min);
    }

    rgb = new float[]{0.5f, 0.5f, 0.5f};
    cie = new float[]{0.5f, 0.5f, 0.5f};
}
 
源代码6 项目: openjdk-8-source   文件: DataConversionTests.java
public Context(TestEnvironment env, Result result, ColorSpace cs) {
    this.cs = cs;
    this.env = env;
    this.res = result;

    numComponents = cs.getNumComponents();

    val = new float[numComponents];

    for (int i = 0; i < numComponents; i++) {
        float min = cs.getMinValue(i);
        float max = cs.getMaxValue(i);

        val[i] = 0.5f * (max - min);
    }

    rgb = new float[]{0.5f, 0.5f, 0.5f};
    cie = new float[]{0.5f, 0.5f, 0.5f};
}
 
public Context(TestEnvironment env, Result result, ColorSpace cs) {
    this.cs = cs;
    this.env = env;
    this.res = result;

    numComponents = cs.getNumComponents();

    val = new float[numComponents];

    for (int i = 0; i < numComponents; i++) {
        float min = cs.getMinValue(i);
        float max = cs.getMaxValue(i);

        val[i] = 0.5f * (max - min);
    }

    rgb = new float[]{0.5f, 0.5f, 0.5f};
    cie = new float[]{0.5f, 0.5f, 0.5f};
}
 
源代码8 项目: openjdk-jdk9   文件: DataConversionTests.java
public Context(TestEnvironment env, Result result, ColorSpace cs) {
    this.cs = cs;
    this.env = env;
    this.res = result;

    numComponents = cs.getNumComponents();

    val = new float[numComponents];

    for (int i = 0; i < numComponents; i++) {
        float min = cs.getMinValue(i);
        float max = cs.getMaxValue(i);

        val[i] = 0.5f * (max - min);
    }

    rgb = new float[]{0.5f, 0.5f, 0.5f};
    cie = new float[]{0.5f, 0.5f, 0.5f};
}
 
源代码9 项目: jdk8u-jdk   文件: DataConversionTests.java
public Context(TestEnvironment env, Result result, ColorSpace cs) {
    this.cs = cs;
    this.env = env;
    this.res = result;

    numComponents = cs.getNumComponents();

    val = new float[numComponents];

    for (int i = 0; i < numComponents; i++) {
        float min = cs.getMinValue(i);
        float max = cs.getMaxValue(i);

        val[i] = 0.5f * (max - min);
    }

    rgb = new float[]{0.5f, 0.5f, 0.5f};
    cie = new float[]{0.5f, 0.5f, 0.5f};
}
 
源代码10 项目: hottub   文件: DataConversionTests.java
public Context(TestEnvironment env, Result result, ColorSpace cs) {
    this.cs = cs;
    this.env = env;
    this.res = result;

    numComponents = cs.getNumComponents();

    val = new float[numComponents];

    for (int i = 0; i < numComponents; i++) {
        float min = cs.getMinValue(i);
        float max = cs.getMaxValue(i);

        val[i] = 0.5f * (max - min);
    }

    rgb = new float[]{0.5f, 0.5f, 0.5f};
    cie = new float[]{0.5f, 0.5f, 0.5f};
}
 
源代码11 项目: jdk8u-jdk   文件: DirectColorModel.java
/**
 * Constructs a <code>DirectColorModel</code> from the specified
 * parameters.  Color components are in the specified
 * <code>ColorSpace</code>, which must be of type ColorSpace.TYPE_RGB
 * and have minimum normalized component values which are all 0.0
 * and maximum values which are all 1.0.
 * The masks specify which bits in an <code>int</code> pixel
 * representation contain the red, green and blue color samples and
 * the alpha sample, if present.  If <code>amask</code> is 0, pixel
 * values do not contain alpha information and all pixels are treated
 * as opaque, which means that alpha&nbsp;=&nbsp;1.0.  All of the
 * bits in each mask must be contiguous and fit in the specified number
 * of least significant bits of an <code>int</code> pixel
 * representation.  If there is alpha, the <code>boolean</code>
 * <code>isAlphaPremultiplied</code> specifies how to interpret
 * color and alpha samples in pixel values.  If the <code>boolean</code>
 * is <code>true</code>, color samples are assumed to have been
 * multiplied by the alpha sample.  The transparency value is
 * Transparency.OPAQUE, if no alpha is present, or
 * Transparency.TRANSLUCENT otherwise.  The transfer type
 * is the type of primitive array used to represent pixel values and
 * must be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or
 * DataBuffer.TYPE_INT.
 * @param space the specified <code>ColorSpace</code>
 * @param bits the number of bits in the pixel values; for example,
 *         the sum of the number of bits in the masks.
 * @param rmask specifies a mask indicating which bits in an
 *         integer pixel contain the red component
 * @param gmask specifies a mask indicating which bits in an
 *         integer pixel contain the green component
 * @param bmask specifies a mask indicating which bits in an
 *         integer pixel contain the blue component
 * @param amask specifies a mask indicating which bits in an
 *         integer pixel contain the alpha component
 * @param isAlphaPremultiplied <code>true</code> if color samples are
 *        premultiplied by the alpha sample; <code>false</code> otherwise
 * @param transferType the type of array used to represent pixel values
 * @throws IllegalArgumentException if <code>space</code> is not a
 *         TYPE_RGB space or if the min/max normalized component
 *         values are not 0.0/1.0.
 */
public DirectColorModel(ColorSpace space, int bits, int rmask,
                        int gmask, int bmask, int amask,
                        boolean isAlphaPremultiplied,
                        int transferType) {
    super (space, bits, rmask, gmask, bmask, amask,
           isAlphaPremultiplied,
           amask == 0 ? Transparency.OPAQUE : Transparency.TRANSLUCENT,
           transferType);
    if (ColorModel.isLinearRGBspace(colorSpace)) {
        is_LinearRGB = true;
        if (maxBits <= 8) {
            lRGBprecision = 8;
            tosRGB8LUT = ColorModel.getLinearRGB8TosRGB8LUT();
            fromsRGB8LUT8 = ColorModel.getsRGB8ToLinearRGB8LUT();
        } else {
            lRGBprecision = 16;
            tosRGB8LUT = ColorModel.getLinearRGB16TosRGB8LUT();
            fromsRGB8LUT16 = ColorModel.getsRGB8ToLinearRGB16LUT();
        }
    } else if (!is_sRGB) {
        for (int i = 0; i < 3; i++) {
            // super constructor checks that space is TYPE_RGB
            // check here that min/max are all 0.0/1.0
            if ((space.getMinValue(i) != 0.0f) ||
                (space.getMaxValue(i) != 1.0f)) {
                throw new IllegalArgumentException(
                    "Illegal min/max RGB component value");
            }
        }
    }
    setFields();
}
 
源代码12 项目: TencentKona-8   文件: DirectColorModel.java
/**
 * Constructs a <code>DirectColorModel</code> from the specified
 * parameters.  Color components are in the specified
 * <code>ColorSpace</code>, which must be of type ColorSpace.TYPE_RGB
 * and have minimum normalized component values which are all 0.0
 * and maximum values which are all 1.0.
 * The masks specify which bits in an <code>int</code> pixel
 * representation contain the red, green and blue color samples and
 * the alpha sample, if present.  If <code>amask</code> is 0, pixel
 * values do not contain alpha information and all pixels are treated
 * as opaque, which means that alpha&nbsp;=&nbsp;1.0.  All of the
 * bits in each mask must be contiguous and fit in the specified number
 * of least significant bits of an <code>int</code> pixel
 * representation.  If there is alpha, the <code>boolean</code>
 * <code>isAlphaPremultiplied</code> specifies how to interpret
 * color and alpha samples in pixel values.  If the <code>boolean</code>
 * is <code>true</code>, color samples are assumed to have been
 * multiplied by the alpha sample.  The transparency value is
 * Transparency.OPAQUE, if no alpha is present, or
 * Transparency.TRANSLUCENT otherwise.  The transfer type
 * is the type of primitive array used to represent pixel values and
 * must be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or
 * DataBuffer.TYPE_INT.
 * @param space the specified <code>ColorSpace</code>
 * @param bits the number of bits in the pixel values; for example,
 *         the sum of the number of bits in the masks.
 * @param rmask specifies a mask indicating which bits in an
 *         integer pixel contain the red component
 * @param gmask specifies a mask indicating which bits in an
 *         integer pixel contain the green component
 * @param bmask specifies a mask indicating which bits in an
 *         integer pixel contain the blue component
 * @param amask specifies a mask indicating which bits in an
 *         integer pixel contain the alpha component
 * @param isAlphaPremultiplied <code>true</code> if color samples are
 *        premultiplied by the alpha sample; <code>false</code> otherwise
 * @param transferType the type of array used to represent pixel values
 * @throws IllegalArgumentException if <code>space</code> is not a
 *         TYPE_RGB space or if the min/max normalized component
 *         values are not 0.0/1.0.
 */
public DirectColorModel(ColorSpace space, int bits, int rmask,
                        int gmask, int bmask, int amask,
                        boolean isAlphaPremultiplied,
                        int transferType) {
    super (space, bits, rmask, gmask, bmask, amask,
           isAlphaPremultiplied,
           amask == 0 ? Transparency.OPAQUE : Transparency.TRANSLUCENT,
           transferType);
    if (ColorModel.isLinearRGBspace(colorSpace)) {
        is_LinearRGB = true;
        if (maxBits <= 8) {
            lRGBprecision = 8;
            tosRGB8LUT = ColorModel.getLinearRGB8TosRGB8LUT();
            fromsRGB8LUT8 = ColorModel.getsRGB8ToLinearRGB8LUT();
        } else {
            lRGBprecision = 16;
            tosRGB8LUT = ColorModel.getLinearRGB16TosRGB8LUT();
            fromsRGB8LUT16 = ColorModel.getsRGB8ToLinearRGB16LUT();
        }
    } else if (!is_sRGB) {
        for (int i = 0; i < 3; i++) {
            // super constructor checks that space is TYPE_RGB
            // check here that min/max are all 0.0/1.0
            if ((space.getMinValue(i) != 0.0f) ||
                (space.getMaxValue(i) != 1.0f)) {
                throw new IllegalArgumentException(
                    "Illegal min/max RGB component value");
            }
        }
    }
    setFields();
}
 
源代码13 项目: jdk8u_jdk   文件: DirectColorModel.java
/**
 * Constructs a <code>DirectColorModel</code> from the specified
 * parameters.  Color components are in the specified
 * <code>ColorSpace</code>, which must be of type ColorSpace.TYPE_RGB
 * and have minimum normalized component values which are all 0.0
 * and maximum values which are all 1.0.
 * The masks specify which bits in an <code>int</code> pixel
 * representation contain the red, green and blue color samples and
 * the alpha sample, if present.  If <code>amask</code> is 0, pixel
 * values do not contain alpha information and all pixels are treated
 * as opaque, which means that alpha&nbsp;=&nbsp;1.0.  All of the
 * bits in each mask must be contiguous and fit in the specified number
 * of least significant bits of an <code>int</code> pixel
 * representation.  If there is alpha, the <code>boolean</code>
 * <code>isAlphaPremultiplied</code> specifies how to interpret
 * color and alpha samples in pixel values.  If the <code>boolean</code>
 * is <code>true</code>, color samples are assumed to have been
 * multiplied by the alpha sample.  The transparency value is
 * Transparency.OPAQUE, if no alpha is present, or
 * Transparency.TRANSLUCENT otherwise.  The transfer type
 * is the type of primitive array used to represent pixel values and
 * must be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or
 * DataBuffer.TYPE_INT.
 * @param space the specified <code>ColorSpace</code>
 * @param bits the number of bits in the pixel values; for example,
 *         the sum of the number of bits in the masks.
 * @param rmask specifies a mask indicating which bits in an
 *         integer pixel contain the red component
 * @param gmask specifies a mask indicating which bits in an
 *         integer pixel contain the green component
 * @param bmask specifies a mask indicating which bits in an
 *         integer pixel contain the blue component
 * @param amask specifies a mask indicating which bits in an
 *         integer pixel contain the alpha component
 * @param isAlphaPremultiplied <code>true</code> if color samples are
 *        premultiplied by the alpha sample; <code>false</code> otherwise
 * @param transferType the type of array used to represent pixel values
 * @throws IllegalArgumentException if <code>space</code> is not a
 *         TYPE_RGB space or if the min/max normalized component
 *         values are not 0.0/1.0.
 */
public DirectColorModel(ColorSpace space, int bits, int rmask,
                        int gmask, int bmask, int amask,
                        boolean isAlphaPremultiplied,
                        int transferType) {
    super (space, bits, rmask, gmask, bmask, amask,
           isAlphaPremultiplied,
           amask == 0 ? Transparency.OPAQUE : Transparency.TRANSLUCENT,
           transferType);
    if (ColorModel.isLinearRGBspace(colorSpace)) {
        is_LinearRGB = true;
        if (maxBits <= 8) {
            lRGBprecision = 8;
            tosRGB8LUT = ColorModel.getLinearRGB8TosRGB8LUT();
            fromsRGB8LUT8 = ColorModel.getsRGB8ToLinearRGB8LUT();
        } else {
            lRGBprecision = 16;
            tosRGB8LUT = ColorModel.getLinearRGB16TosRGB8LUT();
            fromsRGB8LUT16 = ColorModel.getsRGB8ToLinearRGB16LUT();
        }
    } else if (!is_sRGB) {
        for (int i = 0; i < 3; i++) {
            // super constructor checks that space is TYPE_RGB
            // check here that min/max are all 0.0/1.0
            if ((space.getMinValue(i) != 0.0f) ||
                (space.getMaxValue(i) != 1.0f)) {
                throw new IllegalArgumentException(
                    "Illegal min/max RGB component value");
            }
        }
    }
    setFields();
}
 
源代码14 项目: JDKSourceCode1.8   文件: DirectColorModel.java
/**
 * Constructs a <code>DirectColorModel</code> from the specified
 * parameters.  Color components are in the specified
 * <code>ColorSpace</code>, which must be of type ColorSpace.TYPE_RGB
 * and have minimum normalized component values which are all 0.0
 * and maximum values which are all 1.0.
 * The masks specify which bits in an <code>int</code> pixel
 * representation contain the red, green and blue color samples and
 * the alpha sample, if present.  If <code>amask</code> is 0, pixel
 * values do not contain alpha information and all pixels are treated
 * as opaque, which means that alpha&nbsp;=&nbsp;1.0.  All of the
 * bits in each mask must be contiguous and fit in the specified number
 * of least significant bits of an <code>int</code> pixel
 * representation.  If there is alpha, the <code>boolean</code>
 * <code>isAlphaPremultiplied</code> specifies how to interpret
 * color and alpha samples in pixel values.  If the <code>boolean</code>
 * is <code>true</code>, color samples are assumed to have been
 * multiplied by the alpha sample.  The transparency value is
 * Transparency.OPAQUE, if no alpha is present, or
 * Transparency.TRANSLUCENT otherwise.  The transfer type
 * is the type of primitive array used to represent pixel values and
 * must be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or
 * DataBuffer.TYPE_INT.
 * @param space the specified <code>ColorSpace</code>
 * @param bits the number of bits in the pixel values; for example,
 *         the sum of the number of bits in the masks.
 * @param rmask specifies a mask indicating which bits in an
 *         integer pixel contain the red component
 * @param gmask specifies a mask indicating which bits in an
 *         integer pixel contain the green component
 * @param bmask specifies a mask indicating which bits in an
 *         integer pixel contain the blue component
 * @param amask specifies a mask indicating which bits in an
 *         integer pixel contain the alpha component
 * @param isAlphaPremultiplied <code>true</code> if color samples are
 *        premultiplied by the alpha sample; <code>false</code> otherwise
 * @param transferType the type of array used to represent pixel values
 * @throws IllegalArgumentException if <code>space</code> is not a
 *         TYPE_RGB space or if the min/max normalized component
 *         values are not 0.0/1.0.
 */
public DirectColorModel(ColorSpace space, int bits, int rmask,
                        int gmask, int bmask, int amask,
                        boolean isAlphaPremultiplied,
                        int transferType) {
    super (space, bits, rmask, gmask, bmask, amask,
           isAlphaPremultiplied,
           amask == 0 ? Transparency.OPAQUE : Transparency.TRANSLUCENT,
           transferType);
    if (ColorModel.isLinearRGBspace(colorSpace)) {
        is_LinearRGB = true;
        if (maxBits <= 8) {
            lRGBprecision = 8;
            tosRGB8LUT = ColorModel.getLinearRGB8TosRGB8LUT();
            fromsRGB8LUT8 = ColorModel.getsRGB8ToLinearRGB8LUT();
        } else {
            lRGBprecision = 16;
            tosRGB8LUT = ColorModel.getLinearRGB16TosRGB8LUT();
            fromsRGB8LUT16 = ColorModel.getsRGB8ToLinearRGB16LUT();
        }
    } else if (!is_sRGB) {
        for (int i = 0; i < 3; i++) {
            // super constructor checks that space is TYPE_RGB
            // check here that min/max are all 0.0/1.0
            if ((space.getMinValue(i) != 0.0f) ||
                (space.getMaxValue(i) != 1.0f)) {
                throw new IllegalArgumentException(
                    "Illegal min/max RGB component value");
            }
        }
    }
    setFields();
}
 
源代码15 项目: openjdk-jdk8u-backup   文件: DirectColorModel.java
/**
 * Constructs a <code>DirectColorModel</code> from the specified
 * parameters.  Color components are in the specified
 * <code>ColorSpace</code>, which must be of type ColorSpace.TYPE_RGB
 * and have minimum normalized component values which are all 0.0
 * and maximum values which are all 1.0.
 * The masks specify which bits in an <code>int</code> pixel
 * representation contain the red, green and blue color samples and
 * the alpha sample, if present.  If <code>amask</code> is 0, pixel
 * values do not contain alpha information and all pixels are treated
 * as opaque, which means that alpha&nbsp;=&nbsp;1.0.  All of the
 * bits in each mask must be contiguous and fit in the specified number
 * of least significant bits of an <code>int</code> pixel
 * representation.  If there is alpha, the <code>boolean</code>
 * <code>isAlphaPremultiplied</code> specifies how to interpret
 * color and alpha samples in pixel values.  If the <code>boolean</code>
 * is <code>true</code>, color samples are assumed to have been
 * multiplied by the alpha sample.  The transparency value is
 * Transparency.OPAQUE, if no alpha is present, or
 * Transparency.TRANSLUCENT otherwise.  The transfer type
 * is the type of primitive array used to represent pixel values and
 * must be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or
 * DataBuffer.TYPE_INT.
 * @param space the specified <code>ColorSpace</code>
 * @param bits the number of bits in the pixel values; for example,
 *         the sum of the number of bits in the masks.
 * @param rmask specifies a mask indicating which bits in an
 *         integer pixel contain the red component
 * @param gmask specifies a mask indicating which bits in an
 *         integer pixel contain the green component
 * @param bmask specifies a mask indicating which bits in an
 *         integer pixel contain the blue component
 * @param amask specifies a mask indicating which bits in an
 *         integer pixel contain the alpha component
 * @param isAlphaPremultiplied <code>true</code> if color samples are
 *        premultiplied by the alpha sample; <code>false</code> otherwise
 * @param transferType the type of array used to represent pixel values
 * @throws IllegalArgumentException if <code>space</code> is not a
 *         TYPE_RGB space or if the min/max normalized component
 *         values are not 0.0/1.0.
 */
public DirectColorModel(ColorSpace space, int bits, int rmask,
                        int gmask, int bmask, int amask,
                        boolean isAlphaPremultiplied,
                        int transferType) {
    super (space, bits, rmask, gmask, bmask, amask,
           isAlphaPremultiplied,
           amask == 0 ? Transparency.OPAQUE : Transparency.TRANSLUCENT,
           transferType);
    if (ColorModel.isLinearRGBspace(colorSpace)) {
        is_LinearRGB = true;
        if (maxBits <= 8) {
            lRGBprecision = 8;
            tosRGB8LUT = ColorModel.getLinearRGB8TosRGB8LUT();
            fromsRGB8LUT8 = ColorModel.getsRGB8ToLinearRGB8LUT();
        } else {
            lRGBprecision = 16;
            tosRGB8LUT = ColorModel.getLinearRGB16TosRGB8LUT();
            fromsRGB8LUT16 = ColorModel.getsRGB8ToLinearRGB16LUT();
        }
    } else if (!is_sRGB) {
        for (int i = 0; i < 3; i++) {
            // super constructor checks that space is TYPE_RGB
            // check here that min/max are all 0.0/1.0
            if ((space.getMinValue(i) != 0.0f) ||
                (space.getMaxValue(i) != 1.0f)) {
                throw new IllegalArgumentException(
                    "Illegal min/max RGB component value");
            }
        }
    }
    setFields();
}
 
源代码16 项目: Bytecoder   文件: DirectColorModel.java
/**
 * Constructs a {@code DirectColorModel} from the specified
 * parameters.  Color components are in the specified
 * {@code ColorSpace}, which must be of type ColorSpace.TYPE_RGB
 * and have minimum normalized component values which are all 0.0
 * and maximum values which are all 1.0.
 * The masks specify which bits in an {@code int} pixel
 * representation contain the red, green and blue color samples and
 * the alpha sample, if present.  If {@code amask} is 0, pixel
 * values do not contain alpha information and all pixels are treated
 * as opaque, which means that alpha&nbsp;=&nbsp;1.0.  All of the
 * bits in each mask must be contiguous and fit in the specified number
 * of least significant bits of an {@code int} pixel
 * representation.  If there is alpha, the {@code boolean}
 * {@code isAlphaPremultiplied} specifies how to interpret
 * color and alpha samples in pixel values.  If the {@code boolean}
 * is {@code true}, color samples are assumed to have been
 * multiplied by the alpha sample.  The transparency value is
 * Transparency.OPAQUE, if no alpha is present, or
 * Transparency.TRANSLUCENT otherwise.  The transfer type
 * is the type of primitive array used to represent pixel values and
 * must be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or
 * DataBuffer.TYPE_INT.
 * @param space the specified {@code ColorSpace}
 * @param bits the number of bits in the pixel values; for example,
 *         the sum of the number of bits in the masks.
 * @param rmask specifies a mask indicating which bits in an
 *         integer pixel contain the red component
 * @param gmask specifies a mask indicating which bits in an
 *         integer pixel contain the green component
 * @param bmask specifies a mask indicating which bits in an
 *         integer pixel contain the blue component
 * @param amask specifies a mask indicating which bits in an
 *         integer pixel contain the alpha component
 * @param isAlphaPremultiplied {@code true} if color samples are
 *        premultiplied by the alpha sample; {@code false} otherwise
 * @param transferType the type of array used to represent pixel values
 * @throws IllegalArgumentException if {@code space} is not a
 *         TYPE_RGB space or if the min/max normalized component
 *         values are not 0.0/1.0.
 */
public DirectColorModel(ColorSpace space, int bits, int rmask,
                        int gmask, int bmask, int amask,
                        boolean isAlphaPremultiplied,
                        int transferType) {
    super (space, bits, rmask, gmask, bmask, amask,
           isAlphaPremultiplied,
           amask == 0 ? Transparency.OPAQUE : Transparency.TRANSLUCENT,
           transferType);
    if (ColorModel.isLinearRGBspace(colorSpace)) {
        is_LinearRGB = true;
        if (maxBits <= 8) {
            lRGBprecision = 8;
            tosRGB8LUT = ColorModel.getLinearRGB8TosRGB8LUT();
            fromsRGB8LUT8 = ColorModel.getsRGB8ToLinearRGB8LUT();
        } else {
            lRGBprecision = 16;
            tosRGB8LUT = ColorModel.getLinearRGB16TosRGB8LUT();
            fromsRGB8LUT16 = ColorModel.getsRGB8ToLinearRGB16LUT();
        }
    } else if (!is_sRGB) {
        for (int i = 0; i < 3; i++) {
            // super constructor checks that space is TYPE_RGB
            // check here that min/max are all 0.0/1.0
            if ((space.getMinValue(i) != 0.0f) ||
                (space.getMaxValue(i) != 1.0f)) {
                throw new IllegalArgumentException(
                    "Illegal min/max RGB component value");
            }
        }
    }
    setFields();
}
 
源代码17 项目: openjdk-jdk9   文件: DirectColorModel.java
/**
 * Constructs a {@code DirectColorModel} from the specified
 * parameters.  Color components are in the specified
 * {@code ColorSpace}, which must be of type ColorSpace.TYPE_RGB
 * and have minimum normalized component values which are all 0.0
 * and maximum values which are all 1.0.
 * The masks specify which bits in an {@code int} pixel
 * representation contain the red, green and blue color samples and
 * the alpha sample, if present.  If {@code amask} is 0, pixel
 * values do not contain alpha information and all pixels are treated
 * as opaque, which means that alpha&nbsp;=&nbsp;1.0.  All of the
 * bits in each mask must be contiguous and fit in the specified number
 * of least significant bits of an {@code int} pixel
 * representation.  If there is alpha, the {@code boolean}
 * {@code isAlphaPremultiplied} specifies how to interpret
 * color and alpha samples in pixel values.  If the {@code boolean}
 * is {@code true}, color samples are assumed to have been
 * multiplied by the alpha sample.  The transparency value is
 * Transparency.OPAQUE, if no alpha is present, or
 * Transparency.TRANSLUCENT otherwise.  The transfer type
 * is the type of primitive array used to represent pixel values and
 * must be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or
 * DataBuffer.TYPE_INT.
 * @param space the specified {@code ColorSpace}
 * @param bits the number of bits in the pixel values; for example,
 *         the sum of the number of bits in the masks.
 * @param rmask specifies a mask indicating which bits in an
 *         integer pixel contain the red component
 * @param gmask specifies a mask indicating which bits in an
 *         integer pixel contain the green component
 * @param bmask specifies a mask indicating which bits in an
 *         integer pixel contain the blue component
 * @param amask specifies a mask indicating which bits in an
 *         integer pixel contain the alpha component
 * @param isAlphaPremultiplied {@code true} if color samples are
 *        premultiplied by the alpha sample; {@code false} otherwise
 * @param transferType the type of array used to represent pixel values
 * @throws IllegalArgumentException if {@code space} is not a
 *         TYPE_RGB space or if the min/max normalized component
 *         values are not 0.0/1.0.
 */
public DirectColorModel(ColorSpace space, int bits, int rmask,
                        int gmask, int bmask, int amask,
                        boolean isAlphaPremultiplied,
                        int transferType) {
    super (space, bits, rmask, gmask, bmask, amask,
           isAlphaPremultiplied,
           amask == 0 ? Transparency.OPAQUE : Transparency.TRANSLUCENT,
           transferType);
    if (ColorModel.isLinearRGBspace(colorSpace)) {
        is_LinearRGB = true;
        if (maxBits <= 8) {
            lRGBprecision = 8;
            tosRGB8LUT = ColorModel.getLinearRGB8TosRGB8LUT();
            fromsRGB8LUT8 = ColorModel.getsRGB8ToLinearRGB8LUT();
        } else {
            lRGBprecision = 16;
            tosRGB8LUT = ColorModel.getLinearRGB16TosRGB8LUT();
            fromsRGB8LUT16 = ColorModel.getsRGB8ToLinearRGB16LUT();
        }
    } else if (!is_sRGB) {
        for (int i = 0; i < 3; i++) {
            // super constructor checks that space is TYPE_RGB
            // check here that min/max are all 0.0/1.0
            if ((space.getMinValue(i) != 0.0f) ||
                (space.getMaxValue(i) != 1.0f)) {
                throw new IllegalArgumentException(
                    "Illegal min/max RGB component value");
            }
        }
    }
    setFields();
}
 
源代码18 项目: jdk8u-jdk   文件: DirectColorModel.java
/**
 * Constructs a <code>DirectColorModel</code> from the specified
 * parameters.  Color components are in the specified
 * <code>ColorSpace</code>, which must be of type ColorSpace.TYPE_RGB
 * and have minimum normalized component values which are all 0.0
 * and maximum values which are all 1.0.
 * The masks specify which bits in an <code>int</code> pixel
 * representation contain the red, green and blue color samples and
 * the alpha sample, if present.  If <code>amask</code> is 0, pixel
 * values do not contain alpha information and all pixels are treated
 * as opaque, which means that alpha&nbsp;=&nbsp;1.0.  All of the
 * bits in each mask must be contiguous and fit in the specified number
 * of least significant bits of an <code>int</code> pixel
 * representation.  If there is alpha, the <code>boolean</code>
 * <code>isAlphaPremultiplied</code> specifies how to interpret
 * color and alpha samples in pixel values.  If the <code>boolean</code>
 * is <code>true</code>, color samples are assumed to have been
 * multiplied by the alpha sample.  The transparency value is
 * Transparency.OPAQUE, if no alpha is present, or
 * Transparency.TRANSLUCENT otherwise.  The transfer type
 * is the type of primitive array used to represent pixel values and
 * must be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or
 * DataBuffer.TYPE_INT.
 * @param space the specified <code>ColorSpace</code>
 * @param bits the number of bits in the pixel values; for example,
 *         the sum of the number of bits in the masks.
 * @param rmask specifies a mask indicating which bits in an
 *         integer pixel contain the red component
 * @param gmask specifies a mask indicating which bits in an
 *         integer pixel contain the green component
 * @param bmask specifies a mask indicating which bits in an
 *         integer pixel contain the blue component
 * @param amask specifies a mask indicating which bits in an
 *         integer pixel contain the alpha component
 * @param isAlphaPremultiplied <code>true</code> if color samples are
 *        premultiplied by the alpha sample; <code>false</code> otherwise
 * @param transferType the type of array used to represent pixel values
 * @throws IllegalArgumentException if <code>space</code> is not a
 *         TYPE_RGB space or if the min/max normalized component
 *         values are not 0.0/1.0.
 */
public DirectColorModel(ColorSpace space, int bits, int rmask,
                        int gmask, int bmask, int amask,
                        boolean isAlphaPremultiplied,
                        int transferType) {
    super (space, bits, rmask, gmask, bmask, amask,
           isAlphaPremultiplied,
           amask == 0 ? Transparency.OPAQUE : Transparency.TRANSLUCENT,
           transferType);
    if (ColorModel.isLinearRGBspace(colorSpace)) {
        is_LinearRGB = true;
        if (maxBits <= 8) {
            lRGBprecision = 8;
            tosRGB8LUT = ColorModel.getLinearRGB8TosRGB8LUT();
            fromsRGB8LUT8 = ColorModel.getsRGB8ToLinearRGB8LUT();
        } else {
            lRGBprecision = 16;
            tosRGB8LUT = ColorModel.getLinearRGB16TosRGB8LUT();
            fromsRGB8LUT16 = ColorModel.getsRGB8ToLinearRGB16LUT();
        }
    } else if (!is_sRGB) {
        for (int i = 0; i < 3; i++) {
            // super constructor checks that space is TYPE_RGB
            // check here that min/max are all 0.0/1.0
            if ((space.getMinValue(i) != 0.0f) ||
                (space.getMaxValue(i) != 1.0f)) {
                throw new IllegalArgumentException(
                    "Illegal min/max RGB component value");
            }
        }
    }
    setFields();
}
 
源代码19 项目: Java8CN   文件: DirectColorModel.java
/**
 * Constructs a <code>DirectColorModel</code> from the specified
 * parameters.  Color components are in the specified
 * <code>ColorSpace</code>, which must be of type ColorSpace.TYPE_RGB
 * and have minimum normalized component values which are all 0.0
 * and maximum values which are all 1.0.
 * The masks specify which bits in an <code>int</code> pixel
 * representation contain the red, green and blue color samples and
 * the alpha sample, if present.  If <code>amask</code> is 0, pixel
 * values do not contain alpha information and all pixels are treated
 * as opaque, which means that alpha&nbsp;=&nbsp;1.0.  All of the
 * bits in each mask must be contiguous and fit in the specified number
 * of least significant bits of an <code>int</code> pixel
 * representation.  If there is alpha, the <code>boolean</code>
 * <code>isAlphaPremultiplied</code> specifies how to interpret
 * color and alpha samples in pixel values.  If the <code>boolean</code>
 * is <code>true</code>, color samples are assumed to have been
 * multiplied by the alpha sample.  The transparency value is
 * Transparency.OPAQUE, if no alpha is present, or
 * Transparency.TRANSLUCENT otherwise.  The transfer type
 * is the type of primitive array used to represent pixel values and
 * must be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or
 * DataBuffer.TYPE_INT.
 * @param space the specified <code>ColorSpace</code>
 * @param bits the number of bits in the pixel values; for example,
 *         the sum of the number of bits in the masks.
 * @param rmask specifies a mask indicating which bits in an
 *         integer pixel contain the red component
 * @param gmask specifies a mask indicating which bits in an
 *         integer pixel contain the green component
 * @param bmask specifies a mask indicating which bits in an
 *         integer pixel contain the blue component
 * @param amask specifies a mask indicating which bits in an
 *         integer pixel contain the alpha component
 * @param isAlphaPremultiplied <code>true</code> if color samples are
 *        premultiplied by the alpha sample; <code>false</code> otherwise
 * @param transferType the type of array used to represent pixel values
 * @throws IllegalArgumentException if <code>space</code> is not a
 *         TYPE_RGB space or if the min/max normalized component
 *         values are not 0.0/1.0.
 */
public DirectColorModel(ColorSpace space, int bits, int rmask,
                        int gmask, int bmask, int amask,
                        boolean isAlphaPremultiplied,
                        int transferType) {
    super (space, bits, rmask, gmask, bmask, amask,
           isAlphaPremultiplied,
           amask == 0 ? Transparency.OPAQUE : Transparency.TRANSLUCENT,
           transferType);
    if (ColorModel.isLinearRGBspace(colorSpace)) {
        is_LinearRGB = true;
        if (maxBits <= 8) {
            lRGBprecision = 8;
            tosRGB8LUT = ColorModel.getLinearRGB8TosRGB8LUT();
            fromsRGB8LUT8 = ColorModel.getsRGB8ToLinearRGB8LUT();
        } else {
            lRGBprecision = 16;
            tosRGB8LUT = ColorModel.getLinearRGB16TosRGB8LUT();
            fromsRGB8LUT16 = ColorModel.getsRGB8ToLinearRGB16LUT();
        }
    } else if (!is_sRGB) {
        for (int i = 0; i < 3; i++) {
            // super constructor checks that space is TYPE_RGB
            // check here that min/max are all 0.0/1.0
            if ((space.getMinValue(i) != 0.0f) ||
                (space.getMaxValue(i) != 1.0f)) {
                throw new IllegalArgumentException(
                    "Illegal min/max RGB component value");
            }
        }
    }
    setFields();
}
 
源代码20 项目: openjdk-8-source   文件: DirectColorModel.java
/**
 * Constructs a <code>DirectColorModel</code> from the specified
 * parameters.  Color components are in the specified
 * <code>ColorSpace</code>, which must be of type ColorSpace.TYPE_RGB
 * and have minimum normalized component values which are all 0.0
 * and maximum values which are all 1.0.
 * The masks specify which bits in an <code>int</code> pixel
 * representation contain the red, green and blue color samples and
 * the alpha sample, if present.  If <code>amask</code> is 0, pixel
 * values do not contain alpha information and all pixels are treated
 * as opaque, which means that alpha&nbsp;=&nbsp;1.0.  All of the
 * bits in each mask must be contiguous and fit in the specified number
 * of least significant bits of an <code>int</code> pixel
 * representation.  If there is alpha, the <code>boolean</code>
 * <code>isAlphaPremultiplied</code> specifies how to interpret
 * color and alpha samples in pixel values.  If the <code>boolean</code>
 * is <code>true</code>, color samples are assumed to have been
 * multiplied by the alpha sample.  The transparency value is
 * Transparency.OPAQUE, if no alpha is present, or
 * Transparency.TRANSLUCENT otherwise.  The transfer type
 * is the type of primitive array used to represent pixel values and
 * must be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or
 * DataBuffer.TYPE_INT.
 * @param space the specified <code>ColorSpace</code>
 * @param bits the number of bits in the pixel values; for example,
 *         the sum of the number of bits in the masks.
 * @param rmask specifies a mask indicating which bits in an
 *         integer pixel contain the red component
 * @param gmask specifies a mask indicating which bits in an
 *         integer pixel contain the green component
 * @param bmask specifies a mask indicating which bits in an
 *         integer pixel contain the blue component
 * @param amask specifies a mask indicating which bits in an
 *         integer pixel contain the alpha component
 * @param isAlphaPremultiplied <code>true</code> if color samples are
 *        premultiplied by the alpha sample; <code>false</code> otherwise
 * @param transferType the type of array used to represent pixel values
 * @throws IllegalArgumentException if <code>space</code> is not a
 *         TYPE_RGB space or if the min/max normalized component
 *         values are not 0.0/1.0.
 */
public DirectColorModel(ColorSpace space, int bits, int rmask,
                        int gmask, int bmask, int amask,
                        boolean isAlphaPremultiplied,
                        int transferType) {
    super (space, bits, rmask, gmask, bmask, amask,
           isAlphaPremultiplied,
           amask == 0 ? Transparency.OPAQUE : Transparency.TRANSLUCENT,
           transferType);
    if (ColorModel.isLinearRGBspace(colorSpace)) {
        is_LinearRGB = true;
        if (maxBits <= 8) {
            lRGBprecision = 8;
            tosRGB8LUT = ColorModel.getLinearRGB8TosRGB8LUT();
            fromsRGB8LUT8 = ColorModel.getsRGB8ToLinearRGB8LUT();
        } else {
            lRGBprecision = 16;
            tosRGB8LUT = ColorModel.getLinearRGB16TosRGB8LUT();
            fromsRGB8LUT16 = ColorModel.getsRGB8ToLinearRGB16LUT();
        }
    } else if (!is_sRGB) {
        for (int i = 0; i < 3; i++) {
            // super constructor checks that space is TYPE_RGB
            // check here that min/max are all 0.0/1.0
            if ((space.getMinValue(i) != 0.0f) ||
                (space.getMaxValue(i) != 1.0f)) {
                throw new IllegalArgumentException(
                    "Illegal min/max RGB component value");
            }
        }
    }
    setFields();
}