Warning: session_start(): open(/var/lib/php/sessions/sess_u5ias4gdtc4ijq7gi3gh0u98ne, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static L imagePixelsToRGBAWithSize_virtualIntList(BufferedImage etc img) {
if (img == null) null;
int w = img.getWidth(), h = img.getHeight(), n = w*h+2;
ret new RandomAccessAbstractList() {
public int size() { ret n; }
public Int get(int i) {
if (i == 0) ret w;
if (i == 1) ret h;
i -= 2;
ret img.getRGB(i % w, i / h);
}
public Int set(int i, Int val) {
if (i < 2) fail();
i -= 2;
int old = img.getRGB(i % w, i / h);
if (old != (int) val)
img.setRGB(i % w, i / h, val);
ret old;
}
};
// store width and height
intToBytes_inArray_littleEndian(w, out, 0);
intToBytes_inArray_littleEndian(h, out, 4);
// store pixels
copyIntArrayToByteArray_littleEndian(pixelsOfBufferedImage(img), out, 8);
ret out;
}