java.awt.image.SampleModel#createDataBuffer()源码实例Demo

下面列出了java.awt.image.SampleModel#createDataBuffer() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: jdk8u-jdk   文件: GetDataElementsTest.java
public static void main(String[] args) {
    SampleModel sm = new ComponentSampleModel(dataType, width, height, 4, width * 4, new int[] { 0, 1, 2, 3 } );

    DataBuffer db = sm.createDataBuffer();
    Object o = null;

    boolean testPassed = false;
    try {
        o = sm.getDataElements(Integer.MAX_VALUE, 0, 1, 1, o, db);
    } catch (ArrayIndexOutOfBoundsException e) {
        System.out.println(e.getMessage());
        testPassed = true;
    }

    if (!testPassed) {
        throw new RuntimeException("Excpected excprion was not thrown.");
    }
}
 
源代码2 项目: jdk8u-jdk   文件: GetDataElementsTest.java
public static void main(String[] args) {
    SampleModel sm = new ComponentSampleModel(dataType, width, height, 4, width * 4, new int[] { 0, 1, 2, 3 } );

    DataBuffer db = sm.createDataBuffer();
    Object o = null;

    boolean testPassed = false;
    try {
        o = sm.getDataElements(Integer.MAX_VALUE, 0, 1, 1, o, db);
    } catch (ArrayIndexOutOfBoundsException e) {
        System.out.println(e.getMessage());
        testPassed = true;
    }

    if (!testPassed) {
        throw new RuntimeException("Excpected excprion was not thrown.");
    }
}
 
源代码3 项目: TencentKona-8   文件: GetDataElementsTest.java
public static void main(String[] args) {
    SampleModel sm = new ComponentSampleModel(dataType, width, height, 4, width * 4, new int[] { 0, 1, 2, 3 } );

    DataBuffer db = sm.createDataBuffer();
    Object o = null;

    boolean testPassed = false;
    try {
        o = sm.getDataElements(Integer.MAX_VALUE, 0, 1, 1, o, db);
    } catch (ArrayIndexOutOfBoundsException e) {
        System.out.println(e.getMessage());
        testPassed = true;
    }

    if (!testPassed) {
        throw new RuntimeException("Excpected excprion was not thrown.");
    }
}
 
源代码4 项目: dragonwell8_jdk   文件: ByteComponentRaster.java
/**
 * Constructs a ByteComponentRaster with the given SampleModel.
 * The Raster's upper left corner is origin and it is the same
 * size as the SampleModel.  A DataBuffer large enough to describe the
 * Raster is automatically created.  SampleModel must be of type
 * SinglePixelPackedSampleModel or ComponentSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param origin          The Point that specified the origin.
 */
