home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / sun / awt / image / ImageRepresentation.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  9.9 KB  |  721 lines

  1. package sun.awt.image;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Graphics;
  5. import java.awt.Graphics2D;
  6. import java.awt.Point;
  7. import java.awt.Rectangle;
  8. import java.awt.geom.AffineTransform;
  9. import java.awt.image.BufferedImage;
  10. import java.awt.image.ColorModel;
  11. import java.awt.image.DataBufferInt;
  12. import java.awt.image.DirectColorModel;
  13. import java.awt.image.ImageConsumer;
  14. import java.awt.image.ImageObserver;
  15. import java.awt.image.IndexColorModel;
  16. import java.awt.image.Raster;
  17. import java.awt.image.WritableRaster;
  18. import java.util.Hashtable;
  19.  
  20. public class ImageRepresentation extends ImageWatched implements ImageConsumer {
  21.    InputStreamImageSource src;
  22.    Image image;
  23.    int tag;
  24.    long pData;
  25.    int width = -1;
  26.    int height = -1;
  27.    int hints;
  28.    int availinfo;
  29.    Rectangle newbits;
  30.    BufferedImage bimage;
  31.    WritableRaster biRaster;
  32.    ColorModel cmodel;
  33.    ColorModel srcModel = null;
  34.    int[] srcLUT = null;
  35.    int srcLUTtransIndex = -1;
  36.    int numSrcLUT = 0;
  37.    boolean forceCMhint;
  38.    int sstride;
  39.    boolean isDefaultBI = false;
  40.    boolean isSameCM = false;
  41.    static boolean s_useNative;
  42.    private boolean consuming = false;
  43.    private int numWaiters;
  44.  
  45.    private static native void initIDs();
  46.  
  47.    public ImageRepresentation(Image var1, ColorModel var2, boolean var3) {
  48.       this.image = var1;
  49.       if (this.image.getSource() instanceof InputStreamImageSource) {
  50.          this.src = (InputStreamImageSource)this.image.getSource();
  51.       }
  52.  
  53.       this.setColorModel(var2);
  54.       this.forceCMhint = var3;
  55.    }
  56.  
  57.    public synchronized void reconstruct(int var1) {
  58.       if (this.src != null) {
  59.          this.src.checkSecurity((Object)null, false);
  60.       }
  61.  
  62.       int var2 = var1 & ~this.availinfo;
  63.       if ((this.availinfo & 64) == 0 && var2 != 0) {
  64.          ++this.numWaiters;
  65.  
  66.          try {
  67.             this.startProduction();
  68.  
  69.             for(int var10 = var1 & ~this.availinfo; (this.availinfo & 64) == 0 && var10 != 0; var10 = var1 & ~this.availinfo) {
  70.                try {
  71.                   this.wait();
  72.                } catch (InterruptedException var8) {
  73.                   Thread.currentThread().interrupt();
  74.                   return;
  75.                }
  76.             }
  77.  
  78.          } finally {
  79.             this.decrementWaiters();
  80.          }
  81.       }
  82.    }
  83.  
  84.    public void setDimensions(int var1, int var2) {
  85.       if (this.src != null) {
  86.          this.src.checkSecurity((Object)null, false);
  87.       }
  88.  
  89.       this.image.setDimensions(var1, var2);
  90.       ((ImageWatched)this).newInfo(this.image, 3, 0, 0, var1, var2);
  91.       if (var1 > 0 && var2 > 0) {
  92.          this.width = var1;
  93.          this.height = var2;
  94.          this.availinfo |= 3;
  95.          if (this.bimage == null && this.cmodel != null) {
  96.             this.createBufferedImage();
  97.          }
  98.  
  99.       } else {
  100.          this.imageComplete(1);
  101.       }
  102.    }
  103.  
  104.    public int getWidth() {
  105.       return this.width;
  106.    }
  107.  
  108.    public int getHeight() {
  109.       return this.height;
  110.    }
  111.  
  112.    ColorModel getColorModel() {
  113.       return this.cmodel;
  114.    }
  115.  
  116.    BufferedImage getBufferedImage() {
  117.       return this.bimage;
  118.    }
  119.  
  120.    public void setProperties(Hashtable var1) {
  121.       if (this.src != null) {
  122.          this.src.checkSecurity((Object)null, false);
  123.       }
  124.  
  125.       this.image.setProperties(var1);
  126.       ((ImageWatched)this).newInfo(this.image, 4, 0, 0, 0, 0);
  127.    }
  128.  
  129.    public void setColorModel(ColorModel var1) {
  130.       if (this.src != null) {
  131.          this.src.checkSecurity((Object)null, false);
  132.       }
  133.  
  134.       this.srcModel = var1;
  135.       if (var1 instanceof IndexColorModel) {
  136.          if (var1.getTransparency() == 3) {
  137.             this.cmodel = ColorModel.getRGBdefault();
  138.             this.srcLUT = null;
  139.          } else {
  140.             IndexColorModel var2 = (IndexColorModel)var1;
  141.             this.numSrcLUT = var2.getMapSize();
  142.             this.srcLUT = new int[Math.max(this.numSrcLUT, 256)];
  143.             var2.getRGBs(this.srcLUT);
  144.             this.srcLUTtransIndex = var2.getTransparentPixel();
  145.             this.cmodel = var1;
  146.          }
  147.       } else if (this.cmodel == null) {
  148.          this.cmodel = var1;
  149.          this.srcLUT = null;
  150.       } else if (var1 instanceof DirectColorModel) {
  151.          DirectColorModel var3 = (DirectColorModel)var1;
  152.          if (var3.getRedMask() == 16711680 && var3.getGreenMask() == 65280 && var3.getBlueMask() == 255) {
  153.             this.cmodel = var1;
  154.             this.srcLUT = null;
  155.          }
  156.       }
  157.  
  158.       this.isSameCM = this.cmodel == var1;
  159.       if ((this.availinfo & 3) != 0) {
  160.          this.createBufferedImage();
  161.       }
  162.  
  163.    }
  164.  
  165.    void createBufferedImage() {
  166.       this.isDefaultBI = false;
  167.  
  168.       try {
  169.          this.biRaster = this.cmodel.createCompatibleWritableRaster(this.width, this.height);
  170.          this.bimage = new BufferedImage(this.cmodel, this.biRaster, this.cmodel.isAlphaPremultiplied(), (Hashtable)null);
  171.       } catch (Exception var3) {
  172.          this.cmodel = ColorModel.getRGBdefault();
  173.          this.biRaster = this.cmodel.createCompatibleWritableRaster(this.width, this.height);
  174.          this.bimage = new BufferedImage(this.cmodel, this.biRaster, false, (Hashtable)null);
  175.       }
  176.  
  177.       int var1 = this.bimage.getType();
  178.       if (this.cmodel != ColorModel.getRGBdefault() && var1 != 1 && var1 != 3) {
  179.          if (this.cmodel instanceof DirectColorModel) {
  180.             DirectColorModel var2 = (DirectColorModel)this.cmodel;
  181.             if (var2.getRedMask() == 16711680 && var2.getGreenMask() == 65280 && var2.getBlueMask() == 255) {
  182.                this.isDefaultBI = true;
  183.             }
  184.          }
  185.       } else {
  186.          this.isDefaultBI = true;
  187.       }
  188.  
  189.    }
  190.  
  191.    private void convertToRGB() {
  192.       int var1 = this.bimage.getWidth();
  193.       int var2 = this.bimage.getHeight();
  194.       int var3 = var1 * var2;
  195.       int[] var4 = new int[var3];
  196.       if (this.cmodel instanceof IndexColorModel && this.biRaster instanceof ByteComponentRaster && this.biRaster.getNumDataElements() == 1) {
  197.          ByteComponentRaster var9 = (ByteComponentRaster)this.biRaster;
  198.          byte[] var11 = var9.getDataStorage();
  199.          int var13 = var9.getDataOffset(0);
  200.  
  201.          for(int var14 = 0; var14 < var3; ++var14) {
  202.             var4[var14] = this.srcLUT[var11[var13 + var14] & 255];
  203.          }
  204.       } else {
  205.          Object var5 = null;
  206.          int var6 = 0;
  207.  
  208.          for(int var7 = 0; var7 < var2; ++var7) {
  209.             for(int var8 = 0; var8 < var1; ++var8) {
  210.                var5 = this.biRaster.getDataElements(var8, var7, var5);
  211.                var4[var6++] = this.cmodel.getRGB(var5);
  212.             }
  213.          }
  214.       }
  215.  
  216.       this.isSameCM = false;
  217.       this.cmodel = ColorModel.getRGBdefault();
  218.       DataBufferInt var10 = new DataBufferInt(var4, var4.length);
  219.       int[] var12 = new int[]{16711680, 65280, 255, -16777216};
  220.       this.biRaster = Raster.createPackedRaster(var10, var1, var2, var1, var12, (Point)null);
  221.       this.bimage = new BufferedImage(this.cmodel, this.biRaster, this.cmodel.isAlphaPremultiplied(), (Hashtable)null);
  222.       this.srcLUT = null;
  223.       this.isDefaultBI = true;
  224.    }
  225.  
  226.    public void setHints(int var1) {
  227.       if (this.src != null) {
  228.          this.src.checkSecurity((Object)null, false);
  229.       }
  230.  
  231.       this.hints = var1;
  232.    }
  233.  
  234.    public native void setICMpixels(int var1, int var2, int var3, int var4, int[] var5, byte[] var6, int var7, int var8, IntegerComponentRaster var9);
  235.  
  236.    public native void setBytePixels(int var1, int var2, int var3, int var4, byte[] var5, int var6, int var7, ByteComponentRaster var8, int var9);
  237.  
  238.    public native int setDiffICM(int var1, int var2, int var3, int var4, int[] var5, int var6, int var7, IndexColorModel var8, byte[] var9, int var10, int var11, ByteComponentRaster var12, int var13);
  239.  
  240.    public void setPixels(int var1, int var2, int var3, int var4, ColorModel var5, byte[] var6, int var7, int var8) {
  241.       int var9 = var7;
  242.       Object var11 = null;
  243.       if (this.src != null) {
  244.          this.src.checkSecurity((Object)null, false);
  245.       }
  246.  
  247.       synchronized(this) {
  248.          if (this.bimage == null) {
  249.             if (this.cmodel == null) {
  250.                this.cmodel = var5;
  251.             }
  252.  
  253.             this.createBufferedImage();
  254.          } else if (this.isSameCM && this.cmodel != var5 && this.srcLUT != null && var5 instanceof IndexColorModel && this.biRaster instanceof ByteComponentRaster) {
  255.             IndexColorModel var13 = (IndexColorModel)var5;
  256.             ByteComponentRaster var14 = (ByteComponentRaster)this.biRaster;
  257.             int var15 = this.numSrcLUT;
  258.             if (this.setDiffICM(var1, var2, var3, var4, this.srcLUT, this.srcLUTtransIndex, this.numSrcLUT, var13, var6, var7, var8, var14, var14.getDataOffset(0)) != 0) {
  259.                if (var15 != this.numSrcLUT) {
  260.                   boolean var34 = ((ColorModel)var13).hasAlpha();
  261.                   if (this.srcLUTtransIndex != -1) {
  262.                      var34 = true;
  263.                   }
  264.  
  265.                   int var36 = ((ColorModel)var13).getPixelSize();
  266.                   var13 = new IndexColorModel(var36, this.numSrcLUT, this.srcLUT, 0, var34, this.srcLUTtransIndex, var36 > 8 ? 1 : 0);
  267.                   this.cmodel = var13;
  268.                   this.bimage = new BufferedImage(var13, var14, false, (Hashtable)null);
  269.                }
  270.  
  271.                return;
  272.             }
  273.  
  274.             this.convertToRGB();
  275.          }
  276.  
  277.          if (this.isDefaultBI) {
  278.             IntegerComponentRaster var29 = (IntegerComponentRaster)this.biRaster;
  279.             if (this.srcLUT != null && var5 instanceof IndexColorModel) {
  280.                if (var5 != this.srcModel) {
  281.                   ((IndexColorModel)var5).getRGBs(this.srcLUT);
  282.                   this.srcModel = var5;
  283.                }
  284.  
  285.                if (s_useNative) {
  286.                   this.setICMpixels(var1, var2, var3, var4, this.srcLUT, var6, var7, var8, var29);
  287.                } else {
  288.                   int[] var32 = new int[var3 * var4];
  289.                   int var33 = 0;
  290.  
  291.                   for(int var35 = 0; var35 < var4; var9 += var8) {
  292.                      int var23 = var9;
  293.  
  294.                      for(int var18 = 0; var18 < var3; ++var18) {
  295.                         var32[var33++] = this.srcLUT[var6[var23++] & 255];
  296.                      }
  297.  
  298.                      ++var35;
  299.                   }
  300.  
  301.                   var29.setDataElements(var1, var2, var3, var4, var32);
  302.                }
  303.             } else {
  304.                int[] var31 = new int[var3];
  305.  
  306.                for(int var16 = var2; var16 < var2 + var4; var9 += var8) {
  307.                   int var22 = var9;
  308.  
  309.                   for(int var17 = 0; var17 < var3; ++var17) {
  310.                      var31[var17] = var5.getRGB(var6[var22++] & 255);
  311.                   }
  312.  
  313.                   var29.setDataElements(var1, var16, var3, 1, var31);
  314.                   ++var16;
  315.                }
  316.  
  317.                this.availinfo |= 8;
  318.             }
  319.          } else if (this.cmodel == var5 && this.biRaster instanceof ByteComponentRaster && this.biRaster.getNumDataElements() == 1) {
  320.             ByteComponentRaster var25 = (ByteComponentRaster)this.biRaster;
  321.             if (var3 * var4 > 200) {
  322.                if (var8 == var3) {
  323.                   var25.putByteData(var1, var2, var3, var4, var6);
  324.                } else {
  325.                   byte[] var28 = new byte[var3];
  326.                   int var21 = var7;
  327.  
  328.                   for(int var30 = var2; var30 < var2 + var4; ++var30) {
  329.                      System.arraycopy(var6, var21, var28, 0, var3);
  330.                      var25.putByteData(var1, var30, var3, 1, var28);
  331.                      var21 += var8;
  332.                   }
  333.                }
  334.             } else {
  335.                this.setBytePixels(var1, var2, var3, var4, var6, var7, var8, var25, var25.getDataOffset(0));
  336.             }
  337.          } else {
  338.             for(int var24 = var2; var24 < var2 + var4; var9 += var8) {
  339.                int var10 = var9;
  340.  
  341.                for(int var27 = var1; var27 < var1 + var3; ++var27) {
  342.                   this.bimage.setRGB(var27, var24, var5.getRGB(var6[var10++] & 255));
  343.                }
  344.  
  345.                ++var24;
  346.             }
  347.  
  348.             this.availinfo |= 8;
  349.          }
  350.       }
  351.  
  352.       if ((this.availinfo & 16) == 0) {
  353.          ((ImageWatched)this).newInfo(this.image, 8, var1, var2, var3, var4);
  354.       }
  355.  
  356.    }
  357.  
  358.    public void setPixels(int var1, int var2, int var3, int var4, ColorModel var5, int[] var6, int var7, int var8) {
  359.       int var9 = var7;
  360.       if (this.src != null) {
  361.          this.src.checkSecurity((Object)null, false);
  362.       }
  363.  
  364.       synchronized(this) {
  365.          if (this.bimage == null) {
  366.             if (this.cmodel == null) {
  367.                this.cmodel = var5;
  368.             }
  369.  
  370.             this.createBufferedImage();
  371.          }
  372.  
  373.          int[] var12 = new int[var3];
  374.          if (this.cmodel instanceof IndexColorModel) {
  375.             this.convertToRGB();
  376.          }
  377.  
  378.          if (var5 == this.cmodel && this.biRaster instanceof IntegerComponentRaster) {
  379.             IntegerComponentRaster var26 = (IntegerComponentRaster)this.biRaster;
  380.             if (var7 == 0 && var8 == var3) {
  381.                var26.setDataElements(var1, var2, var3, var4, var6);
  382.             } else {
  383.                for(int var24 = var2; var24 < var2 + var4; var9 += var8) {
  384.                   System.arraycopy(var6, var9, var12, 0, var3);
  385.                   var26.setDataElements(var1, var24, var3, 1, var12);
  386.                   ++var24;
  387.                }
  388.             }
  389.          } else {
  390.             if (var5.getTransparency() != 1 && this.cmodel.getTransparency() == 1) {
  391.                this.convertToRGB();
  392.             }
  393.  
  394.             if (this.isDefaultBI) {
  395.                IntegerComponentRaster var25 = (IntegerComponentRaster)this.biRaster;
  396.                int[] var27 = var25.getDataStorage();
  397.                if (this.cmodel.equals(var5)) {
  398.                   int var17 = var25.getScanlineStride();
  399.                   int var18 = var2 * var17 + var1;
  400.  
  401.                   for(int var22 = 0; var22 < var4; var9 += var8) {
  402.                      System.arraycopy(var6, var9, var27, var18, var3);
  403.                      var18 += var17;
  404.                      ++var22;
  405.                   }
  406.                } else {
  407.                   for(int var23 = var2; var23 < var2 + var4; var9 += var8) {
  408.                      int var21 = var9;
  409.  
  410.                      for(int var28 = 0; var28 < var3; ++var28) {
  411.                         var12[var28] = var5.getRGB(var6[var21++]);
  412.                      }
  413.  
  414.                      var25.setDataElements(var1, var23, var3, 1, var12);
  415.                      ++var23;
  416.                   }
  417.                }
  418.  
  419.                this.availinfo |= 8;
  420.             } else {
  421.                Object var15 = null;
  422.  
  423.                for(int var13 = var2; var13 < var2 + var4; var9 += var8) {
  424.                   int var10 = var9;
  425.  
  426.                   for(int var16 = var1; var16 < var1 + var3; ++var16) {
  427.                      int var14 = var5.getRGB(var6[var10++]);
  428.                      var15 = this.cmodel.getDataElements(var14, var15);
  429.                      this.biRaster.setDataElements(var16, var13, var15);
  430.                   }
  431.  
  432.                   ++var13;
  433.                }
  434.  
  435.                this.availinfo |= 8;
  436.             }
  437.          }
  438.       }
  439.  
  440.       if ((this.availinfo & 16) == 0) {
  441.          ((ImageWatched)this).newInfo(this.image, 8, var1, var2, var3, var4);
  442.       }
  443.  
  444.    }
  445.  
  446.    public BufferedImage getOpaqueRGBImage() {
  447.       if (this.bimage.getType() != 2) {
  448.          return this.bimage;
  449.       } else {
  450.          int var1 = this.bimage.getWidth();
  451.          int var2 = this.bimage.getHeight();
  452.          int var3 = var1 * var2;
  453.          DataBufferInt var4 = (DataBufferInt)this.biRaster.getDataBuffer();
  454.          int[] var5 = var4.getData();
  455.  
  456.          for(int var6 = 0; var6 < var3; ++var6) {
  457.             if (var5[var6] >>> 24 != 255) {
  458.                return this.bimage;
  459.             }
  460.          }
  461.  
  462.          DirectColorModel var7 = new DirectColorModel(24, 16711680, 65280, 255);
  463.          int[] var8 = new int[]{16711680, 65280, 255};
  464.          WritableRaster var9 = Raster.createPackedRaster(var4, var1, var2, var1, var8, (Point)null);
  465.  
  466.          try {
  467.             BufferedImage var10 = new BufferedImage(var7, var9, false, (Hashtable)null);
  468.             return var10;
  469.          } catch (Exception var11) {
  470.             return this.bimage;
  471.          }
  472.       }
  473.    }
  474.  
  475.    public void imageComplete(int var1) {
  476.       if (this.src != null) {
  477.          this.src.checkSecurity((Object)null, false);
  478.       }
  479.  
  480.       boolean var2;
  481.       short var3;
  482.       switch (var1) {
  483.          case 1:
  484.             this.image.addInfo(64);
  485.             var2 = true;
  486.             var3 = 64;
  487.             this.dispose();
  488.             break;
  489.          case 2:
  490.             var2 = false;
  491.             var3 = 16;
  492.             break;
  493.          case 3:
  494.             var2 = true;
  495.             var3 = 32;
  496.             break;
  497.          case 4:
  498.          default:
  499.             var2 = true;
  500.             var3 = 128;
  501.       }
  502.  
  503.       synchronized(this) {
  504.          if (var2) {
  505.             this.image.getSource().removeConsumer(this);
  506.             this.consuming = false;
  507.             this.newbits = null;
  508.             if (this.bimage != null) {
  509.                this.bimage = this.getOpaqueRGBImage();
  510.             }
  511.          }
  512.  
  513.          this.availinfo |= var3;
  514.          this.notifyAll();
  515.       }
  516.  
  517.       ((ImageWatched)this).newInfo(this.image, var3, 0, 0, this.width, this.height);
  518.       this.image.infoDone(var1);
  519.    }
  520.  
  521.    void startProduction() {
  522.       if (!this.consuming) {
  523.          this.consuming = true;
  524.          this.image.getSource().startProduction(this);
  525.       }
  526.  
  527.    }
  528.  
  529.    private synchronized void checkConsumption() {
  530.       if (super.watchers == null && this.numWaiters == 0 && (this.availinfo & 32) == 0) {
  531.          this.dispose();
  532.       }
  533.  
  534.    }
  535.  
  536.    public synchronized void removeWatcher(ImageObserver var1) {
  537.       super.removeWatcher(var1);
  538.       this.checkConsumption();
  539.    }
  540.  
  541.    private synchronized void decrementWaiters() {
  542.       --this.numWaiters;
  543.       this.checkConsumption();
  544.    }
  545.  
  546.    public boolean prepare(ImageObserver var1) {
  547.       if (this.src != null) {
  548.          this.src.checkSecurity((Object)null, false);
  549.       }
  550.  
  551.       if ((this.availinfo & 64) != 0) {
  552.          if (var1 != null) {
  553.             var1.imageUpdate(this.image, 192, -1, -1, -1, -1);
  554.          }
  555.  
  556.          return false;
  557.       } else {
  558.          boolean var2 = (this.availinfo & 32) != 0;
  559.          if (!var2) {
  560.             ((ImageWatched)this).addWatcher(var1);
  561.             this.startProduction();
  562.             var2 = (this.availinfo & 32) != 0;
  563.          }
  564.  
  565.          return var2;
  566.       }
  567.    }
  568.  
  569.    public int check(ImageObserver var1) {
  570.       if (this.src != null) {
  571.          this.src.checkSecurity((Object)null, false);
  572.       }
  573.  
  574.       if ((this.availinfo & 96) == 0) {
  575.          ((ImageWatched)this).addWatcher(var1);
  576.       }
  577.  
  578.       return this.availinfo;
  579.    }
  580.  
  581.    public boolean drawToBufImage(Graphics var1, Image var2, int var3, int var4, Color var5, ImageObserver var6) {
  582.       if (this.src != null) {
  583.          this.src.checkSecurity((Object)null, false);
  584.       }
  585.  
  586.       if ((this.availinfo & 64) != 0) {
  587.          if (var6 != null) {
  588.             var6.imageUpdate(this.image, 192, -1, -1, -1, -1);
  589.          }
  590.  
  591.          return false;
  592.       } else {
  593.          boolean var7 = (this.availinfo & 32) != 0;
  594.          boolean var8 = (this.availinfo & 128) != 0;
  595.          if (!var7 && !var8) {
  596.             ((ImageWatched)this).addWatcher(var6);
  597.             this.startProduction();
  598.             var7 = (this.availinfo & 32) != 0;
  599.          }
  600.  
  601.          if (var7 || 0 != (this.availinfo & 16)) {
  602.             var1.drawImage(this.bimage, var3, var4, var5, (ImageObserver)null);
  603.          }
  604.  
  605.          return var7;
  606.       }
  607.    }
  608.  
  609.    public boolean drawToBufImage(Graphics var1, Image var2, int var3, int var4, int var5, int var6, Color var7, ImageObserver var8) {
  610.       if (this.src != null) {
  611.          this.src.checkSecurity((Object)null, false);
  612.       }
  613.  
  614.       if ((this.availinfo & 64) != 0) {
  615.          if (var8 != null) {
  616.             var8.imageUpdate(this.image, 192, -1, -1, -1, -1);
  617.          }
  618.  
  619.          return false;
  620.       } else {
  621.          boolean var9 = (this.availinfo & 32) != 0;
  622.          boolean var10 = (this.availinfo & 128) != 0;
  623.          if (!var9 && !var10) {
  624.             ((ImageWatched)this).addWatcher(var8);
  625.             this.startProduction();
  626.             var9 = (this.availinfo & 32) != 0;
  627.          }
  628.  
  629.          if (var9 || 0 != (this.availinfo & 16)) {
  630.             var1.drawImage(this.bimage, var3, var4, var5, var6, var7, (ImageObserver)null);
  631.          }
  632.  
  633.          return var9;
  634.       }
  635.    }
  636.  
  637.    public boolean drawToBufImage(Graphics var1, Image var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, Color var11, ImageObserver var12) {
  638.       if (this.src != null) {
  639.          this.src.checkSecurity((Object)null, false);
  640.       }
  641.  
  642.       if ((this.availinfo & 64) != 0) {
  643.          if (var12 != null) {
  644.             var12.imageUpdate(this.image, 192, -1, -1, -1, -1);
  645.          }
  646.  
  647.          return false;
  648.       } else {
  649.          boolean var13 = (this.availinfo & 32) != 0;
  650.          boolean var14 = (this.availinfo & 128) != 0;
  651.          if (!var13 && !var14) {
  652.             ((ImageWatched)this).addWatcher(var12);
  653.             this.startProduction();
  654.             var13 = (this.availinfo & 32) != 0;
  655.          }
  656.  
  657.          if (var13 || 0 != (this.availinfo & 16)) {
  658.             var1.drawImage(this.bimage, var3, var4, var5, var6, var7, var8, var9, var10, var11, (ImageObserver)null);
  659.          }
  660.  
  661.          return var13;
  662.       }
  663.    }
  664.  
  665.    public boolean drawToBufImage(Graphics var1, Image var2, AffineTransform var3, ImageObserver var4) {
  666.       Graphics2D var5 = (Graphics2D)var1;
  667.       if (this.src != null) {
  668.          this.src.checkSecurity((Object)null, false);
  669.       }
  670.  
  671.       if ((this.availinfo & 64) != 0) {
  672.          if (var4 != null) {
  673.             var4.imageUpdate(this.image, 192, -1, -1, -1, -1);
  674.          }
  675.  
  676.          return false;
  677.       } else {
  678.          boolean var6 = (this.availinfo & 32) != 0;
  679.          boolean var7 = (this.availinfo & 128) != 0;
  680.          if (!var6 && !var7) {
  681.             ((ImageWatched)this).addWatcher(var4);
  682.             this.startProduction();
  683.             var6 = (this.availinfo & 32) != 0;
  684.          }
  685.  
  686.          if (var6 || 0 != (this.availinfo & 16)) {
  687.             var5.drawImage(this.bimage, var3, (ImageObserver)null);
  688.          }
  689.  
  690.          return var6;
  691.       }
  692.    }
  693.  
  694.    synchronized void abort() {
  695.       this.image.getSource().removeConsumer(this);
  696.       this.consuming = false;
  697.       this.newbits = null;
  698.       this.bimage = null;
  699.       this.biRaster = null;
  700.       this.cmodel = null;
  701.       this.srcLUT = null;
  702.       this.isDefaultBI = false;
  703.       this.isSameCM = false;
  704.       ((ImageWatched)this).newInfo(this.image, 128, -1, -1, -1, -1);
  705.       this.availinfo &= -121;
  706.    }
  707.  
  708.    synchronized void dispose() {
  709.       this.image.getSource().removeConsumer(this);
  710.       this.consuming = false;
  711.       this.newbits = null;
  712.       this.availinfo &= -57;
  713.    }
  714.  
  715.    static {
  716.       NativeLibLoader.loadLibraries();
  717.       initIDs();
  718.       s_useNative = true;
  719.    }
  720. }
  721.