📄 image manipulation.htm
字号:
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>boolean contains(int x, int y, int w, int h)
<P></P></LI></UL></PRE>
<DL><A name=54096>
<DT>
<DD>returns true if the rectangle lies within the ROI.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD rowSpan=4><EM>Parameters</EM>:
<P></P>
<TD><CODE>x</CODE>
<P></P>
<TD>The int <EM>x</EM> coordinate of the upper left corner of the
region.
<P></P>
<TR vAlign=top>
<TD><CODE>y</CODE>
<P></P>
<TD>The int <EM>y</EM> coordinate of the upper left corner of the
region.
<P></P>
<TR vAlign=top>
<TD><CODE>w</CODE>
<P></P>
<TD>The int width of the region.
<P></P>
<TR vAlign=top>
<TD><CODE>h</CODE>
<P></P>
<TD>The int height of the region.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>boolean contains(double x, double y, double w, double h)
<P></P></LI></UL></PRE>
<DL><A name=54119>
<DT>
<DD>returns true if the rectangle lies within the ROI.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD rowSpan=4><EM>Parameters</EM>:
<P></P>
<TD><CODE>x</CODE>
<P></P>
<TD>The double <EM>x</EM> coordinate of the upper left corner of the
region.
<P></P>
<TR vAlign=top>
<TD><CODE>y</CODE>
<P></P>
<TD>The double <EM>y</EM> coordinate of the upper left corner of the
region.
<P></P>
<TR vAlign=top>
<TD><CODE>w</CODE>
<P></P>
<TD>The double width of the region.
<P></P>
<TR vAlign=top>
<TD><CODE>h</CODE>
<P></P>
<TD>The double height of the region.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>boolean intersects(Rectangle rect)
<P></P></LI></UL></PRE>
<DL><A name=53965>
<DT>
<DD>returns true if the <CODE>Rectangle</CODE> intersects the ROI.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD><EM>Parameters</EM>:
<P></P>
<TD><CODE>rect</CODE>
<P></P>
<TD>A <CODE>Rectangle</CODE> specifying the region to be tested for
inclusion.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>boolean intersects(Rectangle2D r)
<P></P></LI></UL></PRE>
<DL><A name=53961>
<DT>
<DD>returns true if the <CODE>Rectangle2D</CODE> intersects the ROI.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD><EM>Parameters</EM>:
<P></P>
<TD><CODE>r</CODE>
<P></P>
<TD>A <CODE>Rectangle2D</CODE> specifying the region to be tested for
inclusion.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>boolean intersects(int x, int y, int w, int h)
<P></P></LI></UL></PRE>
<DL><A name=54166>
<DT>
<DD>returns true if the rectangle intersects the ROI.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD rowSpan=4><EM>Parameters</EM>:
<P></P>
<TD><CODE>x</CODE>
<P></P>
<TD>The int <EM>x</EM> coordinate of the upper left corner of the
region.
<P></P>
<TR vAlign=top>
<TD><CODE>y</CODE>
<P></P>
<TD>The int <EM>y</EM> coordinate of the upper left corner of the
region.
<P></P>
<TR vAlign=top>
<TD><CODE>w</CODE>
<P></P>
<TD>The int width of the region.
<P></P>
<TR vAlign=top>
<TD><CODE>h</CODE>
<P></P>
<TD>The int height of the region.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>boolean intersects(double x, double y, double w, double h)
<P></P></LI></UL></PRE>
<DL><A name=53953>
<DT>
<DD>returns true if the rectangle intersects the <CODE>ROI</CODE>.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD rowSpan=4><EM>Parameters</EM>:
<P></P>
<TD><CODE>x</CODE>
<P></P>
<TD>The double <EM>x</EM> coordinate of the upper left corner of the
region.
<P></P>
<TR vAlign=top>
<TD><CODE>y</CODE>
<P></P>
<TD>The double <EM>y</EM> coordinate of the upper left corner of the
region.
<P></P>
<TR vAlign=top>
<TD><CODE>w</CODE>
<P></P>
<TD>The double width of the region.
<P></P>
<TR vAlign=top>
<TD><CODE>h</CODE>
<P></P>
<TD>The double height of the region.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><A name=54623>
<H4>6.2.1.3 <IMG src="Image Manipulation.files/space.gif">Creating a New ROI
from an Existing ROI</H4></A>Several methods allow the creation of a new
<CODE>ROI</CODE> from an existing <CODE>ROI</CODE>. The <CODE>add</CODE>
method adds another ROI to an existing one, creating a new ROI.
<P>
<TABLE border=0>
<TBODY>
<TR>
<TD><IMG src="Image Manipulation.files/cistine.gif"></TD>
<TD>
<HR>
<B>API:</B> <CODE>javax.media.jai.ROI </CODE>
<HR>
</TD></TR></TBODY></TABLE><PRE><UL>
<LI>ROI add(ROI im)
<P></P></LI></UL></PRE>
<DL><A name=54642>
<DT>
<DD>adds another <CODE>ROI</CODE> to this one and returns the result as a
new <CODE>ROI</CODE>. The addition is performed by an "AddROIs" RIF to be
specified. The supplied <CODE>ROI</CODE> will be converted to a rendered
form if necessary.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD><EM>Parameters</EM>:
<P></P>
<TD><CODE>im</CODE>
<P></P>
<TD>An <CODE>ROI</CODE>.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>ROI subtract(ROI im)
<P></P></LI></UL></PRE>
<DL><A name=54256>
<DT>
<DD>subtracts another <CODE>ROI</CODE> to this one and returns the result as
a new <CODE>ROI</CODE>. The subtraction is performed by a "SubtractROIs" RIF
to be specified. The supplied <CODE>ROI</CODE> will be converted to a
rendered form if necessary.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD><EM>Parameters</EM>:
<P></P>
<TD><CODE>im</CODE>
<P></P>
<TD>An <CODE>ROI</CODE>.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>ROI intersect(ROI im)
<P></P></LI></UL></PRE>
<DL><A name=54279>
<DT>
<DD>intersects the <CODE>ROI</CODE> with another <CODE>ROI</CODE> and
returns the result as a new <CODE>ROI</CODE>. The intersection is performed
by a "IntersectROIs" RIF to be specified. The supplied <CODE>ROI</CODE> will
be converted to a rendered form if necessary.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD><EM>Parameters</EM>:
<P></P>
<TD><CODE>im</CODE>
<P></P>
<TD>An <CODE>ROI</CODE>.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>ROI exclusiveOr(ROI im)
<P></P></LI></UL></PRE>
<DL><A name=54302>
<DT>
<DD>exclusive-ORs the <CODE>ROI</CODE> with another <CODE>ROI</CODE> and
returns the result as a new <CODE>ROI</CODE>. The intersection is performed
by an "XorROIs" RIF to be specified. The supplied <CODE>ROI</CODE> will be
converted to a rendered form if necessary.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD><EM>Parameters</EM>:
<P></P>
<TD><CODE>im</CODE>
<P></P>
<TD>An <CODE>ROI</CODE>.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>ROI transform(AffineTransform at)
<P></P></LI></UL></PRE>
<DL><A name=54347>
<DT>
<DD>performs an affine transformation and returns the result as a new
<CODE>ROI</CODE>. The transformation is performed by an "Affine" RIF.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD><EM>Parameters</EM>:
<P></P>
<TD><CODE>at</CODE>
<P></P>
<TD>An <CODE>AffineTransform</CODE> specifying the transformation.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>ROI performImageOp(RenderedImageFactory RIF, ParameterBlock
paramBlock, int sourceIndex, Hashtable renderHints,
Hashtable renderHintsObserved)
<P></P></LI></UL></PRE>
<DL><A name=54378>
<DT>
<DD>transforms an ROI using an imaging operation. The operation is specified
by a <CODE>RenderedImageFactory</CODE>. The operation's
<CODE>ParameterBlock</CODE>, minus the image source itself is supplied,
along with an index indicating where to insert the <CODE>ROI</CODE> image.
The usual <CODE>renderHints</CODE> and <CODE>renderHintsObserved</CODE>
arguments allow rendering hints to be passed in and information on which
hints were followed to be passed out.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD rowSpan=5><EM>Parameters</EM>:
<P></P>
<TD><CODE>RIF</CODE>
<P></P>
<TD>A <CODE>RenderedImageFactory</CODE> that will be used to create
the op.
<P></P>
<TR vAlign=top>
<TD><CODE>paramBlock</CODE>
<P></P>
<TD>A <CODE>ParameterBlock</CODE> containing all sources and
parameters for the operation except for the <CODE>ROI</CODE> itself.
<P></P>
<TR vAlign=top>
<TD><CODE>sourceIndex</CODE>
<P></P>
<TD>The index of the <CODE>ParameterBlock</CODE>'s sources where the
<CODE>ROI</CODE> is to be inserted.
<P></P>
<TR vAlign=top>
<TD><CODE>renderHints</CODE>
<P></P>
<TD>A Hashtable of rendering hints.
<P></P>
<TR vAlign=top>
<TD><CODE>renderHints-Observed</CODE>
<P></P>
<TD>A Hashtable of observed rendering hints.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>ROI performImageOp(RenderedImageFactory RIF, ParameterBlock
paramBlock, int sourceIndex)
<P></P></LI></UL></PRE>
<DL><A name=54409>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -