Package java.awt.image

Examples of java.awt.image.LookupOp.filter()


   
    // Src and dst are different sizes - not allowed
    dst = new BufferedImage(30, 40, BufferedImage.TYPE_USHORT_GRAY);
    try
    {
      op.filter(img, dst);
      harness.check(false);
    }
    catch (IllegalArgumentException e)
    {
      harness.check(true);
View Full Code Here


   
    // Src and dst have different tpyes (allowed)
    dst = new BufferedImage(20, 20, BufferedImage.TYPE_BYTE_GRAY);
    try
    {
      op.filter(img, dst);
      harness.check(true);
    }
    catch (IllegalArgumentException e)
    {
      harness.check(false);
View Full Code Here

   
    // src and dst can even have different number of bands
    dst = new BufferedImage(20, 20, BufferedImage.TYPE_INT_ARGB);
    try
    {
      op.filter(img, dst);
      harness.check(true);
      harness.check(img.getType(), BufferedImage.TYPE_USHORT_GRAY);
      harness.check(dst.getType(), BufferedImage.TYPE_INT_ARGB);
    }
    catch (IllegalArgumentException ex)
View Full Code Here

    byte[] bytes = new byte[] {12, 23, 14, 35, 48, 2};
    ByteLookupTable t = new ByteLookupTable(0, bytes);
    LookupOp op = new LookupOp(t, null);
   
    BufferedImage dst = new BufferedImage(5, 5, BufferedImage.TYPE_INT_ARGB);
    dst = op.filter(img, dst);
    WritableRaster dest = dst.getRaster();
   
    harness.check(img.isAlphaPremultiplied(), premultiply);
    harness.check(dst.isAlphaPremultiplied(), false);
   
View Full Code Here

     * I'm pretty sure it's a bug, but it's not one that's worth mimicing.
     * This test will not run on Sun.
     */
    try
    {
      dst = op.filter(img, dst);
      WritableRaster dest = dst.getRaster();
     
      harness.check(img.isAlphaPremultiplied(), premultiply);
      harness.check(dst.isAlphaPremultiplied(), false);
     
View Full Code Here

   
    ShortLookupTable t = new ShortLookupTable(0, lutarray);
    LookupOp op = new LookupOp(t, null);
   
    BufferedImage dst = new BufferedImage(5, 5, BufferedImage.TYPE_INT_ARGB);
    dst = op.filter(img, dst);
    WritableRaster dest = dst.getRaster();
   
    harness.check(img.isAlphaPremultiplied(), premultiply);
    harness.check(dst.isAlphaPremultiplied(), false);
   
View Full Code Here

    ShortLookupTable t = new ShortLookupTable(0, lutarray);
    LookupOp op = new LookupOp(t, null);
   
    try
    {
      op.filter(img, null);
      harness.check(false);
    }
    catch (ArrayIndexOutOfBoundsException ex)
    {
      harness.check(true);
View Full Code Here

    ByteLookupTable t2 = new ByteLookupTable(0, bytes);
    op = new LookupOp(t2, null);
   
    try
    {
      op.filter(img, null);
      harness.check(true);
    }
    catch (ArrayIndexOutOfBoundsException ex)
    {
      // Allow an exception to be thrown anyways, since it makes more sense
View Full Code Here

    r.setSample(1, 1, 3, 2);
    BufferedImage dst = new BufferedImage(5, 5, BufferedImage.TYPE_USHORT_GRAY);
    try
    {
      // It doesn't throw an exception...
      op.filter(img, dst);
      harness.check(true);
    }
    catch (IllegalArgumentException ex)
    {
      harness.check(false);
View Full Code Here

    r.setSample(1, 1, 0, 5);
    dst = new BufferedImage(5, 5, BufferedImage.TYPE_INT_ARGB);
    try
    {
      // It doesn't throw an exception either...
      op.filter(img, dst);
      harness.check(true);
    }
    catch (IllegalArgumentException ex)
    {
      harness.check(false);
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.