📄 extending the api.htm
字号:
<LI>void nextPixel()
<P></P></LI></UL></PRE>
<DL><A name=53001>
<DT>
<DD>sets the iterator to the next pixel in the image (that is, move
rightward). The line and band offsets are unchanged. </A>
<P></P></DD></DL><PRE><UL>
<LI>void jumpPixels(int num)
<P></P></LI></UL></PRE>
<DL><A name=53018>
<DT>
<DD>jumps rightward <CODE>num</CODE> pixels from the current position. The
<CODE>num</CODE> parameter may be negative. The line and band offsets are
unchanged. </A>
<P></P></DD></DL><PRE><UL>
<LI>void nextBand()
<P></P></LI></UL></PRE>
<DL><A name=53037>
<DT>
<DD>sets the iterator to the next band in the image. The pixel column and
line are unchanged. </A>
<P></P></DD></DL><A name=51452>
<H3>14.4.2 <IMG src="Extending the API.files/space.gif">RookIter</H3></A>The
<CODE>RookIter</CODE> interface represents an iterator for traversing a
read-only image using arbitrary up-down and left-right moves (<A
href="http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/Extension.doc.html#52483">Figure
14-3</A> shows two of the possibilities for traversing the pixels). The
RookIter traversal will generally be somewhat slower than a corresponding
instance of <CODE>RectIter</CODE>, since it must perform bounds checks against
the top and left edges of tiles in addition to their bottom and right edges.
The <CODE>WritableRookIter</CODE> interface traverses a read/write image in
the same manner as the RookIter.
<P>An instance of RookIter may be obtained by means of the
<CODE>RookIterFactory.create()</CODE> or
<CODE>RookIterFactory.createWritable()</CODE> methods, which return an opaque
object implementing this interface. The iterator is initialized with a
particular rectangle as its bounds. This initialization takes place in a
factory method (the <CODE>RookIterFactory</CODE> class) and is not a part of
the iterator interface itself.
<P>Once initialized, the iterator may be reset to its initial state by means
of the <CODE>startLines()</CODE>, <CODE>startPixels()</CODE>, and
<CODE>startBands()</CODE> methods. As with <CODE>RectIter</CODE>, its position
may be advanced using the <CODE>nextLine()</CODE>, <CODE>jumpLines()</CODE>,
<CODE>nextPixel()</CODE>, <CODE>jumpPixels()</CODE>, and
<CODE>nextBand()</CODE> methods.
<P><A name=52482>
<HR>
<CENTER><IMG src="Extending the API.files/Extension.doc.anc1.gif"></CENTER>
<HR>
</A><A name=52483>
<CENTER><FONT size=-1><B><I>Figure 14-3 </I><IMG
src="Extending the API.files/sm-blank.gif" border=0> RookIter Traversal
Patterns</B></FONT></CENTER></A>
<P>
<TABLE border=0>
<TBODY>
<TR>
<TD><IMG src="Extending the API.files/cistine.gif"></TD>
<TD>
<HR>
<B>API:</B> <CODE>avax.media.jai.iterator.RookIterFactory </CODE>
<HR>
</TD></TR></TBODY></TABLE><PRE><UL>
<LI>static RookIter create(RenderedImage im, Rectangle bounds)
<P></P></LI></UL></PRE>
<DL><A name=53139>
<DT>
<DD>constructs and returns an instance of <CODE>RookIter</CODE> suitable for
iterating over the given bounding rectangle within the given
<CODE>RenderedImage</CODE> source. If the <CODE>bounds</CODE> parameter is
null, the entire image will be used.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD rowSpan=2><EM>Parameters</EM>:<EM></EM>
<P></P>
<TD><CODE>im</CODE>
<P></P>
<TD>A read-only <CODE>RenderedImage</CODE> source.
<P></P>
<TR vAlign=top>
<TD><CODE>bounds</CODE>
<P></P>
<TD>The bounding <CODE>Rectangle</CODE> for the iterator, or null.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>static RookIter create(Raster ras, Rectangle bounds)
<P></P></LI></UL></PRE>
<DL><A name=53181>
<DT>
<DD>constructs and returns an instance of <CODE>RookIter</CODE> suitable for
iterating over the given bounding rectangle within the given
<CODE>Raster</CODE> source. If the bounds parameter is null, the entire
<CODE>Raster</CODE> will be used.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD rowSpan=2><EM>Parameters</EM>:<EM></EM>
<P></P>
<TD><CODE>ras</CODE>
<P></P>
<TD>A read-only <CODE>Raster</CODE> source.
<P></P>
<TR vAlign=top>
<TD><CODE>bounds</CODE>
<P></P>
<TD>The bounding <CODE>Rectangle</CODE> for the iterator, or null.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>static WritableRookIter createWritable(WritableRenderedImage
im, Rectangle bounds)
<P></P></LI></UL></PRE>
<DL><A name=53268>
<DT>
<DD>constructs and returns an instance of <CODE>WritableRookIter</CODE>
suitable for iterating over the given bounding rectangle within the given
<CODE>WritableRenderedImage</CODE> source. If the <CODE>bounds</CODE>
parameter is null, the entire image will be used.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD rowSpan=2><EM>Parameters</EM>:<EM></EM>
<P></P>
<TD><CODE>im</CODE>
<P></P>
<TD>A <CODE>WritableRenderedImage</CODE> source.
<P></P>
<TR vAlign=top>
<TD><CODE>bounds</CODE>
<P></P>
<TD>The bounding <CODE>Rectangle</CODE> for the iterator, or null.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>static WritableRookIter createWritable(WritableRaster ras,
Rectangle bounds)
<P></P></LI></UL></PRE>
<DL><A name=53299>
<DT>
<DD>constructs and returns an instance of <CODE>WritableRookIter</CODE>
suitable for iterating over the given bounding rectangle within the given
<CODE>WritableRaster</CODE> source. If the <CODE>bounds</CODE> parameter is
null, the entire <CODE>Raster</CODE> will be used.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD rowSpan=2><EM>Parameters</EM>:<EM></EM>
<P></P>
<TD><CODE>ras</CODE>
<P></P>
<TD>A <CODE>WritableRaster</CODE> source.
<P></P>
<TR vAlign=top>
<TD><CODE>bounds</CODE>
<P></P>
<TD>The bounding <CODE>Rectangle</CODE> for the iterator, or null.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><A name=53284>
<H3>14.4.3 <IMG src="Extending the API.files/space.gif">RandomIter</H3></A>The
<CODE>RandomIter</CODE> interface represents an iterator that allows random
access to any sample within its bounding rectangle. The flexibility afforded
by this class will generally exact a corresponding price in speed and setup
overhead.
<P>The iterator is initialized with a particular rectangle as its bounds. This
initialization takes place in a factory method (the
<CODE>RandomIterFactory</CODE> class) and is not a part of the iterator
interface itself. An instance of <CODE>RandomIter</CODE> may be obtained by
means of the <CODE>RandomIterFactory.create()</CODE> method, which returns an
opaque object implementing this interface.
<P>The <CODE>getSample()</CODE>, <CODE>getSampleFloat()</CODE>, and
<CODE>getSampleDouble()</CODE> methods are provided to allow read-only access
to the source data. The <CODE>getPixel()</CODE> methods allow retrieval of all
bands simultaneously.
<P>
<TABLE border=0>
<TBODY>
<TR>
<TD><IMG src="Extending the API.files/cistine.gif"></TD>
<TD>
<HR>
<B>API:</B> <CODE>javax.media.jai.iterator.RandomIterFactory </CODE>
<HR>
</TD></TR></TBODY></TABLE><PRE><UL>
<LI>static RandomIter create(RenderedImage im, Rectangle bounds)
<P></P></LI></UL></PRE>
<DL><A name=53787>
<DT>
<DD>constructs and returns an instance of <CODE>RandomIter</CODE> suitable
for iterating over the given bounding rectangle within the given
<CODE>RenderedImage</CODE> source. If the <CODE>bounds</CODE> parameter is
null, the entire image will be used.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD rowSpan=2><EM>Parameters</EM>:<EM></EM>
<P></P>
<TD><CODE>im</CODE>
<P></P>
<TD>A read-only <CODE>RenderedImage</CODE> source.
<P></P>
<TR vAlign=top>
<TD><CODE>bounds</CODE>
<P></P>
<TD>The bounding <CODE>Rectangle</CODE> for the iterator, or null.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>static RandomIter create(Raster ras, Rectangle bounds)
<P></P></LI></UL></PRE>
<DL><A name=53841>
<DT>
<DD>constructs and returns an instance of <CODE>RandomIter</CODE> suitable
for iterating over the given bounding rectangle within the given
<CODE>Raster</CODE> source. If the <CODE>bounds</CODE> parameter is null,
the entire <CODE>Raster</CODE> will be used.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD rowSpan=2><EM>Parameters</EM>:<EM></EM>
<P></P>
<TD><CODE>ras</CODE>
<P></P>
<TD>A read-only <CODE>Raster</CODE> source.
<P></P>
<TR vAlign=top>
<TD><CODE>bounds</CODE>
<P></P>
<TD>The bounding <CODE>Rectangle</CODE> for the iterator, or null.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>static WritableRandomIter createWritable(WritableRenderedImage
im, Rectangle bounds)
<P></P></LI></UL></PRE>
<DL><A name=53866>
<DT>
<DD>constructs and returns an instance of <CODE>WritableRandomIter</CODE>
suitable for iterating over the given bounding rectangle within the given
<CODE>WritableRenderedImage</CODE> source. If the <CODE>bounds</CODE>
parameter is null, the entire image will be used.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD rowSpan=2><EM>Parameters</EM>:<EM></EM>
<P></P>
<TD><CODE>im</CODE>
<P></P>
<TD>A <CODE>WritableRenderedImage</CODE> source.
<P></P>
<TR vAlign=top>
<TD><CODE>bounds</CODE>
<P></P>
<TD>The bounding <CODE>Rectangle</CODE> for the iterator, or null.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>static WritableRandomIter createWritable(WritableRaster ras,
Rectangle bounds)
<P></P></LI></UL></PRE>
<DL><A name=53891>
<DT>
<DD>constructs and returns an instance of <CODE>WritableRandomIter</CODE>
suitable for iterating over the given bounding rectangle within the given
<CODE>WritableRaster</CODE> source. If the <CODE>bounds</CODE> parameter is
null, the entire Raster will be used.
<P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -