⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iioparam.java

📁 gcc的组建
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/* IIOParam.java --   Copyright (C) 2004  Free Software Foundation, Inc.This file is part of GNU Classpath.GNU Classpath is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU Classpath is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU Classpath; see the file COPYING.  If not, write to theFree Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA02110-1301 USA.Linking this library statically or dynamically with other modules ismaking a combined work based on this library.  Thus, the terms andconditions of the GNU General Public License cover the wholecombination.As a special exception, the copyright holders of this library give youpermission to link this library with independent modules to produce anexecutable, regardless of the license terms of these independentmodules, and to copy and distribute the resulting executable underterms of your choice, provided that you also meet, for each linkedindependent module, the terms and conditions of the license of thatmodule.  An independent module is a module which is not derived fromor based on this library.  If you modify this library, you may extendthis exception to your version of the library, but you are notobligated to do so.  If you do not wish to do so, delete thisexception statement from your version. */package javax.imageio;import java.awt.Point;import java.awt.Rectangle;/** * An IIOParam stores parameters used when encoding or decoding image * streams.  ImageReadParam and ImageWriteParam extend this abstract * base class. * * IIOParams allow control over how source pixels converted into * destination pixels.  This conversion can take place between a * stream and in-memory image data, when an image reader is doing the * conversion, or a writer can be doing the conversion from an * in-memory source to a stream destination. * * An image reader can be restricted to only read from a given region; * likewise a writer can be restricted to only write output to a given * region. * * For image readers and writers, IIOParam supports image pixelation * -- where the input image is approximated by the output image using * larger-sized pixel blocks.  For example: FIXME * * IIOParams can control how pixels are combined into larger blocks * using sub-sampling matrices.  For example: FIXME * * They can also control which source bands are read and written; this * example reads the RGBA (red, green, blue, transparency) data from a * PNG image and outputs just the red and transparency bands: FIXME * * @author Thomas Fitzsimmons (fitzsim@redhat.com) * @author Michael Koch (konqueror@gmx.de) */public abstract class IIOParam{  /**   * The controller called by this IIOParam to retrieve parameters.   */  protected IIOParamController controller = null;  /**   * The default controller called by this IIOParam to retrieve   * parameters.   */  protected IIOParamController defaultController = null;  /**   * The offset in the destination where the upper-left   * decoded/encoded pixel should be located.   */  protected Point destinationOffset = new Point(0, 0);  /**   * Sets the output colour type when writing or the destination image   * type when reading.   */  protected ImageTypeSpecifier destinationType = null;  /**   * An array indicating which source bands will be used or null.   */  protected int[] sourceBands = null;  /**   * The source pixel region or null.   */  protected Rectangle sourceRegion = null;  /**   * Sample every sourceXSubsampling'th pixel in the source image when   * pixelating the destination image in the horizontal direction.   */  protected int sourceXSubsampling = 1;  /**   * Sample every sourceYSubsampling'th pixel in the source image when   * pixelating the destination image in the vertical direction.   */  protected int sourceYSubsampling = 1;  /**   * Start sampling at this horizontal offset within the source region   * when pixelating the destination image in the horizontal   * direction.   */  protected int subsamplingXOffset = 0;  /**   * Start sampling at this vertical offset within the source region   * when pixelating the destination image in the vertical direction.   */  protected int subsamplingYOffset = 0;  /**   * Indicates whether or not the controller has been explicitly set   * to null.   */  private boolean no_controller = false;  /**   * Constructs an IIOParam object.   */  protected IIOParam()  {  }  /**   * Activates the parameter controller by calling its activate method   * and passing it this IIOParam.  A true return value indicates that   * this IIOParam's values are ready for the next read or write   * operation.  A return value of false means that this IIOParam's   * values have not been affected because the controller operations   * were cancelled.   *   * @return true if parameters were successfully set, false if   * parameters were not changed   */  public boolean activateController()  {    if (controller == null)      {	if (defaultController == null || no_controller)	  return false;	else	  return defaultController.activate (this);      }    else      return controller.activate(this);  }  /**   * Retrieve the currently set controller if one has been set, or the   * default controller, or null if the controller has been explicitly   * set to null.   *   * @return the currently used controller or null   */    public IIOParamController getController()  {    return controller == null ?      (no_controller ? null : defaultController) : controller;  }  /**   * Retrieve the default controller regardless of whether or not a   * non-default controller has been set.  The default controller may   * be null.   *   * @return the default controller or null   */  public IIOParamController getDefaultController()  {    return defaultController;  }  /**   * Retrieve the offset in the destination where the upper-left   * decoded/encoded pixel should be located. (0, 0) by default.   *   * @return the destination offset   */  public Point getDestinationOffset()  {    return destinationOffset;  }  /**   * Retrieve the currently set image-type specifier or null if none   * has been set.   *   * @return the current image-type specifier or null   */  public ImageTypeSpecifier getDestinationType()  {    return destinationType;  }  /**   * Retrieve the current source band values or null if source band   * values have not been set.   *   * The returned array is a copy of this IIOParam's source band   * array.   *   * @return the current set of source band values or null   */  public int[] getSourceBands()  {    if (sourceBands == null)      return null;    int[] sourceBandsCopy = new int[sourceBands.length];    System.arraycopy (sourceBands, 0, sourceBandsCopy, 0, sourceBands.length);    return sourceBandsCopy;  }  /**   * Retrieve the source rectangle from which pixels should be read or   * null if no source region has been set.   *   * @return the current source region or null   */  public Rectangle getSourceRegion()  {    return sourceRegion;  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -