rescaleop.html
来自「API資料大全」· HTML 代码 · 共 528 行 · 第 1/2 页
HTML
528 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Apr 27 23:34:14 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Class RescaleOp</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/RescaleOp.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../java/awt/image/ReplicateScaleFilter.html"><B>PREV CLASS</B></A> <A HREF="../../../java/awt/image/RGBImageFilter.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="RescaleOp.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">java.awt.image</FONT><BR>Class RescaleOp</H2><PRE><A HREF="../../../java/lang/Object.html">java.lang.Object</A> | +--<B>java.awt.image.RescaleOp</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../java/awt/image/BufferedImageOp.html">BufferedImageOp</A>, <A HREF="../../../java/awt/image/RasterOp.html">RasterOp</A></DD></DL><HR><DL><DT>public class <B>RescaleOp</B><DT>extends <A HREF="../../../java/lang/Object.html">Object</A><DT>implements <A HREF="../../../java/awt/image/BufferedImageOp.html">BufferedImageOp</A>, <A HREF="../../../java/awt/image/RasterOp.html">RasterOp</A></DL><P>This class performs a pixel-by-pixel rescaling of the data in the source image by multiplying the sample values for each pixel by a scale factor and then adding an offset. The scaled sample values are clipped to the minimum/maximum representable in the destination image. <p> The pseudo code for the rescaling operation is as follows: <pre>for each pixel from Source object { for each band/component of the pixel { dstElement = (srcElement*scaleFactor) + offset }} </pre> <p> For Rasters, rescaling operates on bands. The number of sets of scaling constants may be one, in which case the same constants are applied to all bands, or it must equal the number of Source Raster bands. <p> For BufferedImages, rescaling operates on color and alpha components. The number of sets of scaling constants may be one, in which case the same constants are applied to all color (but not alpha) components. Otherwise, the number of sets of scaling constants may equal the number of Source color components, in which case no rescaling of the alpha component (if present) is performed. If neither of these cases apply, the number of sets of scaling constants must equal the number of Source color components plus alpha components, in which case all color and alpha components are rescaled. <p> BufferedImage sources with premultiplied alpha data are treated in the same manner as non-premultiplied images for purposes of rescaling. That is, the rescaling is done per band on the raw data of the BufferedImage source without regard to whether the data is premultiplied. If a color conversion is required to the destination ColorModel, the premultiplied state of both source and destination will be taken into account for this step. <p> Images with an IndexColorModel cannot be rescaled. <p> If a RenderingHints object is specified in the constructor, the color rendering hint and the dithering hint may be used when color conversion is required. <p> Note that in-place operation is allowed (i.e. the source and destination can be the same object).<P><DL><DT><B>See Also: </B><DD><A HREF="../../../java/awt/RenderingHints.html#KEY_COLOR_RENDERING"><CODE>RenderingHints.KEY_COLOR_RENDERING</CODE></A>, <A HREF="../../../java/awt/RenderingHints.html#KEY_DITHERING"><CODE>RenderingHints.KEY_DITHERING</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../java/awt/image/RescaleOp.html#RescaleOp(float[], float[], java.awt.RenderingHints)">RescaleOp</A></B>(float[] scaleFactors, float[] offsets, <A HREF="../../../java/awt/RenderingHints.html">RenderingHints</A> hints)</CODE><BR> Constructs a new RescaleOp with the desired scale factors and offsets.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../java/awt/image/RescaleOp.html#RescaleOp(float, float, java.awt.RenderingHints)">RescaleOp</A></B>(float scaleFactor, float offset, <A HREF="../../../java/awt/RenderingHints.html">RenderingHints</A> hints)</CODE><BR> Constructs a new RescaleOp with the desired scale factor and offset.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/awt/image/BufferedImage.html">BufferedImage</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/RescaleOp.html#createCompatibleDestImage(java.awt.image.BufferedImage, java.awt.image.ColorModel)">createCompatibleDestImage</A></B>(<A HREF="../../../java/awt/image/BufferedImage.html">BufferedImage</A> src, <A HREF="../../../java/awt/image/ColorModel.html">ColorModel</A> destCM)</CODE><BR> Creates a zeroed destination image with the correct size and number of bands.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/awt/image/WritableRaster.html">WritableRaster</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/RescaleOp.html#createCompatibleDestRaster(java.awt.image.Raster)">createCompatibleDestRaster</A></B>(<A HREF="../../../java/awt/image/Raster.html">Raster</A> src)</CODE><BR> Creates a zeroed destination Raster with the correct size and number of bands, given this source.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/awt/image/BufferedImage.html">BufferedImage</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/RescaleOp.html#filter(java.awt.image.BufferedImage, java.awt.image.BufferedImage)">filter</A></B>(<A HREF="../../../java/awt/image/BufferedImage.html">BufferedImage</A> src, <A HREF="../../../java/awt/image/BufferedImage.html">BufferedImage</A> dst)</CODE><BR> Rescales the source BufferedImage.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/awt/image/WritableRaster.html">WritableRaster</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/RescaleOp.html#filter(java.awt.image.Raster, java.awt.image.WritableRaster)">filter</A></B>(<A HREF="../../../java/awt/image/Raster.html">Raster</A> src, <A HREF="../../../java/awt/image/WritableRaster.html">WritableRaster</A> dst)</CODE><BR> Rescales the pixel data in the source Raster.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/awt/geom/Rectangle2D.html">Rectangle2D</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/RescaleOp.html#getBounds2D(java.awt.image.BufferedImage)">getBounds2D</A></B>(<A HREF="../../../java/awt/image/BufferedImage.html">BufferedImage</A> src)</CODE><BR> Returns the bounding box of the rescaled destination image.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/awt/geom/Rectangle2D.html">Rectangle2D</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/RescaleOp.html#getBounds2D(java.awt.image.Raster)">getBounds2D</A></B>(<A HREF="../../../java/awt/image/Raster.html">Raster</A> src)</CODE><BR> Returns the bounding box of the rescaled destination Raster.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/RescaleOp.html#getNumFactors()">getNumFactors</A></B>()</CODE><BR> Returns the number of scaling factors and offsets used in this RescaleOp.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> float[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/RescaleOp.html#getOffsets(float[])">getOffsets</A></B>(float[] offsets)</CODE><BR> Returns the offsets in the given array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/awt/geom/Point2D.html">Point2D</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/RescaleOp.html#getPoint2D(java.awt.geom.Point2D, java.awt.geom.Point2D)">getPoint2D</A></B>(<A HREF="../../../java/awt/geom/Point2D.html">Point2D</A> srcPt, <A HREF="../../../java/awt/geom/Point2D.html">Point2D</A> dstPt)</CODE><BR> Returns the location of the destination point given a point in the source.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/awt/RenderingHints.html">RenderingHints</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/RescaleOp.html#getRenderingHints()">getRenderingHints</A></B>()</CODE><BR> Returns the rendering hints for this op.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> float[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/RescaleOp.html#getScaleFactors(float[])">getScaleFactors</A></B>(float[] scaleFactors)</CODE><BR> Returns the scale factors in the given array.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?