src/share/classes/java/awt/image/BufferedImageFilter.java

Print this page


   1 /*
   2  * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  68 
  69     /**
  70      * Returns the <code>BufferedImageOp</code>.
  71      * @return the operator of this <code>BufferedImageFilter</code>.
  72      */
  73     public BufferedImageOp getBufferedImageOp() {
  74         return bufferedImageOp;
  75     }
  76 
  77     /**
  78      * Filters the information provided in the
  79      * {@link ImageConsumer#setDimensions(int, int) setDimensions } method
  80      * of the {@link ImageConsumer} interface.
  81      * <p>
  82      * Note: This method is intended to be called by the
  83      * {@link ImageProducer} of the <code>Image</code> whose pixels are
  84      * being filtered. Developers using this class to retrieve pixels from
  85      * an image should avoid calling this method directly since that
  86      * operation could result in problems with retrieving the requested
  87      * pixels.
  88      * <p>
  89      * @param width the width to which to set the width of this
  90      *        <code>BufferedImageFilter</code>
  91      * @param height the height to which to set the height of this
  92      *        <code>BufferedImageFilter</code>
  93      * @see ImageConsumer#setDimensions
  94      */
  95     public void setDimensions(int width, int height) {
  96         if (width <= 0 || height <= 0) {
  97             imageComplete(STATICIMAGEDONE);
  98             return;
  99         }
 100         this.width  = width;
 101         this.height = height;
 102     }
 103 
 104     /**
 105      * Filters the information provided in the
 106      * {@link ImageConsumer#setColorModel(ColorModel) setColorModel} method
 107      * of the <code>ImageConsumer</code> interface.
 108      * <p>


   1 /*
   2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  68 
  69     /**
  70      * Returns the <code>BufferedImageOp</code>.
  71      * @return the operator of this <code>BufferedImageFilter</code>.
  72      */
  73     public BufferedImageOp getBufferedImageOp() {
  74         return bufferedImageOp;
  75     }
  76 
  77     /**
  78      * Filters the information provided in the
  79      * {@link ImageConsumer#setDimensions(int, int) setDimensions } method
  80      * of the {@link ImageConsumer} interface.
  81      * <p>
  82      * Note: This method is intended to be called by the
  83      * {@link ImageProducer} of the <code>Image</code> whose pixels are
  84      * being filtered. Developers using this class to retrieve pixels from
  85      * an image should avoid calling this method directly since that
  86      * operation could result in problems with retrieving the requested
  87      * pixels.
  88      *
  89      * @param width the width to which to set the width of this
  90      *        <code>BufferedImageFilter</code>
  91      * @param height the height to which to set the height of this
  92      *        <code>BufferedImageFilter</code>
  93      * @see ImageConsumer#setDimensions
  94      */
  95     public void setDimensions(int width, int height) {
  96         if (width <= 0 || height <= 0) {
  97             imageComplete(STATICIMAGEDONE);
  98             return;
  99         }
 100         this.width  = width;
 101         this.height = height;
 102     }
 103 
 104     /**
 105      * Filters the information provided in the
 106      * {@link ImageConsumer#setColorModel(ColorModel) setColorModel} method
 107      * of the <code>ImageConsumer</code> interface.
 108      * <p>