Package java.awt.image

Examples of java.awt.image.SampleModel.createDataBuffer()


  public void testMethod1(TestHarness harness)
  {
    harness.checkPoint("(int, int, int[], DataBuffer)");
    SampleModel m = new ComponentSampleModel(DataBuffer.TYPE_BYTE, 5, 10,
           3, 16, new int[] {0, 2, 1});
    DataBuffer db = m.createDataBuffer();
    int[] pixel = new int[3];
    m.getPixel(1, 2, pixel, db);
    harness.check(Arrays.equals(pixel, new int[] {0, 0, 0}));
    m.setPixel(1, 2, new int[] {1, 2, 3}, db);
    m.getPixel(1, 2, pixel, db);
View Full Code Here


  public void testMethod2(TestHarness harness)
  {
    harness.checkPoint("(int, int, float[], DataBuffer)");
    SampleModel m = new ComponentSampleModel(DataBuffer.TYPE_BYTE, 5, 10,
           3, 16, new int[] {0, 2, 1});
    DataBuffer db = m.createDataBuffer();
    float[] pixel = new float[3];
    m.getPixel(1, 2, pixel, db);
    harness.check(Arrays.equals(pixel, new float[] {0, 0, 0}));
    m.setPixel(1, 2, new int[] {1, 2, 3}, db);
    m.getPixel(1, 2, pixel, db);
View Full Code Here

   
  public void test(TestHarness harness)
  {
    SampleModel m = new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE, 10,
            20, new int[] { 224, 28, 3 });
    DataBuffer db = m.createDataBuffer();
    harness.check(db.getDataType(), DataBuffer.TYPE_BYTE);
    harness.check(db.getNumBanks(), 1);
    harness.check(db.getSize(), 200);
    harness.check(db.getOffsets()[0], 0);
  }
View Full Code Here

  public void testMethod3(TestHarness harness)
  {
    harness.checkPoint("(int, int, float[], DataBuffer)");
    SampleModel m = new ComponentSampleModel(DataBuffer.TYPE_BYTE, 5, 10,
           3, 16, new int[] {0, 2, 1});
    DataBuffer db = m.createDataBuffer();
    float[] pixel = new float[3];
    m.getPixel(1, 2, pixel, db);
    harness.check(Arrays.equals(pixel, new float[] {0, 0, 0}));
    m.setPixel(1, 2, new int[] {1, 2, 3}, db);
    m.getPixel(1, 2, pixel, db);
View Full Code Here

  public void testMethod1(TestHarness harness)
  {
    harness.checkPoint("(int, int, int, int, int[], DataBuffer)");
    SampleModel m = new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE, 10,
            20, new int[] { 224, 28, 3 });
    DataBuffer db = m.createDataBuffer();
    int[] pixel = new int[18];
    m.getPixels(1, 2, 2, 3, pixel, db);
    harness.check(Arrays.equals(pixel, new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
            0, 0, 0, 0, 0, 0, 0, 0}));
    m.setPixels(1, 2, 2, 3, new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
View Full Code Here

  public void testMethod2(TestHarness harness)
  {
    harness.checkPoint("(int, int, int, int, float[], DataBuffer)");    
    SampleModel m = new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE, 10,
            20, new int[] { 224, 28, 3 });
    DataBuffer db = m.createDataBuffer();
    float[] pixel = new float[18];
    m.getPixels(1, 2, 2, 3, pixel, db);
    harness.check(Arrays.equals(pixel, new float[] {0, 0, 0, 0, 0, 0, 0, 0, 0,
            0, 0, 0, 0, 0, 0, 0, 0, 0}));
    m.setPixels(1, 2, 2, 3, new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
View Full Code Here

  public void testMethod3(TestHarness harness)
  {
    harness.checkPoint("(int, int, int, int, double[], DataBuffer)");    
    SampleModel m = new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE, 10,
            20, new int[] { 224, 28, 3 });
    DataBuffer db = m.createDataBuffer();
    double[] pixel = new double[18];
    m.getPixels(1, 2, 2, 3, pixel, db);
    harness.check(Arrays.equals(pixel, new double[] {0, 0, 0, 0, 0, 0, 0, 0, 0,
            0, 0, 0, 0, 0, 0, 0, 0, 0}));
    m.setPixels(1, 2, 2, 3, new double[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
View Full Code Here

  public void testMethod1MultiPixelPackedSampleModel(TestHarness harness)
  {
    harness.checkPoint("(int, int, int, int, int[], DataBuffer)");
    SampleModel m = new MultiPixelPackedSampleModel(DataBuffer.TYPE_BYTE, 10,
            20, 2);
    DataBuffer db = m.createDataBuffer();
    int[] pixel = new int[6];
    m.getPixels(1, 2, 2, 3, pixel, db);
    harness.check(Arrays.equals(pixel, new int[] {0, 0, 0, 0, 0, 0}));
    db.setElem(6, 0x18);
    db.setElem(9, 0x30);
View Full Code Here

  public void testMethod1(TestHarness harness)
  {
    harness.checkPoint("(int, int, int, int, int, int[], DataBuffer)");
    SampleModel m = new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE, 10,
            20, new int[] { 224, 28, 3 });
    DataBuffer db = m.createDataBuffer();
    int[] samples = new int[6];
    m.getSamples(1, 2, 2, 3, 1, samples, db);
    harness.check(Arrays.equals(samples, new int[] {0, 0, 0, 0, 0, 0}));
    m.setPixels(1, 2, 2, 3, new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
            13, 14, 15, 16, 17, 18}, db);
View Full Code Here

  public void testMethod2(TestHarness harness)
  {
    harness.checkPoint("(int, int, int, int, int, float[], DataBuffer)");    
    SampleModel m = new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE, 10,
            20, new int[] { 224, 28, 3 });
    DataBuffer db = m.createDataBuffer();
    float[] samples = new float[6];
    m.getSamples(1, 2, 2, 3, 1, samples, db);
    harness.check(Arrays.equals(samples, new float[] {0, 0, 0, 0, 0, 0}));
    m.setPixels(1, 2, 2, 3, new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
            13, 14, 15, 16, 17, 18}, db);
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.