#include <org/xwt/plat/GCJ.h>
#include <org/xwt/util/Log.h>
+#ifndef TRUE
#define TRUE 1
+#endif
using org::xwt::util::Log;
#define TRUE 1
// FEATURE - we should handle errors better than this
char msgbuf[JMSG_LENGTH_MAX];
(jerr.pub.format_message)((j_common_ptr)&cinfo, msgbuf);
- Log::log(&GCJ::class$,JvNewStringLatin1(msgbuf));
+ Log::info(&GCJ::class$,JvNewStringLatin1(msgbuf));
jpeg_destroy_decompress(&cinfo);
return;
}
p->width = cinfo.output_width;
p->height = cinfo.output_height;
- p->data = JvNewIntArray(width * height);
+ p->data = JvNewIntArray(p->width * p->height);
while (cinfo.output_scanline < cinfo.output_height) {
- JSAMPLE *dest = (JSAMPLE*) (elements(data) + cinfo.output_scanline * width);
+ JSAMPLE *dest = (JSAMPLE*) (elements(p->data) + cinfo.output_scanline * p->width);
jpeg_read_scanlines(&cinfo,&dest,1);
}
jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
- for(int i=0;i<data->length;i++)
- elements(data)[i] |= 0xff000000; // alpha channel
+ for(int i=0;i<p->data->length;i++)
+ elements(p->data)[i] |= 0xff000000; // alpha channel
}
// C++ new/delete operators (JvMalloc never fails)