#include <java/io/ByteArrayInputStream.h>
#include <java/lang/RuntimeException.h>
#include <org/xwt/plat/GCJ.h>
-#include <org/xwt/plat/GCJ$JPEG.h>
typedef struct {
struct jpeg_source_mgr pub;
+ /* FIXME
org::xwt::plat::GCJ$JPEG* myself;
+ */
} source_manager;
void jpeg_error_handler (j_common_ptr cinfo) {
void init_source (j_decompress_ptr cinfo) { }
boolean fill_input_buffer (j_decompress_ptr cinfo) {
+ /* FIXME
source_manager* src = (source_manager*)cinfo->src;
jint nbytes = src->myself->is->read(src->myself->buffer, 0, INPUT_BUF_SIZE);
if (nbytes <= 0) {
}
src->pub.next_input_byte = (JOCTET*)elements(src->myself->buffer);
src->pub.bytes_in_buffer = nbytes;
+ */
return 1;
}
}
}
-org::xwt::Picture* org::xwt::plat::GCJ$JPEG::_decodeJPEG(java::io::InputStream* is, jstring name) {
+org::xwt::Picture* org::xwt::plat::GCJ::_decodeJPEG(java::io::InputStream* is, jstring name) {
struct jpeg_decompress_struct cinfo;
- jIntArray data;
+ jintArray data;
jint width;
jint height;
jpeg_create_decompress(&cinfo);
try {
source_manager src;
+ /*
buffer = JvNewByteArray(INPUT_BUF_SIZE);
+ */
src.pub.init_source = init_source;
src.pub.fill_input_buffer = fill_input_buffer;
src.pub.skip_input_data = skip_input_data;
src.pub.resync_to_restart = jpeg_resync_to_restart;
src.pub.term_source = term_source;
+ /*
src.myself = this;
src.pub.next_input_byte = (JOCTET*)elements(buffer);
+ */
src.pub.bytes_in_buffer = 0;
cinfo.src = (jpeg_source_mgr*)&src;