2003/09/23 08:25:00
[org.ibex.core.git] / src / org / xwt / plat / GCJ.cc
index 3050a2b..f63c515 100644 (file)
@@ -14,6 +14,8 @@ extern "C" {
 #include <setjmp.h>
 #include "jpeglib.h"
 }
+#include <org/xwt/Platform.h>
+#include <org/xwt/Picture.h>
 #include <org/xwt/plat/GCJ.h>
 #include <java/io/InputStream.h>
 #include <java/io/ByteArrayInputStream.h>
@@ -79,8 +81,11 @@ void skip_input_data (j_decompress_ptr cinfo, long num_bytes) {
   }
 }
 
-void org::xwt::plat::GCJ$JPEG::nativeDecompress() {
+org::xwt::Picture* org::xwt::plat::GCJ$JPEG::_decodeJPEG(java::io::InputStream* is, jstring name) {
     struct jpeg_decompress_struct cinfo;
+    jIntArray data;
+    jint width;
+    jint height;
   
     // set up our error handler
     struct jpeg_error_mgr error_handler;
@@ -123,6 +128,7 @@ void org::xwt::plat::GCJ$JPEG::nativeDecompress() {
         throw t;
     }
     jpeg_destroy_decompress(&cinfo);
+    return org::xwt::Platform::createPicture(data, width, height);
 }
 
 // C++ new/delete operators (JvMalloc never fails)