Examples of coerceData()


Examples of java.awt.image.BufferedImage.coerceData()

    double size = bytes.length / 4.0;
    if (size - Math.floor(size) > 0)
      size++;

    BufferedImage bi = new BufferedImage((int) size, 1, BufferedImage.TYPE_INT_ARGB);
    bi.coerceData(false);
    int pos = 0;
    for (int i = 0; i < bytes.length; i += 4) {
      int r = bytes[i];
      int g = i + 1 < bytes.length ? bytes[i + 1] : 0;
      int b = i + 2 < bytes.length ? bytes[i + 2] : 0;
View Full Code Here

Examples of java.awt.image.ComponentColorModel.coerceData()

                                                      DataBuffer.TYPE_BYTE);
   
    harness.check(ccm.isAlphaPremultiplied(), false);
   
    // Check to ensure data is not changed needlessly
    ColorModel resultCM = ccm.coerceData(rast, false);
    harness.check(resultCM.getClass().equals(ccm.getClass()));
    harness.check(resultCM.isAlphaPremultiplied(), false);
    harness.check(ccm, resultCM);
    for (int x = 0; x < 50; x++)
      for (int y = 0; y < 50; y++)
View Full Code Here

Examples of java.awt.image.ComponentColorModel.coerceData()

            else
              harness.check(rast.getSampleFloat(x, y, b), (x+y));
          }
   
    // Coerce data into a premultiplied state
    resultCM = ccm.coerceData(rast, true);
   
    // Ensure we're still using the same color model!
    harness.check(resultCM.getClass().equals(ccm.getClass()));
    harness.check(resultCM.isAlphaPremultiplied(), true);
    harness.check(! (ccm == resultCM));     // object is cloned...
View Full Code Here

Examples of java.awt.image.DirectColorModel.coerceData()

                                                0x000000ff, 0xff000000);
   
    harness.check(dcm.isAlphaPremultiplied(), false);
   
    // Check to ensure data is not changed needlessly
    ColorModel resultCM = dcm.coerceData(rast, false);
    harness.check(resultCM.getClass().equals(dcm.getClass()));
    harness.check(resultCM.isAlphaPremultiplied(), false);
    harness.check(dcm, resultCM);
    for (int x = 0; x < 50; x++)
      for (int y = 0; y < 50; y++)
View Full Code Here

Examples of java.awt.image.DirectColorModel.coerceData()

            else
              harness.check(rast.getSampleFloat(x, y, b), (x+y));
          }
   
    // Coerce data into a premultiplied state
    resultCM = dcm.coerceData(rast, true);
   
    // Ensure we're still using the same color model!
    harness.check(resultCM.getClass().equals(dcm.getClass()));
    harness.check(resultCM.isAlphaPremultiplied(), true);
    harness.check(! (dcm == resultCM));     // object is cloned...
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.