public ByteComponentRaster(SampleModel sampleModel, Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码5 项目: jdk8u_jdk   文件: ShortComponentRaster.java
/**
 *  Constructs a ShortComponentRaster with the given SampleModel.
 *  The Raster's upper left corner is origin and it is the same
 *  size as the SampleModel.  A DataBuffer large enough to describe the
 *  Raster is automatically created.  SampleModel must be of type
 *  ComponentSampleModel or SinglePixelPackedSampleModel.
 *  @param sampleModel     The SampleModel that specifies the layout.
 *  @param origin          The Point that specified the origin.
 */
public ShortComponentRaster(SampleModel sampleModel, Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码6 项目: dragonwell8_jdk   文件: ShortComponentRaster.java
/**
 *  Constructs a ShortComponentRaster with the given SampleModel.
 *  The Raster's upper left corner is origin and it is the same
 *  size as the SampleModel.  A DataBuffer large enough to describe the
 *  Raster is automatically created.  SampleModel must be of type
 *  ComponentSampleModel or SinglePixelPackedSampleModel.
 *  @param sampleModel     The SampleModel that specifies the layout.
 *  @param origin          The Point that specified the origin.
 */
public ShortComponentRaster(SampleModel sampleModel, Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码7 项目: jdk8u-jdk   文件: ShortBandedRaster.java
/**
 * Constructs a ShortBandedRaster with the given SampleModel.
 * The Raster's upper left corner is origin and it is the same
 * size as the SampleModel.  A DataBuffer large enough to describe the
 * Raster is automatically created.  SampleModel must be of type
 * BandedSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param origin          The Point that specified the origin.
 */
public ShortBandedRaster(SampleModel sampleModel,
                            Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
/**
 *  Constructs a IntegerComponentRaster with the given SampleModel.
 *  The Raster's upper left corner is origin and it is the same
 *  size as the SampleModel.  A DataBuffer large enough to describe the
 *  Raster is automatically created.  SampleModel must be of type
 *  SinglePixelPackedSampleModel.
 *  @param sampleModel     The SampleModel that specifies the layout.
 *  @param origin          The Point that specified the origin.
 */
public IntegerComponentRaster(SampleModel sampleModel,
                                 Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码9 项目: jdk8u60   文件: ShortInterleavedRaster.java
/**
 *  Constructs a ShortInterleavedRaster with the given SampleModel.
 *  The Raster's upper left corner is origin and it is the same
 *  size as the SampleModel.  A DataBuffer large enough to describe the
 *  Raster is automatically created.  SampleModel must be of type
 *  PixelInterleavedSampleModel or SinglePixelPackedSampleModel.
 *  @param sampleModel     The SampleModel that specifies the layout.
 *  @param origin          The Point that specified the origin.
 */
public ShortInterleavedRaster(SampleModel sampleModel, Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码10 项目: openjdk-8   文件: ByteInterleavedRaster.java
/**
 * Constructs a ByteInterleavedRaster with the given SampleModel.
 * The Raster's upper left corner is origin and it is the same
 * size as the SampleModel.  A DataBuffer large enough to describe the
 * Raster is automatically created.  SampleModel must be of type
 * SinglePixelPackedSampleModel or InterleavedSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param origin          The Point that specified the origin.
 */
public ByteInterleavedRaster(SampleModel sampleModel, Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码11 项目: jdk8u60   文件: IntegerInterleavedRaster.java
/**
 *  Constructs a IntegerInterleavedRaster with the given SampleModel.
 *  The Raster's upper left corner is origin and it is the same
 *  size as the SampleModel.  A DataBuffer large enough to describe the
 *  Raster is automatically created.  SampleModel must be of type
 *  SinglePixelPackedSampleModel.
 *  @param sampleModel     The SampleModel that specifies the layout.
 *  @param origin          The Point that specified the origin.
 */
public IntegerInterleavedRaster(SampleModel sampleModel,
                                 Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码12 项目: openjdk-jdk8u   文件: IntegerComponentRaster.java
/**
 *  Constructs a IntegerComponentRaster with the given SampleModel.
 *  The Raster's upper left corner is origin and it is the same
 *  size as the SampleModel.  A DataBuffer large enough to describe the
 *  Raster is automatically created.  SampleModel must be of type
 *  SinglePixelPackedSampleModel.
 *  @param sampleModel     The SampleModel that specifies the layout.
 *  @param origin          The Point that specified the origin.
 */
public IntegerComponentRaster(SampleModel sampleModel,
                                 Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码13 项目: jdk8u-jdk   文件: IntegerInterleavedRaster.java
/**
 *  Constructs a IntegerInterleavedRaster with the given SampleModel.
 *  The Raster's upper left corner is origin and it is the same
 *  size as the SampleModel.  A DataBuffer large enough to describe the
 *  Raster is automatically created.  SampleModel must be of type
 *  SinglePixelPackedSampleModel.
 *  @param sampleModel     The SampleModel that specifies the layout.
 *  @param origin          The Point that specified the origin.
 */
public IntegerInterleavedRaster(SampleModel sampleModel,
                                 Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码14 项目: jdk8u-dev-jdk   文件: ByteBandedRaster.java
/**
 *  Constructs a ByteBandedRaster with the given sampleModel. The
 *  Raster's upper left corner is origin and it is the same
 *  size as the SampleModel.  A dataBuffer large
 *  enough to describe the Raster is automatically created. SampleModel
 *  must be of type BandedSampleModel.
 *  @param sampleModel     The SampleModel that specifies the layout.
 *  @param origin          The Point that specifies the origin.
 */
public ByteBandedRaster(SampleModel sampleModel,
                           Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码15 项目: openjdk-jdk9   文件: ShortComponentRaster.java
/**
 *  Constructs a ShortComponentRaster with the given SampleModel.
 *  The Raster's upper left corner is origin and it is the same
 *  size as the SampleModel.  A DataBuffer large enough to describe the
 *  Raster is automatically created.  SampleModel must be of type
 *  ComponentSampleModel or SinglePixelPackedSampleModel.
 *  @param sampleModel     The SampleModel that specifies the layout.
 *  @param origin          The Point that specified the origin.
 */
public ShortComponentRaster(SampleModel sampleModel, Point origin) {
    this(sampleModel,
         (DataBufferUShort) sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
/**
 *  Constructs a IntegerInterleavedRaster with the given SampleModel.
 *  The Raster's upper left corner is origin and it is the same
 *  size as the SampleModel.  A DataBuffer large enough to describe the
 *  Raster is automatically created.  SampleModel must be of type
 *  SinglePixelPackedSampleModel.
 *  @param sampleModel     The SampleModel that specifies the layout.
 *  @param origin          The Point that specified the origin.
 */
public IntegerInterleavedRaster(SampleModel sampleModel,
                                 Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码17 项目: openjdk-8-source   文件: ByteInterleavedRaster.java
/**
 * Constructs a ByteInterleavedRaster with the given SampleModel.
 * The Raster's upper left corner is origin and it is the same
 * size as the SampleModel.  A DataBuffer large enough to describe the
 * Raster is automatically created.  SampleModel must be of type
 * SinglePixelPackedSampleModel or InterleavedSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param origin          The Point that specified the origin.
 */
public ByteInterleavedRaster(SampleModel sampleModel, Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码18 项目: TencentKona-8   文件: ShortInterleavedRaster.java
/**
 *  Constructs a ShortInterleavedRaster with the given SampleModel.
 *  The Raster's upper left corner is origin and it is the same
 *  size as the SampleModel.  A DataBuffer large enough to describe the
 *  Raster is automatically created.  SampleModel must be of type
 *  PixelInterleavedSampleModel or SinglePixelPackedSampleModel.
 *  @param sampleModel     The SampleModel that specifies the layout.
 *  @param origin          The Point that specified the origin.
 */
public ShortInterleavedRaster(SampleModel sampleModel, Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码19 项目: jdk8u-jdk   文件: BytePackedRaster.java
/**
 * Constructs a BytePackedRaster with the given SampleModel.
 * The Raster's upper left corner is origin and it is the same
 * size as the SampleModel.  A DataBuffer large enough to describe the
 * Raster is automatically created.  SampleModel must be of type
 * MultiPixelPackedSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param origin          The Point that specified the origin.
 */
public BytePackedRaster(SampleModel sampleModel,
                        Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
源代码20 项目: openjdk-jdk9   文件: ByteComponentRaster.java
/**
 * Constructs a ByteComponentRaster with the given SampleModel.
 * The Raster's upper left corner is origin and it is the same
 * size as the SampleModel.  A DataBuffer large enough to describe the
 * Raster is automatically created.  SampleModel must be of type
 * SinglePixelPackedSampleModel or ComponentSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param origin          The Point that specified the origin.
 */
public ByteComponentRaster(SampleModel sampleModel, Point origin) {
    this(sampleModel,
         (DataBufferByte) sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}