blob: 9a8c6d4cf4e0287592246b51e68e9615d6fb6f12 [file] [log] [blame]
<!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">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</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:&nbsp;</li>
<li><a href="#nested-class-summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</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>&nbsp;<a href="../../../../module-summary.html">org.apache.sis.feature</a></div>
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<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">Auto­Closeable</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>Pixel­Iterator</code>, <code>Writable­Pixel­Iterator</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>Pixel­Iterator</code></h2>
To check if a <code>Pixel­Iterator</code> can be used for writing pixels, a <code>… instanceof Writable­Pixel­Iterator</code>
check is not sufficient. The <a href="PixelIterator.html#isWritable()"><code>Pixel­Iterator​.is­Writable()</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&nbsp;<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">Pixel­Iterator​.Builder</a>, <a href="PixelIterator.Window.html" title="class in org.apache.sis.image">Pixel­Iterator​.Window</a>&lt;<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>&gt;</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">Writable­Pixel­Iterator</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">Writable­Rendered­Image</a>&nbsp;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">is­Writable</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">set­Data­Elements</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>&nbsp;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">set­Pixel</a><wbr>(double[]&nbsp;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">set­Pixel</a><wbr>(float[]&nbsp;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">set­Pixel</a><wbr>(int[]&nbsp;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">set­Sample</a><wbr>(int&nbsp;band,
double&nbsp;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">set­Sample</a><wbr>(int&nbsp;band,
float&nbsp;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">set­Sample</a><wbr>(int&nbsp;band,
int&nbsp;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&nbsp;<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)">create­Window</a>, <a href="PixelIterator.html#getDataElements(java.lang.Object)">get­Data­Elements</a>, <a href="PixelIterator.html#getDataType()">get­Data­Type</a>, <a href="PixelIterator.html#getDomain()">get­Domain</a>, <a href="PixelIterator.html#getIterationOrder()">get­Iteration­Order</a>, <a href="PixelIterator.html#getNumBands()">get­Num­Bands</a>, <a href="PixelIterator.html#getPixel(double%5B%5D)">get­Pixel</a>, <a href="PixelIterator.html#getPixel(float%5B%5D)">get­Pixel</a>, <a href="PixelIterator.html#getPixel(int%5B%5D)">get­Pixel</a>, <a href="PixelIterator.html#getPosition()">get­Position</a>, <a href="PixelIterator.html#getSample(int)">get­Sample</a>, <a href="PixelIterator.html#getSampleDouble(int)">get­Sample­Double</a>, <a href="PixelIterator.html#getSampleFloat(int)">get­Sample­Float</a>, <a href="PixelIterator.html#getSampleRanges()">get­Sample­Ranges</a>, <a href="PixelIterator.html#getTransferType()">get­Transfer­Type</a>, <a href="PixelIterator.html#moveTo(int,int)">move­To</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&nbsp;<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">get­Class</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">hash­Code</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">notify­All</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">to­String</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>&nbsp;<span class="return-type"><a href="WritablePixelIterator.html" title="class in org.apache.sis.image">WritablePixelIterator</a></span>&nbsp;<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>&nbsp;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()​.create­Writable(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>&nbsp;<span class="return-type">boolean</span>&nbsp;<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>Writable­Pixel­Iterator</code> is not sufficient for being able to write pixel values.
<p><b>Note:</b> all instances created by <code>Writable­Pixel­Iterator​.create(…)</code> methods are
guaranteed to <code>true</code>.</p></div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="PixelIterator.html#isWritable()">is­Writable</a></code>&nbsp;in class&nbsp;<code><a href="PixelIterator.html" title="class in org.apache.sis.image">Pixel­Iterator</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>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setSample</span><wbr><span class="parameters">(int&nbsp;band,
int&nbsp;value)</span></div>
<div class="block">Writes a sample value in the specified band of current pixel.
The <a href="PixelIterator.html#next()"><code>Pixel­Iterator​.next()</code></a> method must have returned <code>true</code>, or the <a href="PixelIterator.html#moveTo(int,int)"><code>Pixel­Iterator​.move­To(int,int)</code></a> method must have
been invoked successfully, before this <code>set­Sample(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>Writable­Raster​.set­Sample(int, int, int, int)</code></a></li>
<li><a href="PixelIterator.html#getSample(int)"><code>Pixel­Iterator​.get­Sample(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>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setSample</span><wbr><span class="parameters">(int&nbsp;band,
float&nbsp;value)</span></div>
<div class="block">Writes a sample value in the specified band of current pixel.
The <a href="PixelIterator.html#next()"><code>Pixel­Iterator​.next()</code></a> method must have returned <code>true</code>, or the <a href="PixelIterator.html#moveTo(int,int)"><code>Pixel­Iterator​.move­To(int,int)</code></a> method must have
been invoked successfully, before this <code>set­Sample(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>Writable­Raster​.set­Sample(int, int, int, float)</code></a></li>
<li><a href="PixelIterator.html#getSampleFloat(int)"><code>Pixel­Iterator​.get­Sample­Float(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>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setSample</span><wbr><span class="parameters">(int&nbsp;band,
double&nbsp;value)</span></div>
<div class="block">Writes a sample value in the specified band of current pixel.
The <a href="PixelIterator.html#next()"><code>Pixel­Iterator​.next()</code></a> method must have returned <code>true</code>, or the <a href="PixelIterator.html#moveTo(int,int)"><code>Pixel­Iterator​.move­To(int,int)</code></a> method must have
been invoked successfully, before this <code>set­Sample(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>Writable­Raster​.set­Sample(int, int, int, double)</code></a></li>
<li><a href="PixelIterator.html#getSampleDouble(int)"><code>Pixel­Iterator​.get­Sample­Double(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>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setPixel</span><wbr><span class="parameters">(int[]&nbsp;values)</span></div>
<div class="block">Sets the sample values of current pixel for all bands.
The <a href="PixelIterator.html#next()"><code>Pixel­Iterator​.next()</code></a> method must have returned <code>true</code>, or the <a href="PixelIterator.html#moveTo(int,int)"><code>Pixel­Iterator​.move­To(int,int)</code></a> method must have
been invoked successfully, before this <code>set­Pixel(…)</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>Writable­Raster​.set­Pixel(int, int, int[])</code></a></li>
<li><a href="PixelIterator.html#getPixel(int%5B%5D)"><code>Pixel­Iterator​.get­Pixel(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>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setPixel</span><wbr><span class="parameters">(float[]&nbsp;values)</span></div>
<div class="block">Sets the sample values of current pixel for all bands.
The <a href="PixelIterator.html#next()"><code>Pixel­Iterator​.next()</code></a> method must have returned <code>true</code>, or the <a href="PixelIterator.html#moveTo(int,int)"><code>Pixel­Iterator​.move­To(int,int)</code></a> method must have
been invoked successfully, before this <code>set­Pixel(…)</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>Writable­Raster​.set­Pixel(int, int, float[])</code></a></li>
<li><a href="PixelIterator.html#getPixel(float%5B%5D)"><code>Pixel­Iterator​.get­Pixel(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>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setPixel</span><wbr><span class="parameters">(double[]&nbsp;values)</span></div>
<div class="block">Sets the sample values of current pixel for all bands.
The <a href="PixelIterator.html#next()"><code>Pixel­Iterator​.next()</code></a> method must have returned <code>true</code>, or the <a href="PixelIterator.html#moveTo(int,int)"><code>Pixel­Iterator​.move­To(int,int)</code></a> method must have
been invoked successfully, before this <code>set­Pixel(…)</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>Writable­Raster​.set­Pixel(int, int, double[])</code></a></li>
<li><a href="PixelIterator.html#getPixel(double%5B%5D)"><code>Pixel­Iterator​.get­Pixel(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>&nbsp;<span class="return-type">void</span>&nbsp;<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>&nbsp;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>Pixel­Iterator​.get­Data­Elements(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>Writable­Raster​.set­Data­Elements(int, int, Object)</code></a></li>
<li><a href="PixelIterator.html#getDataElements(java.lang.Object)"><code>Pixel­Iterator​.get­Data­Elements(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>&nbsp;<span class="return-type">void</span>&nbsp;<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>&nbsp;in interface&nbsp;<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">Auto­Closeable</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>&nbsp;in interface&nbsp;<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>