| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (21) on Thu Oct 05 19:54:57 CEST 2023 --> |
| <title>WritablePixelIterator (Apache SIS 1.4 API)</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2023-10-05"> |
| <meta name="description" content="declaration: module: org.apache.sis.feature, package: org.apache.sis.image, class: WritablePixelIterator"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <meta name="keywords" content="org.apache.sis.image.WritablePixelIterator class"> |
| <meta name="keywords" content="create()"> |
| <meta name="keywords" content="isWritable()"> |
| <meta name="keywords" content="setSample()"> |
| <meta name="keywords" content="setPixel()"> |
| <meta name="keywords" content="setDataElements()"> |
| <meta name="keywords" content="close()"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../sis.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-3.6.1.min.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-ui.min.js"></script> |
| </head> |
| <body class="class-declaration-page"> |
| <script type="text/javascript">var pathtoroot = "../../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flex-box"> |
| <header role="banner" class="flex-header"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button> |
| <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> |
| <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="../../../../module-summary.html">Module</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html#class">Help</a></li> |
| </ul> |
| <ul class="sub-nav-list-small"> |
| <li> |
| <p>Summary:</p> |
| <ul> |
| <li><a href="#nested-class-summary">Nested</a></li> |
| <li>Field</li> |
| <li>Constr</li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| </li> |
| <li> |
| <p>Detail:</p> |
| <ul> |
| <li>Field</li> |
| <li>Constr</li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="sub-nav"> |
| <div id="navbar-sub-list"> |
| <ul class="sub-nav-list"> |
| <li>Summary: </li> |
| <li><a href="#nested-class-summary">Nested</a> | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><a href="../../../../../search.html">SEARCH</a> |
| <input type="text" id="search-input" disabled placeholder="Search"> |
| <input type="reset" id="reset-button" disabled value="reset"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip-navbar-top"></span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="module-label-in-type">Module</span> <a href="../../../../module-summary.html">org.apache.sis.feature</a></div> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">org.apache.sis.image</a></div> |
| <h1 title="Class WritablePixelIterator" class="title">Class WritablePixelIterator</h1> |
| </div> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> |
| <div class="inheritance"><a href="PixelIterator.html" title="class in org.apache.sis.image">PixelIterator</a> |
| <div class="inheritance">WritablePixelIterator</div> |
| </div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <dl class="notes"> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Closeable.html" title="class or interface in java.io" class="external-link">Closeable</a></code>, <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/AutoCloseable.html" title="class or interface in java.lang" class="external-link">AutoCloseable</a></code></dd> |
| </dl> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">WritablePixelIterator</span> |
| <span class="extends-implements">extends <a href="PixelIterator.html" title="class in org.apache.sis.image">PixelIterator</a> |
| implements <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Closeable.html" title="class or interface in java.io" class="external-link">Closeable</a></span></div> |
| <div class="block">A pixel iterator capable to write sample values. This iterator can edit pixel values in place, |
| or write values in a different destination image than the source image. Source and destination |
| images must use the same sample model and the same coordinates (both for pixels and tiles). |
| |
| <p>Contrarily to <code>PixelIterator</code>, <code>WritablePixelIterator</code> needs to be closed after |
| iteration in order to release tiles. Example:</p> |
| |
| |
| <div class="snippet-container"><button class="copy snippet-copy" aria-label="Copy snippet" onclick="copySnippet(this)"><span data-copied="Copied!">Copy</span><img src="../../../../../copy.svg" alt="Copy snippet"></button> |
| <pre class="snippet"><code class="language-java">try (WritablePixelIterator it = WritablePixelIterator.create(image)) { |
| double[] samples = null; |
| while (it.next()) { |
| samples = it.getPixel(samples); // Get values in all bands. |
| // Perform computation here... |
| it.setPixels(sample); // Replace values in all bands. |
| } |
| } |
| </code></pre> |
| </div> |
| |
| |
| <h2 id="casting-a-pixeliterator-heading">Casting a <code>PixelIterator</code></h2> |
| To check if a <code>PixelIterator</code> can be used for writing pixels, a <code>… instanceof WritablePixelIterator</code> |
| check is not sufficient. The <a href="PixelIterator.html#isWritable()"><code>PixelIterator.isWritable()</code></a> method should be invoked instead.</div> |
| <dl class="notes"> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <li> |
| <section class="nested-class-summary" id="nested-class-summary"> |
| <h2>Nested Class Summary</h2> |
| <div class="inherited-list"> |
| <h2 id="nested-classes-inherited-from-class-org.apache.sis.image.PixelIterator">Nested classes/interfaces inherited from class <a href="PixelIterator.html" title="class in org.apache.sis.image">PixelIterator</a></h2> |
| <code><a href="PixelIterator.Builder.html" title="class in org.apache.sis.image">PixelIterator.Builder</a>, <a href="PixelIterator.Window.html" title="class in org.apache.sis.image">PixelIterator.Window</a><<a href="PixelIterator.Window.html" title="type parameter in PixelIterator.Window">T</a> extends <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/Buffer.html" title="class or interface in java.nio" class="external-link">Buffer</a>></code></div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li> |
| <section class="method-summary" id="method-summary"> |
| <h2>Method Summary</h2> |
| <div id="method-summary-table"> |
| <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div> |
| <div id="method-summary-table.tabpanel" role="tabpanel"> |
| <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Method</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#close()" class="member-name-link">close</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Releases any resources hold by this iterator.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="WritablePixelIterator.html" title="class in org.apache.sis.image">WritablePixelIterator</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#create(java.awt.image.WritableRenderedImage)" class="member-name-link">create</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/WritableRenderedImage.html" title="class or interface in java.awt.image" class="external-link">WritableRenderedImage</a> data)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Creates an iterator for all pixels in the given image.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isWritable()" class="member-name-link">isWritable</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns <code>true</code> if this iterator can write pixel values.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setDataElements(java.lang.Object)" class="member-name-link">setDataElements</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> values)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets the data elements (not necessarily band values) of current pixel.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setPixel(double%5B%5D)" class="member-name-link">setPixel</a><wbr>(double[] values)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets the sample values of current pixel for all bands.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setPixel(float%5B%5D)" class="member-name-link">setPixel</a><wbr>(float[] values)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets the sample values of current pixel for all bands.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setPixel(int%5B%5D)" class="member-name-link">setPixel</a><wbr>(int[] values)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets the sample values of current pixel for all bands.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setSample(int,double)" class="member-name-link">setSample</a><wbr>(int band, |
| double value)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Writes a sample value in the specified band of current pixel.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setSample(int,float)" class="member-name-link">setSample</a><wbr>(int band, |
| float value)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Writes a sample value in the specified band of current pixel.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setSample(int,int)" class="member-name-link">setSample</a><wbr>(int band, |
| int value)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Writes a sample value in the specified band of current pixel.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-PixelIterator">Methods inherited from class <a href="PixelIterator.html" title="class in org.apache.sis.image">PixelIterator</a></h3> |
| <code><a href="PixelIterator.html#create(java.awt.image.RenderedImage)">create</a>, <a href="PixelIterator.html#createWindow(org.apache.sis.image.TransferType)">createWindow</a>, <a href="PixelIterator.html#getDataElements(java.lang.Object)">getDataElements</a>, <a href="PixelIterator.html#getDataType()">getDataType</a>, <a href="PixelIterator.html#getDomain()">getDomain</a>, <a href="PixelIterator.html#getIterationOrder()">getIterationOrder</a>, <a href="PixelIterator.html#getNumBands()">getNumBands</a>, <a href="PixelIterator.html#getPixel(double%5B%5D)">getPixel</a>, <a href="PixelIterator.html#getPixel(float%5B%5D)">getPixel</a>, <a href="PixelIterator.html#getPixel(int%5B%5D)">getPixel</a>, <a href="PixelIterator.html#getPosition()">getPosition</a>, <a href="PixelIterator.html#getSample(int)">getSample</a>, <a href="PixelIterator.html#getSampleDouble(int)">getSampleDouble</a>, <a href="PixelIterator.html#getSampleFloat(int)">getSampleFloat</a>, <a href="PixelIterator.html#getSampleRanges()">getSampleRanges</a>, <a href="PixelIterator.html#getTransferType()">getTransferType</a>, <a href="PixelIterator.html#moveTo(int,int)">moveTo</a>, <a href="PixelIterator.html#next()">next</a>, <a href="PixelIterator.html#rewind()">rewind</a></code></div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-Object">Methods inherited from class <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="create(java.awt.image.WritableRenderedImage)"> |
| <h3>create</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="WritablePixelIterator.html" title="class in org.apache.sis.image">WritablePixelIterator</a></span> <span class="element-name">create</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/WritableRenderedImage.html" title="class or interface in java.awt.image" class="external-link">WritableRenderedImage</a> data)</span></div> |
| <div class="block">Creates an iterator for all pixels in the given image. |
| This is a convenience method for <code>new Builder().createWritable(data)</code>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>data</code> - the image which contains the sample values on which to iterate.</dd> |
| <dt>Returns:</dt> |
| <dd>a new iterator traversing all pixels in the given image, in arbitrary order.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="isWritable()"> |
| <h3>isWritable</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isWritable</span>()</div> |
| <div class="block">Returns <code>true</code> if this iterator can write pixel values. For some implementations, being an |
| instance of <code>WritablePixelIterator</code> is not sufficient for being able to write pixel values. |
| |
| <p><b>Note:</b> all instances created by <code>WritablePixelIterator.create(…)</code> methods are |
| guaranteed to <code>true</code>.</p></div> |
| <dl class="notes"> |
| <dt>Overrides:</dt> |
| <dd><code><a href="PixelIterator.html#isWritable()">isWritable</a></code> in class <code><a href="PixelIterator.html" title="class in org.apache.sis.image">PixelIterator</a></code></dd> |
| <dt>Returns:</dt> |
| <dd><code>true</code> if this iterator can be used for writing pixel values.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setSample(int,int)"> |
| <h3>setSample</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setSample</span><wbr><span class="parameters">(int band, |
| int value)</span></div> |
| <div class="block">Writes a sample value in the specified band of current pixel. |
| The <a href="PixelIterator.html#next()"><code>PixelIterator.next()</code></a> method must have returned <code>true</code>, or the <a href="PixelIterator.html#moveTo(int,int)"><code>PixelIterator.moveTo(int,int)</code></a> method must have |
| been invoked successfully, before this <code>setSample(int, int)</code> method is invoked. If above condition is |
| not met, then this method behavior is undefined (there is no explicit bounds check for performance reasons).</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>band</code> - the band in which to set the sample value.</dd> |
| <dd><code>value</code> - the sample value to write in the specified band.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="tag-list-long"> |
| <li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/WritableRaster.html#setSample(int,int,int,int)" title="class or interface in java.awt.image" class="external-link"><code>WritableRaster.setSample(int, int, int, int)</code></a></li> |
| <li><a href="PixelIterator.html#getSample(int)"><code>PixelIterator.getSample(int)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setSample(int,float)"> |
| <h3>setSample</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setSample</span><wbr><span class="parameters">(int band, |
| float value)</span></div> |
| <div class="block">Writes a sample value in the specified band of current pixel. |
| The <a href="PixelIterator.html#next()"><code>PixelIterator.next()</code></a> method must have returned <code>true</code>, or the <a href="PixelIterator.html#moveTo(int,int)"><code>PixelIterator.moveTo(int,int)</code></a> method must have |
| been invoked successfully, before this <code>setSample(int, float)</code> method is invoked. If above condition is |
| not met, then this method behavior is undefined (there is no explicit bounds check for performance reasons).</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>band</code> - the band in which to set the sample value.</dd> |
| <dd><code>value</code> - the sample value to write in the specified band.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="tag-list-long"> |
| <li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/WritableRaster.html#setSample(int,int,int,float)" title="class or interface in java.awt.image" class="external-link"><code>WritableRaster.setSample(int, int, int, float)</code></a></li> |
| <li><a href="PixelIterator.html#getSampleFloat(int)"><code>PixelIterator.getSampleFloat(int)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setSample(int,double)"> |
| <h3>setSample</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setSample</span><wbr><span class="parameters">(int band, |
| double value)</span></div> |
| <div class="block">Writes a sample value in the specified band of current pixel. |
| The <a href="PixelIterator.html#next()"><code>PixelIterator.next()</code></a> method must have returned <code>true</code>, or the <a href="PixelIterator.html#moveTo(int,int)"><code>PixelIterator.moveTo(int,int)</code></a> method must have |
| been invoked successfully, before this <code>setSample(int, double)</code> method is invoked. If above condition is |
| not met, then this method behavior is undefined (there is no explicit bounds check for performance reasons).</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>band</code> - the band in which to set the sample value.</dd> |
| <dd><code>value</code> - the sample value to write in the specified band.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="tag-list-long"> |
| <li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/WritableRaster.html#setSample(int,int,int,double)" title="class or interface in java.awt.image" class="external-link"><code>WritableRaster.setSample(int, int, int, double)</code></a></li> |
| <li><a href="PixelIterator.html#getSampleDouble(int)"><code>PixelIterator.getSampleDouble(int)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setPixel(int[])"> |
| <h3>setPixel</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setPixel</span><wbr><span class="parameters">(int[] values)</span></div> |
| <div class="block">Sets the sample values of current pixel for all bands. |
| The <a href="PixelIterator.html#next()"><code>PixelIterator.next()</code></a> method must have returned <code>true</code>, or the <a href="PixelIterator.html#moveTo(int,int)"><code>PixelIterator.moveTo(int,int)</code></a> method must have |
| been invoked successfully, before this <code>setPixel(…)</code> method is invoked. If above condition is not met, |
| then this method behavior is undefined (there is no explicit bounds check for performance reasons).</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>values</code> - the new sample values for current pixel.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="tag-list-long"> |
| <li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/WritableRaster.html#setPixel(int,int,int%5B%5D)" title="class or interface in java.awt.image" class="external-link"><code>WritableRaster.setPixel(int, int, int[])</code></a></li> |
| <li><a href="PixelIterator.html#getPixel(int%5B%5D)"><code>PixelIterator.getPixel(int[])</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setPixel(float[])"> |
| <h3>setPixel</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setPixel</span><wbr><span class="parameters">(float[] values)</span></div> |
| <div class="block">Sets the sample values of current pixel for all bands. |
| The <a href="PixelIterator.html#next()"><code>PixelIterator.next()</code></a> method must have returned <code>true</code>, or the <a href="PixelIterator.html#moveTo(int,int)"><code>PixelIterator.moveTo(int,int)</code></a> method must have |
| been invoked successfully, before this <code>setPixel(…)</code> method is invoked. If above condition is not met, |
| then this method behavior is undefined (there is no explicit bounds check for performance reasons).</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>values</code> - the new sample values for current pixel.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="tag-list-long"> |
| <li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/WritableRaster.html#setPixel(int,int,float%5B%5D)" title="class or interface in java.awt.image" class="external-link"><code>WritableRaster.setPixel(int, int, float[])</code></a></li> |
| <li><a href="PixelIterator.html#getPixel(float%5B%5D)"><code>PixelIterator.getPixel(float[])</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setPixel(double[])"> |
| <h3>setPixel</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setPixel</span><wbr><span class="parameters">(double[] values)</span></div> |
| <div class="block">Sets the sample values of current pixel for all bands. |
| The <a href="PixelIterator.html#next()"><code>PixelIterator.next()</code></a> method must have returned <code>true</code>, or the <a href="PixelIterator.html#moveTo(int,int)"><code>PixelIterator.moveTo(int,int)</code></a> method must have |
| been invoked successfully, before this <code>setPixel(…)</code> method is invoked. If above condition is not met, |
| then this method behavior is undefined (there is no explicit bounds check for performance reasons).</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>values</code> - the new sample values for current pixel.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="tag-list-long"> |
| <li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/WritableRaster.html#setPixel(int,int,double%5B%5D)" title="class or interface in java.awt.image" class="external-link"><code>WritableRaster.setPixel(int, int, double[])</code></a></li> |
| <li><a href="PixelIterator.html#getPixel(double%5B%5D)"><code>PixelIterator.getPixel(double[])</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setDataElements(java.lang.Object)"> |
| <h3>setDataElements</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setDataElements</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> values)</span></div> |
| <div class="block">Sets the data elements (not necessarily band values) of current pixel. |
| The <code>Object</code> argument is a relatively opaque format (it may be <code>int[]</code>, <code>byte[]</code>, <i>etc.</i>). |
| It should be the value provided by a call to <a href="PixelIterator.html#getDataElements(java.lang.Object)"><code>PixelIterator.getDataElements(Object)</code></a> on an image using |
| a compatible sample model.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>values</code> - the new the data elements.</dd> |
| <dt>Since:</dt> |
| <dd>1.1</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="tag-list-long"> |
| <li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/WritableRaster.html#setDataElements(int,int,java.lang.Object)" title="class or interface in java.awt.image" class="external-link"><code>WritableRaster.setDataElements(int, int, Object)</code></a></li> |
| <li><a href="PixelIterator.html#getDataElements(java.lang.Object)"><code>PixelIterator.getDataElements(Object)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="close()"> |
| <h3>close</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">close</span>()</div> |
| <div class="block">Releases any resources hold by this iterator. |
| If some pixel values have been written, the changes are committed.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/AutoCloseable.html#close()" title="class or interface in java.lang" class="external-link">close</a></code> in interface <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/AutoCloseable.html" title="class or interface in java.lang" class="external-link">AutoCloseable</a></code></dd> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Closeable.html#close()" title="class or interface in java.io" class="external-link">close</a></code> in interface <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Closeable.html" title="class or interface in java.io" class="external-link">Closeable</a></code></dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| </div> |
| </div> |
| </body> |
| </html> |