JAL-1807 - Bob's last(?) before leaving Dundee -- adds fast file loading
[jalviewjs.git] / src / swingjs / JSImage.java
index 1501688..0de3895 100644 (file)
@@ -8,21 +8,15 @@ import java.awt.image.ImageObserver;
 public class JSImage extends BufferedImage {
        // a BufferedImage in name only, actually;
        int typeRequested;
-       int[] pix;  // not used in Java, but may be used in JavaScript
+       int[] pix;
        public DOMNode _imgNode; // used by JSGraphics2D directly
        private int width, height;
        
-       public JSImage() {
-               super(1,1, TYPE_INT_ARGB);
-               
-       }
-
-       public JSImage setData(int width, int height, int[] argb) {
-               pix = argb;
+       public JSImage(int[] argb, int width, int height) {
+               super(width, height, TYPE_INT_ARGB);
                this.width = width;
                this.height = height;
-               getColorModel().createCompatibleWritableRaster(width, height);
-               return this;
+               pix = argb;
        }
        
        /**