Package java.awt.image

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


        BufferedImage localBufferedImage = getImage(5069, 19);

        // filter(BI,BI) non-equal widths
        BufferedImage localBufferedImage1 = getImage(6, 19);
        try {
            localLookupOp.filter(localBufferedImage, localBufferedImage1);
            fail("IllegalArgumentException expected!");
        } catch (IllegalArgumentException e) {
            // expected
        }
View Full Code Here


        }

        // filter(R,WR) non-equal widths

        try {
            localLookupOp.filter(localBufferedImage.getRaster(),
                    localBufferedImage1.getRaster());
            fail("IllegalArgumentException expected!");
        } catch (IllegalArgumentException e) {
            // expected
        }
View Full Code Here

        // filter(BI,BI) non-equal heights

        localBufferedImage1 = getImage(5069, 5);
        try {
            localLookupOp.filter(localBufferedImage, localBufferedImage1);
            fail("IllegalArgumentException expected!");
        } catch (IllegalArgumentException e) {
            // expected
        }
View Full Code Here

            // expected
        }

        // filter(R, WR) non-equal heights
        try {
            localLookupOp.filter(localBufferedImage.getRaster(),
                    localBufferedImage1.getRaster());
            fail("IllegalArgumentException expected!");
        } catch (IllegalArgumentException e) {
            // expected
        }
View Full Code Here

   
    byte[] bytes = new byte[] {(byte) 0xAA, (byte) 0xBB};
    ByteLookupTable t = new ByteLookupTable(0, bytes);
    LookupOp op = new LookupOp(t, null);
   
    dest = op.filter(src, dest);
    harness.check(dest.getSample(0, 0, 0), 1);
    harness.check(dest.getSample(1, 0, 0), 2);
    harness.check(dest.getSample(2, 0, 0), 3);
    harness.check(dest.getSample(3, 0, 0), 4);
    harness.check(dest.getSample(4, 0, 0), 5);
View Full Code Here

    WritableRaster dest = src.createCompatibleWritableRaster();
   
    byte[] bytes = new byte[] {(byte) 0xAA, (byte) 0xBB};
    ByteLookupTable t = new ByteLookupTable(0, bytes);
    LookupOp op = new LookupOp(t, null);
    dest = op.filter(src, dest);
   
    harness.check(dest.getSample(0, 0, 0), 0);
    harness.check(dest.getSample(1, 0, 0), 0);
    harness.check(dest.getSample(2, 0, 0), 0);
    harness.check(dest.getSample(3, 0, 0), 0);
View Full Code Here

   
    byte[] bytes = new byte[] {(byte) 0xAA, (byte) 0xBB};
    ByteLookupTable t = new ByteLookupTable(0, bytes);
    LookupOp op = new LookupOp(t, null);
   
    dest = op.filter(src, dest);
    harness.check(dest.getSample(0, 0, 0), 1);
    harness.check(dest.getSample(1, 0, 0), 2);
    harness.check(dest.getSample(2, 0, 0), 3);
    harness.check(dest.getSample(3, 0, 0), 4);
    harness.check(dest.getSample(4, 0, 0), 5);
View Full Code Here

    byte[] bytes = new byte[] {(byte) 0xAA, (byte) 0xBB};
    ByteLookupTable t = new ByteLookupTable(0, bytes);
    LookupOp op = new LookupOp(t, null);
   
    // Simple tests
    BufferedImage dst = op.filter(img, null);
    harness.check(dst.getType(), op.createCompatibleDestImage(img, null).getType());
   
    dst = new BufferedImage(20, 20, BufferedImage.TYPE_USHORT_GRAY);
    try
    {
View Full Code Here

    harness.check(dst.getType(), op.createCompatibleDestImage(img, null).getType());
   
    dst = new BufferedImage(20, 20, BufferedImage.TYPE_USHORT_GRAY);
    try
    {
      dst = op.filter(img, dst);
      harness.check(true);
    }
    catch (IllegalArgumentException ex)
    {
      harness.check(false);
View Full Code Here

    }
   
    // Src and dst images can be the same
    try
    {
      op.filter(img, img);
      harness.check(true);
    }
    catch (IllegalArgumentException e)
    {
      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.