harness.checkPoint("(int, int, int, int, DataBuffer(Int))");
SinglePixelPackedSampleModel m1 = new SinglePixelPackedSampleModel(
DataBuffer.TYPE_INT, 2, 3, new int[] { 0xFFFF0000, 0x0000FFFF }
);
int[] i = new int[] { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666 };
DataBuffer db = new DataBufferInt(i, 6);
// set a value
m1.setSample(0, 0, 0, 0x00CC, db);
m1.setSample(1, 0, 0, 0x00BB, db);
m1.setSample(0, 1, 0, 0x00AA, db);
m1.setSample(1, 1, 0, 0x0099, db);
m1.setSample(0, 2, 0, 0x0088, db);
m1.setSample(1, 2, 0, 0x0077, db);
m1.setSample(0, 0, 1, 0x0077, db);
m1.setSample(1, 0, 1, 0x0088, db);
m1.setSample(0, 1, 1, 0x0099, db);
m1.setSample(1, 1, 1, 0x00AA, db);
m1.setSample(0, 2, 1, 0x00BB, db);
m1.setSample(1, 2, 1, 0x00CC, db);
harness.check(db.getElem(0), 0x00CC0077);
harness.check(db.getElem(1), 0x00BB0088);
harness.check(db.getElem(2), 0x00AA0099);
harness.check(db.getElem(3), 0x009900AA);
harness.check(db.getElem(4), 0x008800BB);
harness.check(db.getElem(5), 0x007700CC);
// set a value with non-standard scanline stride
SinglePixelPackedSampleModel m2 = new SinglePixelPackedSampleModel(
DataBuffer.TYPE_INT, 2, 2, 3, new int[] { 0xFFFF0000, 0x0000FFFF }
);
m2.setSample(0, 0, 0, 0x0044, db);
m2.setSample(1, 0, 0, 0x0033, db);
m2.setSample(0, 1, 0, 0x0022, db);
m2.setSample(1, 1, 0, 0x0011, db);
m2.setSample(0, 0, 1, 0x0011, db);
m2.setSample(1, 0, 1, 0x0022, db);
m2.setSample(0, 1, 1, 0x0033, db);
m2.setSample(1, 1, 1, 0x0044, db);
harness.check(db.getElem(0), 0x00440011);
harness.check(db.getElem(1), 0x00330022);
harness.check(db.getElem(3), 0x00220033);
harness.check(db.getElem(4), 0x00110044);
// set a value with x < 0
try
{
m1.setSample(-1, 0, 0, 0x10, db);