56 */
57 int pixelBitStride;
58
59 /** The bit mask for extracting the pixel. */
60 int bitMask;
61
62 /** The image data array. */
63 byte[] data;
64
65 /** 8 minus the pixel bit stride. */
66 int shiftOffset;
67
68 int type;
69
70 /** A cached copy of minX + width for use in bounds checks. */
71 private int maxX;
72
73 /** A cached copy of minY + height for use in bounds checks. */
74 private int maxY;
75
76 static private native void initIDs();
77 static {
78 /* ensure that the necessary native libraries are loaded */
79 NativeLibLoader.loadLibraries();
80 initIDs();
81 }
82
83 /**
84 * Constructs a BytePackedRaster with the given SampleModel.
85 * The Raster's upper left corner is origin and it is the same
86 * size as the SampleModel. A DataBuffer large enough to describe the
87 * Raster is automatically created. SampleModel must be of type
88 * MultiPixelPackedSampleModel.
89 * @param sampleModel The SampleModel that specifies the layout.
90 * @param origin The Point that specified the origin.
91 */
92 public BytePackedRaster(SampleModel sampleModel,
93 Point origin) {
94 this(sampleModel,
95 sampleModel.createDataBuffer(),
96 new Rectangle(origin.x,
|
56 */
57 int pixelBitStride;
58
59 /** The bit mask for extracting the pixel. */
60 int bitMask;
61
62 /** The image data array. */
63 byte[] data;
64
65 /** 8 minus the pixel bit stride. */
66 int shiftOffset;
67
68 int type;
69
70 /** A cached copy of minX + width for use in bounds checks. */
71 private int maxX;
72
73 /** A cached copy of minY + height for use in bounds checks. */
74 private int maxY;
75
76 private static native void initIDs();
77 static {
78 /* ensure that the necessary native libraries are loaded */
79 NativeLibLoader.loadLibraries();
80 initIDs();
81 }
82
83 /**
84 * Constructs a BytePackedRaster with the given SampleModel.
85 * The Raster's upper left corner is origin and it is the same
86 * size as the SampleModel. A DataBuffer large enough to describe the
87 * Raster is automatically created. SampleModel must be of type
88 * MultiPixelPackedSampleModel.
89 * @param sampleModel The SampleModel that specifies the layout.
90 * @param origin The Point that specified the origin.
91 */
92 public BytePackedRaster(SampleModel sampleModel,
93 Point origin) {
94 this(sampleModel,
95 sampleModel.createDataBuffer(),
96 new Rectangle(origin.x,
|