ImageData imageData = new ImageData(cinfo.output_width, cinfo.output_height, palette.isDirect ? 24 : 8, palette, 4, data);
ImageData imageData = ImageData.internal_new( cinfo.output_width, cinfo.output_height, palette.isDirect ? 24 : 8, palette, scanlinePad, data, 0, null, null, -1, -1, SWT.IMAGE_JPEG, 0, 0, 0, 0);
static ImageData[] loadFromByteStream(InputStream inputStream) {	jpeg_decompress_struct cinfo = new jpeg_decompress_struct();	cinfo.inputStream = inputStream;	jpeg_create_decompress(cinfo);	jpeg_read_header(cinfo, true);	jpeg_start_decompress(cinfo);	PaletteData palette = null;	switch (cinfo.out_color_space) {		case JCS_RGB:			palette = new PaletteData(0xFF, 0xFF00, 0xFF0000);			break;		case JCS_GRAYSCALE:			RGB[] colors = new RGB[256];			for (int i = 0; i < colors.length; i++) {				colors[i] = new RGB(i, i, i);			}			palette = new PaletteData(colors);			break;		default:			error();	}	int row_stride = (((cinfo.output_width * cinfo.out_color_components * 8 + 7) / 8) + 3) / 4 * 4;	byte[][] buffer = new byte[1][row_stride];	byte[] data = new byte[row_stride * cinfo.output_height];	while (cinfo.output_scanline < cinfo.output_height) {		int offset = row_stride * cinfo.output_scanline;		jpeg_read_scanlines(cinfo, buffer, 1);		System.arraycopy(buffer[0], 0, data, offset, row_stride);	}	jpeg_finish_decompress(cinfo);	ImageData imageData = new ImageData(cinfo.output_width, cinfo.output_height, palette.isDirect ? 24 : 8, palette, 4, data);	jpeg_destroy_decompress(cinfo);	return new ImageData[]{imageData};}