home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / javax / imageio / ImageReadParam.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  2.0 KB  |  105 lines

  1. package javax.imageio;
  2.  
  3. import java.awt.Dimension;
  4. import java.awt.image.BufferedImage;
  5.  
  6. public class ImageReadParam extends IIOParam {
  7.    protected boolean canSetSourceRenderSize = false;
  8.    protected Dimension sourceRenderSize = null;
  9.    protected BufferedImage destination = null;
  10.    protected int[] destinationBands = null;
  11.    protected int minProgressivePass = 0;
  12.    protected int numProgressivePasses = Integer.MAX_VALUE;
  13.  
  14.    public void setDestinationType(ImageTypeSpecifier var1) {
  15.       super.setDestinationType(var1);
  16.       this.setDestination((BufferedImage)null);
  17.    }
  18.  
  19.    public void setDestination(BufferedImage var1) {
  20.       this.destination = var1;
  21.    }
  22.  
  23.    public BufferedImage getDestination() {
  24.       return this.destination;
  25.    }
  26.  
  27.    public void setDestinationBands(int[] var1) {
  28.       if (var1 == null) {
  29.          this.destinationBands = null;
  30.       } else {
  31.          int var2 = var1.length;
  32.  
  33.          for(int var3 = 0; var3 < var2; ++var3) {
  34.             int var4 = var1[var3];
  35.             if (var4 < 0) {
  36.                throw new IllegalArgumentException("Band value < 0!");
  37.             }
  38.  
  39.             for(int var5 = var3 + 1; var5 < var2; ++var5) {
  40.                if (var4 == var1[var5]) {
  41.                   throw new IllegalArgumentException("Duplicate band value!");
  42.                }
  43.             }
  44.          }
  45.  
  46.          this.destinationBands = (int[])(([I)var1).clone();
  47.       }
  48.  
  49.    }
  50.  
  51.    public int[] getDestinationBands() {
  52.       return this.destinationBands == null ? null : (int[])((int[])this.destinationBands.clone());
  53.    }
  54.  
  55.    public boolean canSetSourceRenderSize() {
  56.       return this.canSetSourceRenderSize;
  57.    }
  58.  
  59.    public void setSourceRenderSize(Dimension var1) throws UnsupportedOperationException {
  60.       if (!this.canSetSourceRenderSize()) {
  61.          throw new UnsupportedOperationException("Can't set source render size!");
  62.       } else {
  63.          if (var1 == null) {
  64.             this.sourceRenderSize = null;
  65.          } else {
  66.             if (var1.width <= 0 || var1.height <= 0) {
  67.                throw new IllegalArgumentException("width or height <= 0!");
  68.             }
  69.  
  70.             this.sourceRenderSize = (Dimension)var1.clone();
  71.          }
  72.  
  73.       }
  74.    }
  75.  
  76.    public Dimension getSourceRenderSize() {
  77.       return this.sourceRenderSize == null ? null : (Dimension)this.sourceRenderSize.clone();
  78.    }
  79.  
  80.    public void setSourceProgressivePasses(int var1, int var2) {
  81.       if (var1 < 0) {
  82.          throw new IllegalArgumentException("minPass < 0!");
  83.       } else if (var2 <= 0) {
  84.          throw new IllegalArgumentException("numPasses <= 0!");
  85.       } else if (var2 != Integer.MAX_VALUE && (var1 + var2 - 1 & Integer.MIN_VALUE) != 0) {
  86.          throw new IllegalArgumentException("minPass + numPasses - 1 > INTEGER.MAX_VALUE!");
  87.       } else {
  88.          this.minProgressivePass = var1;
  89.          this.numProgressivePasses = var2;
  90.       }
  91.    }
  92.  
  93.    public int getSourceMinProgressivePass() {
  94.       return this.minProgressivePass;
  95.    }
  96.  
  97.    public int getSourceMaxProgressivePass() {
  98.       return this.numProgressivePasses == Integer.MAX_VALUE ? Integer.MAX_VALUE : this.minProgressivePass + this.numProgressivePasses - 1;
  99.    }
  100.  
  101.    public int getSourceNumProgressivePasses() {
  102.       return this.numProgressivePasses;
  103.    }
  104. }
  105.