harness.checkPoint("(int, int, Object, DataBuffer(Int))");
SinglePixelPackedSampleModel m1 = new SinglePixelPackedSampleModel(
DataBuffer.TYPE_INT, 2, 3, new int[] { 0xFFFF00, 0x00FFFF }
);
int[] i = new int[] { (int) 0x11111111, (int) 0x22222222, (int) 0x33333333, (int) 0x44444444, (int) 0x55555555, (int) 0x66666666 };
DataBuffer db = new DataBufferInt(i, 6);
// set a value
m1.setDataElements(0, 0, new int[] { (int) 0x77777777 }, db);
m1.setDataElements(1, 0, new int[] { (int) 0x88888888 }, db);
m1.setDataElements(0, 1, new int[] { (int) 0x99999999 }, db);
m1.setDataElements(1, 1, new int[] { (int) 0xAAAAAAAA }, db);
m1.setDataElements(0, 2, new int[] { (int) 0xBBBBBBBB }, db);
m1.setDataElements(1, 2, new int[] { (int) 0xCCCCCCCC }, db);
harness.check(db.getElem(0), 0x77777777);
harness.check(db.getElem(1), 0x88888888);
harness.check(db.getElem(2), 0x99999999);
harness.check(db.getElem(3), 0xAAAAAAAA);
harness.check(db.getElem(4), 0xBBBBBBBB);
harness.check(db.getElem(5), 0xCCCCCCCC);
// set a value with non-standard scanline stride
SinglePixelPackedSampleModel m2 = new SinglePixelPackedSampleModel(
DataBuffer.TYPE_INT, 2, 2, 3, new int[] { 0xFFFF00, 0x00FFFF }
);
m2.setDataElements(0, 0, new int[] { (int) 0x11111111 }, db);
m2.setDataElements(1, 0, new int[] { (int) 0x22222222 }, db);
m2.setDataElements(0, 1, new int[] { (int) 0x33333333 }, db);
m2.setDataElements(1, 1, new int[] { (int) 0x44444444 }, db);
harness.check(db.getElem(0), 0x11111111);
harness.check(db.getElem(1), 0x22222222);
harness.check(db.getElem(3), 0x33333333);
harness.check(db.getElem(4), 0x44444444);
// set a value with x < 0
try
{
m1.setDataElements(-1, 0, new int[] { (int) 0x9999 }, db);