Package java.awt.image

Examples of java.awt.image.ByteLookupTable


 
  public void testMethod2(TestHarness harness)
  {
    harness.checkPoint("(Raster)");   
    byte[] bytes = new byte[] {(byte) 0xAA, (byte) 0xBB};
    ByteLookupTable t = new ByteLookupTable(0, bytes);
    LookupOp op = new LookupOp(t, null);
    Raster raster = Raster.createWritableRaster(
            new MultiPixelPackedSampleModel(DataBuffer.TYPE_BYTE, 10, 20, 8),
            null);
    Rectangle2D bounds = op.getBounds2D(raster);
View Full Code Here


   
    // Create an image to work on
    BufferedImage img = new BufferedImage(20, 20, BufferedImage.TYPE_USHORT_GRAY);
   
    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());
View Full Code Here

    else
      img = new BufferedImage(5, 5, BufferedImage.TYPE_INT_ARGB);
    createImage(img);
   
    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();
View Full Code Here

    }

    // But a ByteLookupTable will give us undetermined results
    // (is a native array overflowing in sun's implementation?)
    byte[] bytes = new byte[] {0, 1, 2, 3, 4, 5, 6, 7, 8};
    ByteLookupTable t2 = new ByteLookupTable(0, bytes);
    op = new LookupOp(t2, null);
   
    try
    {
      op.filter(img, null);
View Full Code Here

public class getPoint2D implements Testlet
{
  public void test(TestHarness harness)
  {
    byte[] bytes = new byte[] {(byte) 0xAA, (byte) 0xBB};
    ByteLookupTable t = new ByteLookupTable(0, bytes);
    LookupOp op = new LookupOp(t, null);
    Point2D p = new Point2D.Double(1.0, 2.0);
    Point2D pp = new Point2D.Double();
    Point2D p1 = op.getPoint2D(p, pp);
    harness.check(p1, p);
View Full Code Here

        // For what ever reason this makes the Op work correctly.
        // If you remove this, it seems to get the color channels messed
        // up.  The downside is that I suspect that this means we are
        // falling into a more general, and hence slower case, but
        // at least it works....
        operation  =  new LookupOp(new ByteLookupTable(0, tableData), hints)
            { };
    }
View Full Code Here

        for ( int counter = 0; counter < 256; counter++ )
           invertArray[ counter ] = ( byte )( 255 - counter );  
       
        // create filter to invert colors
        BufferedImageOp invertFilter = new LookupOp(
           new ByteLookupTable( 0, invertArray ), null );
       
        // apply filter to displayImage
        return invertFilter.filter( buff, null );

    }
View Full Code Here

        for ( int counter = 0; counter < 256; counter++ )
           invertArray[ counter ] = ( byte )( 255 - counter );  
       
        // create filter to invert colors
        BufferedImageOp invertFilter = new LookupOp(
           new ByteLookupTable( 0, invertArray ), null );
       
        // apply filter to displayImage
        return invertFilter.filter( buff, null );

    }
View Full Code Here

        for ( int counter = 0; counter < 256; counter++ )
           invertArray[ counter ] = ( byte )( 255 - counter );  
       
        // create filter to invert colors
        BufferedImageOp invertFilter = new LookupOp(
           new ByteLookupTable( 0, invertArray ), null );
       
        // apply filter to displayImage
        return invertFilter.filter( buff, null );

    }
View Full Code Here

        // For what ever reason this makes the Op work correctly.
        // If you remove this, it seems to get the color channels messed
        // up.  The downside is that I suspect that this means we are
        // falling into a more general, and hence slower case, but
        // at least it works....
        operation  =  new LookupOp(new ByteLookupTable(0, tableData), hints)
            { };
    }
View Full Code Here

TOP

Related Classes of java.awt.image.ByteLookupTable

Copyright © 2018 www.massapicom. 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.