blob: 6139cf101880d59fd497b35f11ed3112ce8911cb [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (19) -->
<title>ImageRenderer (Apache SIS 1.3 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="description" content="declaration: package: org.apache.sis.coverage.grid, class: ImageRenderer">
<meta name="generator" content="javadoc/ClassWriterImpl">
<meta name="keywords" content="org.apache.sis.coverage.grid.ImageRenderer class">
<meta name="keywords" content="getNumBands()">
<meta name="keywords" content="getBounds()">
<meta name="keywords" content="getXYDimensions()">
<meta name="keywords" content="getImageGeometry()">
<meta name="keywords" content="getProperty()">
<meta name="keywords" content="addProperty()">
<meta name="keywords" content="setData()">
<meta name="keywords" content="setInterleavedPixelOffsets()">
<meta name="keywords" content="setVisibleBand()">
<meta name="keywords" content="setCategoryColors()">
<meta name="keywords" content="createRaster()">
<meta name="keywords" content="createImage()">
<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">
<link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-3.6.0.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="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/ImageRenderer.html">Use</a></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>Nested</li>
<li>Field</li>
<li><a href="#constructor-summary">Constr</a></li>
<li><a href="#method-summary">Method</a></li>
</ul>
</li>
<li>
<p>Detail:</p>
<ul>
<li>Field</li>
<li><a href="#constructor-detail">Constr</a></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>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&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><a href="#constructor-detail">Constr</a>&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="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.sis.coverage.grid</a></div>
<h1 title="Class ImageRenderer" class="title">Class ImageRenderer</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
<div class="inheritance">ImageRenderer</div>
</div>
<section class="class-description" id="class-description">
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">ImageRenderer</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
<div class="block">A builder for the rendered image to be returned by <a href="GridCoverage.html#render(org.apache.sis.coverage.grid.GridExtent)"><code>Grid­Coverage​.render(Grid­Extent)</code></a>.
This builder does not copy any sample values. Instead, it wraps existing data arrays into
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/Raster.html" title="class or interface in java.awt.image" class="external-link"><code>Raster</code></a> objects by computing required information such as
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/ComponentSampleModel.html#getPixelStride()" title="class or interface in java.awt.image" class="external-link">pixel stride</a>,
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/ComponentSampleModel.html#getScanlineStride()" title="class or interface in java.awt.image" class="external-link">scanline stride</a> and
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/ComponentSampleModel.html#getBandOffsets()" title="class or interface in java.awt.image" class="external-link">band offsets</a>.
Different <code>set­Data(…)</code> methods are provided for allowing to specify the data arrays
from different objects such as Java2D <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/DataBuffer.html" title="class or interface in java.awt.image" class="external-link"><code>Data­Buffer</code></a> or NIO <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/Buffer.html" title="class or interface in java.nio" class="external-link"><code>Buffer</code></a>.
<p>All <code>set­Data(…)</code> methods assume that the first valid element in each array is the value
located at <code><a href="GridCoverage.html#getGridGeometry()">Grid­Coverage​.get­Grid­Geometry()</a>.<a href="GridGeometry.html#getExtent()">get­Extent()</a>.<a href="GridExtent.html#getLow(int)">get­Low()</a></code>. This <code>Image­Renderer</code> class
computes automatically the offsets from that position to the position of the first value included
in the <code>slice­Extent</code> given to the constructor.</p>
<div class="note"><b>Usage example:</b>
<blockquote><pre><font color="green">class</font> MyResource <font color="green">extends</font> GridCoverage {
@Override
<font color="green">public</font> RenderedImage <b>render</b>(GridExtent sliceExtent) {
ImageRenderer renderer = <font color="green">new</font> <b>ImageRenderer</b>(<font color="green">this</font>, sliceExtent);
<font color="green">try</font> {
renderer.<b>setData</b>(data);
<font color="green">return</font> renderer.<b>createImage</b>();
} <font color="green">catch</font> (IllegalArgumentException | ArithmeticException | RasterFormatException e) {
<font color="green">throw</font> <font color="green">new</font> <b>CannotEvaluateException</b>(<font color="orangered">"Cannot create an image."</font>, e);
}
}
}</pre></blockquote>
</div>
<h2>Limitations</h2>
Current implementation constructs only images made of a single tile.
Support for tiled images will be added in a future version.</div>
<dl class="notes">
<dt>Since:</dt>
<dd>1.0</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="GridCoverage.html#render(org.apache.sis.coverage.grid.GridExtent)"><code>Grid­Coverage​.render(Grid­Extent)</code></a></li>
</ul>
</dd>
<p><font size="-1">Defined in the <code>sis-feature</code> module</font></p>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(org.apache.sis.coverage.grid.GridCoverage,org.apache.sis.coverage.grid.GridExtent)" class="member-name-link">Image­Renderer</a><wbr>(<a href="GridCoverage.html" title="class in org.apache.sis.coverage.grid">Grid­Coverage</a>&nbsp;coverage,
<a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">Grid­Extent</a>&nbsp;slice­Extent)</code></div>
<div class="col-last even-row-color">
<div class="block">Creates a new image renderer for the given slice extent.</div>
</div>
</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-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="#addProperty(java.lang.String,java.lang.Object)" class="member-name-link">add­Property</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key,
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&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">Adds a value associated to a property.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/RenderedImage.html" title="class or interface in java.awt.image" class="external-link">Rendered­Image</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#createImage()" class="member-name-link">create­Image</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Creates an image with the data specified by the last call to a <code>set­Data(…)</code> method.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/Raster.html" title="class or interface in java.awt.image" class="external-link">Raster</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#createRaster()" class="member-name-link">create­Raster</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Creates a raster with the data specified by the last call to a <code>set­Data(…)</code> method.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>final <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/Rectangle.html" title="class or interface in java.awt" class="external-link">Rectangle</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getBounds()" class="member-name-link">get­Bounds</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the location of the image upper-left corner together with the image size.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid">Grid­Geometry</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getImageGeometry(int)" class="member-name-link">get­Image­Geometry</a><wbr>(int&nbsp;dim­CRS)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Computes the conversion from pixel coordinates to CRS, together with the geospatial envelope of the image.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>final int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getNumBands()" class="member-name-link">get­Num­Bands</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the number of bands that the image will have.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getProperty(java.lang.String)" class="member-name-link">get­Property</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the value associated to the given property.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>final int[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getXYDimensions()" class="member-name-link">get­XYDimensions</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">The dimensions to select in the grid coverage for producing an image.</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="#setCategoryColors(java.util.function.Function)" class="member-name-link">set­Category­Colors</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/function/Function.html" title="class or interface in java.util.function" class="external-link">Function</a>&lt;<a href="../Category.html" title="class in org.apache.sis.coverage">Category</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/Color.html" title="class or interface in java.awt" class="external-link">Color</a>[]&gt;&nbsp;colors)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Specifies the colors to apply for each category in a sample dimension.</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="#setData(java.awt.image.DataBuffer)" class="member-name-link">set­Data</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/DataBuffer.html" title="class or interface in java.awt.image" class="external-link">Data­Buffer</a>&nbsp;data)</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 as a Java2D buffer.</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="#setData(org.apache.sis.image.DataType,java.nio.Buffer...)" class="member-name-link">set­Data</a><wbr>(<a href="../../image/DataType.html" title="enum class in org.apache.sis.image">Data­Type</a>&nbsp;data­Type,
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/Buffer.html" title="class or interface in java.nio" class="external-link">Buffer</a>...&nbsp;data)</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 data as NIO buffers.</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="#setData(org.apache.sis.math.Vector...)" class="member-name-link">set­Data</a><wbr>(<a href="../../math/Vector.html" title="class in org.apache.sis.math">Vector</a>...&nbsp;data)</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 as vectors.</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="#setInterleavedPixelOffsets(int,int%5B%5D)" class="member-name-link">set­Interleaved­Pixel­Offsets</a><wbr>(int&nbsp;pixel­Stride,
int[]&nbsp;band­Offsets)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Specifies the offsets to add to sample index in each band in order to reach the sample value in the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/DataBuffer.html" title="class or interface in java.awt.image" class="external-link"><code>Data­Buffer</code></a> bank.</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="#setVisibleBand(int)" class="member-name-link">set­Visible­Band</a><wbr>(int&nbsp;band)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Specifies the band to use for defining pixel colors when the image is displayed on screen.</div>
</div>
</div>
</div>
</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/16/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/16/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/16/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/16/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/16/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/16/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/16/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/16/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/16/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/16/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/16/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/16/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">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;(org.apache.sis.coverage.grid.GridCoverage,org.apache.sis.coverage.grid.GridExtent)">
<h3>ImageRenderer</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">ImageRenderer</span><wbr><span class="parameters">(<a href="GridCoverage.html" title="class in org.apache.sis.coverage.grid">GridCoverage</a>&nbsp;coverage,
<a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">GridExtent</a>&nbsp;sliceExtent)</span></div>
<div class="block">Creates a new image renderer for the given slice extent.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>coverage</code> - the source coverage for which to build an image.</dd>
<dd><code>slice­Extent</code> - the domain from which to create an image, or <code>null</code> for the <code>coverage</code> extent.</dd>
<dt>Throws:</dt>
<dd><code><a href="../SubspaceNotSpecifiedException.html" title="class in org.apache.sis.coverage">Subspace­Not­Specified­Exception</a></code> - if this method cannot infer a two-dimensional slice from <code>slice­Extent</code>.</dd>
<dd><code><a href="DisjointExtentException.html" title="class in org.apache.sis.coverage.grid">Disjoint­Extent­Exception</a></code> - if the given extent does not intersect the given coverage.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if a stride calculation overflows the 32 bits integer capacity.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="getNumBands()">
<h3>getNumBands</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getNumBands</span>()</div>
<div class="block">Returns the number of bands that the image will have. By default, this is the number of
<a href="GridCoverage.html#getSampleDimensions()">sample dimensions</a> in the grid coverage.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the number of bands in the rendered image.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getBounds()">
<h3>getBounds</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/Rectangle.html" title="class or interface in java.awt" class="external-link">Rectangle</a></span>&nbsp;<span class="element-name">getBounds</span>()</div>
<div class="block">Returns the location of the image upper-left corner together with the image size. The image coordinate system
is relative to the <code>slice­Extent</code> specified at construction time: the (0,0) pixel coordinates correspond
to the <code>slice­Extent</code> <a href="GridExtent.html#getLow(int)">low coordinates</a>. Consequently, the rectangle
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/Rectangle.html#x" title="class or interface in java.awt" class="external-link"><var>x</var></a> and <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/Rectangle.html#y" title="class or interface in java.awt" class="external-link"><var>y</var></a> coordinates are (0,0) if
the image is located exactly in the area requested by <code>slice­Extent</code>, or is shifted as below otherwise:
<blockquote>( <var>x</var>, <var>y</var> ) =
(grid coordinates of actually provided region) − (grid coordinates of requested region)</blockquote></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the rendered image location and size (never null).</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getXYDimensions()">
<h3>getXYDimensions</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">int[]</span>&nbsp;<span class="element-name">getXYDimensions</span>()</div>
<div class="block">The dimensions to select in the grid coverage for producing an image. This is the array obtained
by <code><a href="GridExtent.html#getSubspaceDimensions(int)"><code>Grid­Extent​.get­Subspace­Dimensions(2)</code></a></code>.
The array content is almost always {0,1}, i.e. the 2 first dimensions in a coordinate tuple.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>indices of <var>x</var> and <var>y</var> coordinate values in a grid coordinate tuple.</dd>
<dt>Since:</dt>
<dd>1.3</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getImageGeometry(int)">
<h3>getImageGeometry</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid">GridGeometry</a></span>&nbsp;<span class="element-name">getImageGeometry</span><wbr><span class="parameters">(int&nbsp;dimCRS)</span></div>
<div class="block">Computes the conversion from pixel coordinates to CRS, together with the geospatial envelope of the image.
The <a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid"><code>Grid­Geometry</code></a> returned by this method is derived from the <a href="GridCoverage.html#getGridGeometry()">coverage grid geometry</a> with the following changes:
<ul>
<li>The <a href="GridGeometry.html#getDimension()">number of grid dimensions</a> is always 2.</li>
<li>The number of <a href="GridGeometry.html#getCoordinateReferenceSystem()">CRS</a> dimensions
is specified by <code>dim­CRS</code> (usually 2).</li>
<li>The <a href="GridGeometry.html#getEnvelope()">envelope</a> may be a sub-region of the coverage envelope.</li>
<li>The <a href="GridGeometry.html#getExtent()">grid extent</a> is the <a href="#getBounds()">image bounds</a>.</li>
<li>The <a href="GridGeometry.html#getGridToCRS(org.opengis.referencing.datum.PixelInCell)">grid to CRS</a> transform is derived from the coverage transform
with a translation for mapping the <code>slice­Extent</code> <a href="GridExtent.html#getLow(int)">low coordinates</a>
to (0,0) pixel coordinates.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>dim­CRS</code> - desired number of dimensions in the CRS. This is usually 2.</dd>
<dt>Returns:</dt>
<dd>conversion from pixel coordinates to CRS of the given number of dimensions,
together with image bounds and geospatial envelope if possible.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../../image/PlanarImage.html#GRID_GEOMETRY_KEY"><code>Planar­Image​.GRID_GEOMETRY_KEY</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getProperty(java.lang.String)">
<h3>getProperty</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span>&nbsp;<span class="element-name">getProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key)</span></div>
<div class="block">Returns the value associated to the given property. By default the only property is
<a href="../../image/PlanarImage.html#GRID_GEOMETRY_KEY">"org.apache.sis.GridGeometry"</a>, but more properties can
be added by calls to <a href="#addProperty(java.lang.String,java.lang.Object)"><code>add­Property(String, Object)</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>key</code> - the property for which to get a value.</dd>
<dt>Returns:</dt>
<dd>value associated to the given property, or <code>null</code> if none.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="addProperty(java.lang.String,java.lang.Object)">
<h3>addProperty</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">addProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key,
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;value)</span></div>
<div class="block">Adds a value associated to a property. This method can be invoked only once for each <code>key</code>.
Those properties will be given to the image created by the <a href="#createImage()"><code>create­Image()</code></a> method.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>key</code> - key of the property to set.</dd>
<dd><code>value</code> - value to associate to the given key.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if a value is already associated to the given key.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setData(java.awt.image.DataBuffer)">
<h3>setData</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setData</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/DataBuffer.html" title="class or interface in java.awt.image" class="external-link">DataBuffer</a>&nbsp;data)</span></div>
<div class="block">Sets the data as a Java2D buffer. The <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/DataBuffer.html#getNumBanks()" title="class or interface in java.awt.image" class="external-link">number of banks</a>
in the given buffer must be equal to the <a href="#getNumBands()">expected number of bands</a>.
In each bank, the value located at the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/DataBuffer.html#getOffsets()" title="class or interface in java.awt.image" class="external-link">bank offset</a> is the value
located at <code><a href="GridCoverage.html#getGridGeometry()">Grid­Coverage​.get­Grid­Geometry()</a>.<a href="GridGeometry.html#getExtent()">get­Extent()</a>.<a href="GridExtent.html#getLow(int)">get­Low()</a></code>, as specified in class javadoc.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>data</code> - the Java2D buffer containing data for all bands.</dd>
<dt>Throws:</dt>
<dd><code><a href="../../util/NullArgumentException.html" title="class in org.apache.sis.util">Null­Argument­Exception</a></code> - if <code>data</code> is null.</dd>
<dd><code><a href="../MismatchedCoverageRangeException.html" title="class in org.apache.sis.coverage">Mismatched­Coverage­Range­Exception</a></code> - if the given data buffer does not have the expected amount of banks.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setData(org.apache.sis.image.DataType,java.nio.Buffer...)">
<h3>setData</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setData</span><wbr><span class="parameters">(<a href="../../image/DataType.html" title="enum class in org.apache.sis.image">DataType</a>&nbsp;dataType,
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/Buffer.html" title="class or interface in java.nio" class="external-link">Buffer</a>...&nbsp;data)</span></div>
<div class="block">Sets the data as NIO buffers. The number of buffers must be equal to the <a href="#getNumBands()">expected
number of bands</a>. All buffers must be <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/Buffer.html#array()" title="class or interface in java.nio" class="external-link">backed by arrays</a> of the type specified by
the <code>data­Type</code> argument and have the same amount of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/Buffer.html#remaining()" title="class or interface in java.nio" class="external-link">remaining elements</a>.
This method wraps the underlying arrays of a primitive type into a Java2D buffer; data are not copied.
For each buffer, the grid coverage data (not only the slice data) starts at <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/Buffer.html#position()" title="class or interface in java.nio" class="external-link">buffer position</a> and ends at that position + <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/Buffer.html#remaining()" title="class or interface in java.nio" class="external-link">remaining</a>.
<p>The data type must be specified in order to distinguish between the signed and unsigned types.
<a href="../../image/DataType.html#BYTE"><code>Data­Type​.BYTE</code></a> and <a href="../../image/DataType.html#USHORT"><code>Data­Type​.USHORT</code></a> are unsigned, all other supported types are signed.</p>
<p><b>Implementation note:</b> the Java2D buffer is set by a call to <a href="#setData(java.awt.image.DataBuffer)"><code>set­Data(Data­Buffer)</code></a>,
which can be overridden by subclasses if desired.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>data­Type</code> - type of data.</dd>
<dd><code>data</code> - the buffers wrapping arrays of primitive type.</dd>
<dt>Throws:</dt>
<dd><code><a href="../../util/NullArgumentException.html" title="class in org.apache.sis.util">Null­Argument­Exception</a></code> - if <code>data</code> is null or one of <code>data</code> element is null.</dd>
<dd><code><a href="../MismatchedCoverageRangeException.html" title="class in org.apache.sis.coverage">Mismatched­Coverage­Range­Exception</a></code> - if the number of specified buffers is not equal to the number of bands.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang" class="external-link">Unsupported­Operation­Exception</a></code> - if a buffer is not backed by an accessible array or is read-only.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArrayStoreException.html" title="class or interface in java.lang" class="external-link">Array­Store­Exception</a></code> - if a buffer type is incompatible with <code>data­Type</code>.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/RasterFormatException.html" title="class or interface in java.awt.image" class="external-link">Raster­Format­Exception</a></code> - if buffers do not have the same amount of remaining values.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if a buffer position overflows the 32 bits integer capacity.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setData(org.apache.sis.math.Vector...)">
<h3>setData</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setData</span><wbr><span class="parameters">(<a href="../../math/Vector.html" title="class in org.apache.sis.math">Vector</a>...&nbsp;data)</span></div>
<div class="block">Sets the data as vectors. The number of vectors must be equal to the <a href="#getNumBands()">expected number of bands</a>.
All vectors must be backed by arrays (indirectly, through <a href="../../math/Vector.html#buffer()">buffers</a> backed by arrays) and have
the same <a href="../../math/Vector.html#size()">size</a>.
This method wraps the underlying arrays of a primitive type into a Java2D buffer; data are not copied.
<p><b>Implementation note:</b> the NIO buffers are set by a call to <a href="#setData(org.apache.sis.image.DataType,java.nio.Buffer...)"><code>set­Data(Data­Type, Buffer...)</code></a>,
which can be overridden by subclasses if desired.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>data</code> - the vectors wrapping arrays of primitive type.</dd>
<dt>Throws:</dt>
<dd><code><a href="../../util/NullArgumentException.html" title="class in org.apache.sis.util">Null­Argument­Exception</a></code> - if <code>data</code> is null or one of <code>data</code> element is null.</dd>
<dd><code><a href="../MismatchedCoverageRangeException.html" title="class in org.apache.sis.coverage">Mismatched­Coverage­Range­Exception</a></code> - if the number of specified vectors is not equal to the number of bands.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang" class="external-link">Unsupported­Operation­Exception</a></code> - if a vector is not backed by an accessible array or is read-only.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/RasterFormatException.html" title="class or interface in java.awt.image" class="external-link">Raster­Format­Exception</a></code> - if vectors do not have the same size.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if a buffer position overflows the 32 bits integer capacity.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setInterleavedPixelOffsets(int,int[])">
<h3>setInterleavedPixelOffsets</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setInterleavedPixelOffsets</span><wbr><span class="parameters">(int&nbsp;pixelStride,
int[]&nbsp;bandOffsets)</span></div>
<div class="block">Specifies the offsets to add to sample index in each band in order to reach the sample value in the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/DataBuffer.html" title="class or interface in java.awt.image" class="external-link"><code>Data­Buffer</code></a> bank.
This method should be invoked when the data given to <code>set­Data(…)</code> contains only one <a href="../../math/Vector.html" title="class in org.apache.sis.math"><code>Vector</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/Buffer.html" title="class or interface in java.nio" class="external-link"><code>Buffer</code></a> or
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/DataBuffer.html" title="class or interface in java.awt.image" class="external-link"><code>Data­Buffer</code></a> bank, and the bands in that unique bank are interleaved.
<div class="note"><b>Example:</b>
for an image having three bands named Red (R), Green (G) and Blue (B), if the sample values are stored in a single bank in a
R₀,G₀,B₀, R₁,G₁,B₁, R₂,G₂,B₂, R₃,G₃,B₃, <i>etc.</i> fashion, then this method should be invoked as below:
<blockquote><pre><b>setInterleavedPixelOffsets</b>(3, <font color="green">new</font> <font color="green">int</font>[] {0, 1, 2});</pre></blockquote>
</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>pixel­Stride</code> - the number of data elements between each pixel in the data vector or buffer.</dd>
<dd><code>band­Offsets</code> - offsets to add to sample index in each band. This is typically {0, 1, 2, …}.
The length of this array shall be equal to <a href="#getNumBands()"><code>get­Num­Bands()</code></a>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setVisibleBand(int)">
<h3>setVisibleBand</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setVisibleBand</span><wbr><span class="parameters">(int&nbsp;band)</span></div>
<div class="block">Specifies the band to use for defining pixel colors when the image is displayed on screen.
All other bands, if any, will exist in the raster but be ignored at display time.
The default value is 0, the first (and often only) band.
<div class="note"><b>Implementation note:</b>
an <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/IndexColorModel.html" title="class or interface in java.awt.image" class="external-link"><code>Index­Color­Model</code></a> will be used for displaying the image.</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>band</code> - the band to use for display purpose.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if the given band is not between 0 (inclusive)
and <a href="#getNumBands()"><code>get­Num­Bands()</code></a> (exclusive).</dd>
<dt>Since:</dt>
<dd>1.2</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setCategoryColors(java.util.function.Function)">
<h3>setCategoryColors</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setCategoryColors</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/function/Function.html" title="class or interface in java.util.function" class="external-link">Function</a>&lt;<a href="../Category.html" title="class in org.apache.sis.coverage">Category</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/Color.html" title="class or interface in java.awt" class="external-link">Color</a>[]&gt;&nbsp;colors)</span></div>
<div class="block">Specifies the colors to apply for each category in a sample dimension.
The given function can return <code>null</code>, which means transparent.
If this method is never invoked, then the default is a grayscale for
<a href="../Category.html#isQuantitative()">quantitative categories</a> and
transparent for qualitative categories (typically "no data" values).
<h4>Example</h4>
the following code specifies a color palette from blue to red with white in the middle.
This is useful for data with a clear 0 (white) in the middle of the range,
with a minimal value equals to the negative of the maximal value.
<blockquote><pre><b>setCategoryColors</b>((category) -&gt; category.<b>isQuantitative</b>() ? <font color="green">new</font> Color[] {
Color.BLUE, Color.CYAN, Color.WHITE, Color.YELLOW, Color.RED
} : <font color="green">null</font>);</pre></blockquote></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>colors</code> - the colors to use for each category. The <code>colors</code> argument cannot be null,
but <code>colors​.apply(Category)</code> can return null.</dd>
<dt>Since:</dt>
<dd>1.2</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createRaster()">
<h3>createRaster</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/Raster.html" title="class or interface in java.awt.image" class="external-link">Raster</a></span>&nbsp;<span class="element-name">createRaster</span>()</div>
<div class="block">Creates a raster with the data specified by the last call to a <code>set­Data(…)</code> method.
The raster upper-left corner is located at the position given by <a href="#getBounds()"><code>get­Bounds()</code></a>.
The returned raster is often an instance of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/WritableRaster.html" title="class or interface in java.awt.image" class="external-link"><code>Writable­Raster</code></a>, but read-only rasters are also allowed.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the raster, usually (but not necessarily) an instance of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/WritableRaster.html" title="class or interface in java.awt.image" class="external-link"><code>Writable­Raster</code></a>.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if no <code>set­Data(…)</code> method has been invoked before this method call.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/RasterFormatException.html" title="class or interface in java.awt.image" class="external-link">Raster­Format­Exception</a></code> - if a call to a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/Raster.html" title="class or interface in java.awt.image" class="external-link"><code>Raster</code></a> factory method failed.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if a property of the raster to construct exceeds the capacity of 32 bits integers.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createImage()">
<h3>createImage</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/RenderedImage.html" title="class or interface in java.awt.image" class="external-link">RenderedImage</a></span>&nbsp;<span class="element-name">createImage</span>()</div>
<div class="block">Creates an image with the data specified by the last call to a <code>set­Data(…)</code> method.
The image upper-left corner is located at the position given by <a href="#getBounds()"><code>get­Bounds()</code></a>.
The two-dimensional <a href="#getImageGeometry(int)">image geometry</a> is stored as
a property associated to the <a href="../../image/PlanarImage.html#GRID_GEOMETRY_KEY">"org.apache.sis.GridGeometry"</a> key.
<p>The default implementation returns an instance of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/WritableRenderedImage.html" title="class or interface in java.awt.image" class="external-link"><code>Writable­Rendered­Image</code></a>
if the <a href="#createRaster()"><code>create­Raster()</code></a> return value is an instance of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/WritableRaster.html" title="class or interface in java.awt.image" class="external-link"><code>Writable­Raster</code></a>, or a read-only
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/RenderedImage.html" title="class or interface in java.awt.image" class="external-link"><code>Rendered­Image</code></a> otherwise.</p></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the image.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if no <code>set­Data(…)</code> method has been invoked before this method call.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/RasterFormatException.html" title="class or interface in java.awt.image" class="external-link">Raster­Format­Exception</a></code> - if a call to a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/java/awt/image/Raster.html" title="class or interface in java.awt.image" class="external-link"><code>Raster</code></a> factory method failed.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if a property of the image to construct exceeds the capacity of 32 bits integers.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2010&#x2013;2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>