harness.checkPoint("(int, int, Object, DataBuffer(UShort))");
SinglePixelPackedSampleModel m1 = new SinglePixelPackedSampleModel(
DataBuffer.TYPE_USHORT, 2, 3, new int[] { 0xFF00, 0x00FF }
);
short[] s = new short[] { (short) 0x1111, (short) 0x2222, (short) 0x3333, (short) 0x4444, (short) 0x5555, (short) 0x6666 };
DataBuffer db = new DataBufferUShort(s, 6);
// set a value
m1.setPixel(0, 0, new int[] { 0x00CC, 0x0077 }, db);
m1.setPixel(1, 0, new int[] { 0x00BB, 0x0088 }, db);
m1.setPixel(0, 1, new int[] { 0x00AA, 0x0099 }, db);
m1.setPixel(1, 1, new int[] { 0x0099, 0x00AA }, db);
m1.setPixel(0, 2, new int[] { 0x0088, 0x00BB }, db);
m1.setPixel(1, 2, new int[] { 0x0077, 0x00CC }, db);
harness.check(db.getElem(0), 0xCC77);
harness.check(db.getElem(1), 0xBB88);
harness.check(db.getElem(2), 0xAA99);
harness.check(db.getElem(3), 0x99AA);
harness.check(db.getElem(4), 0x88BB);
harness.check(db.getElem(5), 0x77CC);
// set a value with non-standard scanline stride
SinglePixelPackedSampleModel m2 = new SinglePixelPackedSampleModel(
DataBuffer.TYPE_USHORT, 2, 2, 3, new int[] { 0xFF00, 0x00FF }
);
m2.setPixel(0, 0, new int[] { 0x0044, 0x0011 }, db);
m2.setPixel(1, 0, new int[] { 0x0033, 0x0022 }, db);
m2.setPixel(0, 1, new int[] { 0x0022, 0x0033 }, db);
m2.setPixel(1, 1, new int[] { 0x0011, 0x0044 }, db);
harness.check(db.getElem(0), 0x4411);
harness.check(db.getElem(1), 0x3322);
harness.check(db.getElem(3), 0x2233);
harness.check(db.getElem(4), 0x1144);
// set a value with x < 0
try
{
m1.setPixel(-1, 0, new int[] { 0x10, 0x01 }, db);