| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.4) on Fri Sep 20 12:10:30 CEST 2019 --> |
| <title>ImageRenderer (Apache SIS 1.0 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2019-09-20"> |
| <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="setData()"> |
| <meta name="keywords" content="setInterleavedPixelOffsets()"> |
| <meta name="keywords" content="raster()"> |
| <meta name="keywords" content="image()"> |
| <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="../../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="ImageRenderer (Apache SIS 1.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../../"; |
| var useModuleDirectories = false; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">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">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.sis.coverage.grid</a></div> |
| <h2 title="Class ImageRenderer" class="title">Class ImageRenderer</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>ImageRenderer</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <pre>public class <span class="typeNameLabel">ImageRenderer</span> |
| extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></pre> |
| <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>GridCoverage.render(GridExtent)</code></a>. |
| This builder does not copy any sample values. Instead, it wraps existing data arrays into |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/Raster.html?is-external=true" title="class or interface in java.awt.image" class="externalLink"><code>Raster</code></a> objects by computing required information such as |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/ComponentSampleModel.html?is-external=true#getPixelStride()" title="class or interface in java.awt.image" class="externalLink">pixel stride</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/ComponentSampleModel.html?is-external=true#getScanlineStride()" title="class or interface in java.awt.image" class="externalLink">scanline stride</a> and |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/ComponentSampleModel.html?is-external=true#getBandOffsets()" title="class or interface in java.awt.image" class="externalLink">band offsets</a>. |
| Different <code>setData(…)</code> methods are provided for allowing to specify the data arrays |
| from different objects such as Java2D <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true" title="class or interface in java.awt.image" class="externalLink"><code>DataBuffer</code></a> or NIO <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/Buffer.html?is-external=true" title="class or interface in java.nio" class="externalLink"><code>Buffer</code></a>. |
| |
| <p>All <code>setData(…)</code> methods assume that the first valid element in each array is the value |
| located at <code><a href="GridCoverage.html#getGridGeometry()">GridCoverage.getGridGeometry()</a>.<a href="GridGeometry.html#getExtent()">getExtent()</a>.<a href="GridExtent.html#getLow(int)">getLow()</a></code>. This <code>ImageRenderer</code> class |
| computes automatically the offsets from that position to the position of the first value included |
| in the <code>sliceExtent</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) { |
| <font color="green">try</font> { |
| ImageRenderer renderer = <font color="green">new</font> <b>ImageRenderer</b>(<font color="green">this</font>, sliceExtent); |
| renderer.<b>setData</b>(data); |
| <font color="green">return</font> renderer.<b>image</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">"Can not create an image."</font>, e); |
| } |
| } |
| }</pre></blockquote> |
| </div> |
| |
| <div class="section">Limitations</div> |
| Current implementation constructs only images made of a single tile. |
| Support for tiled images will be added in a future version.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="GridCoverage.html#render(org.apache.sis.coverage.grid.GridExtent)"><code>GridCoverage.render(GridExtent)</code></a></dd> |
| |
| <p><font size="-1">Defined in the <code>sis-feature</code> module</font></p> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.sis.coverage.grid.GridCoverage,org.apache.sis.coverage.grid.GridExtent)">ImageRenderer</a></span>​(<a href="GridCoverage.html" title="class in org.apache.sis.coverage.grid">GridCoverage</a> coverage, |
| <a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">GridExtent</a> sliceExtent)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a new image renderer for the given slice extent.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/awt/Rectangle.html?is-external=true" title="class or interface in java.awt" class="externalLink">Rectangle</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getBounds()">getBounds</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the location of the image upper-left corner together with the image size.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getNumBands()">getNumBands</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the number of bands that the image will have.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/RenderedImage.html?is-external=true" title="class or interface in java.awt.image" class="externalLink">RenderedImage</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#image()">image</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Creates an image with the data specified by the last call to a <code>setData(…)</code> method.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/WritableRaster.html?is-external=true" title="class or interface in java.awt.image" class="externalLink">WritableRaster</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#raster()">raster</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a raster with the data specified by the last call to a <code>setData(…)</code> method.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setData(int,java.nio.Buffer...)">setData</a></span>​(int dataType, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/Buffer.html?is-external=true" title="class or interface in java.nio" class="externalLink">Buffer</a>... data)</code></th> |
| <td class="colLast"> |
| <div class="block">Sets the data as NIO buffers.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setData(java.awt.image.DataBuffer)">setData</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true" title="class or interface in java.awt.image" class="externalLink">DataBuffer</a> data)</code></th> |
| <td class="colLast"> |
| <div class="block">Sets the data as a Java2D buffer.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setData(org.apache.sis.math.Vector...)">setData</a></span>​(<a href="../../math/Vector.html" title="class in org.apache.sis.math">Vector</a>... data)</code></th> |
| <td class="colLast"> |
| <div class="block">Sets the data as vectors.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setInterleavedPixelOffsets(int,int%5B%5D)">setInterleavedPixelOffsets</a></span>​(int pixelStride, |
| int[] bandOffsets)</code></th> |
| <td class="colLast"> |
| <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/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true" title="class or interface in java.awt.image" class="externalLink"><code>DataBuffer</code></a> bank.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>(org.apache.sis.coverage.grid.GridCoverage,org.apache.sis.coverage.grid.GridExtent)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>ImageRenderer</h4> |
| <pre>public ImageRenderer​(<a href="GridCoverage.html" title="class in org.apache.sis.coverage.grid">GridCoverage</a> coverage, |
| <a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">GridExtent</a> sliceExtent)</pre> |
| <div class="block">Creates a new image renderer for the given slice extent.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>coverage</code> - the grid coverage for which to build an image.</dd> |
| <dd><code>sliceExtent</code> - the grid geometry from which to create an image, or <code>null</code> for the <code>coverage</code> extent.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="../SubspaceNotSpecifiedException.html" title="class in org.apache.sis.coverage">SubspaceNotSpecifiedException</a></code> - if this method can not infer a two-dimensional slice from <code>sliceExtent</code>.</dd> |
| <dd><code><a href="DisjointExtentException.html" title="class in org.apache.sis.coverage.grid">DisjointExtentException</a></code> - if the given extent does not intersect this grid coverage.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ArithmeticException.html?is-external=true" title="class or interface in java.lang" class="externalLink">ArithmeticException</a></code> - if a stride calculation overflows the 32 bits integer capacity.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="getNumBands()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getNumBands</h4> |
| <pre class="methodSignature">public final int getNumBands()</pre> |
| <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> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the number of bands in the rendered image.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getBounds()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getBounds</h4> |
| <pre class="methodSignature">public final <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/Rectangle.html?is-external=true" title="class or interface in java.awt" class="externalLink">Rectangle</a> getBounds()</pre> |
| <div class="block">Returns the location of the image upper-left corner together with the image size.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the rendered image location and size (never null).</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setData(java.awt.image.DataBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setData</h4> |
| <pre class="methodSignature">public void setData​(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true" title="class or interface in java.awt.image" class="externalLink">DataBuffer</a> data)</pre> |
| <div class="block">Sets the data as a Java2D buffer. The <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true#getNumBanks()" title="class or interface in java.awt.image" class="externalLink">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/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true#getOffsets()" title="class or interface in java.awt.image" class="externalLink">bank offset</a> is the value |
| located at <code><a href="GridCoverage.html#getGridGeometry()">GridCoverage.getGridGeometry()</a>.<a href="GridGeometry.html#getExtent()">getExtent()</a>.<a href="GridExtent.html#getLow(int)">getLow()</a></code>, as specified in class javadoc.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>data</code> - the Java2D buffer containing data for all bands.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="../../util/NullArgumentException.html" title="class in org.apache.sis.util">NullArgumentException</a></code> - if <code>data</code> is null.</dd> |
| <dd><code><a href="../MismatchedCoverageRangeException.html" title="class in org.apache.sis.coverage">MismatchedCoverageRangeException</a></code> - if the given data buffer does not have the expected amount of banks.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setData(int,java.nio.Buffer...)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setData</h4> |
| <pre class="methodSignature">public void setData​(int dataType, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/Buffer.html?is-external=true" title="class or interface in java.nio" class="externalLink">Buffer</a>... data)</pre> |
| <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/javase/8/docs/api/java/nio/Buffer.html?is-external=true#array()" title="class or interface in java.nio" class="externalLink">backed by arrays</a> of the type specified by |
| the <code>dataType</code> argument and have the same amount of <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/Buffer.html?is-external=true#remaining()" title="class or interface in java.nio" class="externalLink">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/javase/8/docs/api/java/nio/Buffer.html?is-external=true#position()" title="class or interface in java.nio" class="externalLink">buffer position</a> and ends at that position + <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/Buffer.html?is-external=true#remaining()" title="class or interface in java.nio" class="externalLink">remaining</a>. |
| |
| <p>The data type must be specified in order to distinguish between the signed and unsigned types. |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true#TYPE_BYTE" title="class or interface in java.awt.image" class="externalLink"><code>DataBuffer.TYPE_BYTE</code></a> and <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true#TYPE_USHORT" title="class or interface in java.awt.image" class="externalLink"><code>DataBuffer.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>setData(DataBuffer)</code></a>, |
| which can be overridden by subclasses if desired.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>dataType</code> - type of data as one of <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true#TYPE_BYTE" title="class or interface in java.awt.image" class="externalLink"><code>DataBuffer.TYPE_BYTE</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true#TYPE_SHORT" title="class or interface in java.awt.image" class="externalLink"><code>TYPE_SHORT</code></a> |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true#TYPE_USHORT" title="class or interface in java.awt.image" class="externalLink"><code>TYPE_USHORT</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true#TYPE_INT" title="class or interface in java.awt.image" class="externalLink"><code>TYPE_INT</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true#TYPE_FLOAT" title="class or interface in java.awt.image" class="externalLink"><code>TYPE_FLOAT</code></a> or <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true#TYPE_DOUBLE" title="class or interface in java.awt.image" class="externalLink"><code>TYPE_DOUBLE</code></a> constants.</dd> |
| <dd><code>data</code> - the buffers wrapping arrays of primitive type.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="../../util/NullArgumentException.html" title="class in org.apache.sis.util">NullArgumentException</a></code> - if <code>data</code> is null or one of <code>data</code> element is null.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if <code>dataType</code> is not a supported value.</dd> |
| <dd><code><a href="../MismatchedCoverageRangeException.html" title="class in org.apache.sis.coverage">MismatchedCoverageRangeException</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/javase/8/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang" class="externalLink">UnsupportedOperationException</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/javase/8/docs/api/java/lang/ArrayStoreException.html?is-external=true" title="class or interface in java.lang" class="externalLink">ArrayStoreException</a></code> - if a buffer type is incompatible with <code>dataType</code>.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/RasterFormatException.html?is-external=true" title="class or interface in java.awt.image" class="externalLink">RasterFormatException</a></code> - if buffers do not have the same amount of remaining values.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ArithmeticException.html?is-external=true" title="class or interface in java.lang" class="externalLink">ArithmeticException</a></code> - if a buffer position overflows the 32 bits integer capacity.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setData(org.apache.sis.math.Vector...)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setData</h4> |
| <pre class="methodSignature">public void setData​(<a href="../../math/Vector.html" title="class in org.apache.sis.math">Vector</a>... data)</pre> |
| <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(int,java.nio.Buffer...)"><code>setData(int, Buffer...)</code></a>, |
| which can be overridden by subclasses if desired.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>data</code> - the vectors wrapping arrays of primitive type.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="../../util/NullArgumentException.html" title="class in org.apache.sis.util">NullArgumentException</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">MismatchedCoverageRangeException</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/javase/8/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang" class="externalLink">UnsupportedOperationException</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/javase/8/docs/api/java/awt/image/RasterFormatException.html?is-external=true" title="class or interface in java.awt.image" class="externalLink">RasterFormatException</a></code> - if vectors do not have the same size.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ArithmeticException.html?is-external=true" title="class or interface in java.lang" class="externalLink">ArithmeticException</a></code> - if a buffer position overflows the 32 bits integer capacity.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setInterleavedPixelOffsets(int,int[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setInterleavedPixelOffsets</h4> |
| <pre class="methodSignature">public void setInterleavedPixelOffsets​(int pixelStride, |
| int[] bandOffsets)</pre> |
| <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/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true" title="class or interface in java.awt.image" class="externalLink"><code>DataBuffer</code></a> bank. |
| This method should be invoked when the data given to <code>setData(…)</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/javase/8/docs/api/java/nio/Buffer.html?is-external=true" title="class or interface in java.nio" class="externalLink"><code>Buffer</code></a> or |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/DataBuffer.html?is-external=true" title="class or interface in java.awt.image" class="externalLink"><code>DataBuffer</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> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>pixelStride</code> - the number of data elements between each pixel in the data vector or buffer.</dd> |
| <dd><code>bandOffsets</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>getNumBands()</code></a>.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="raster()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>raster</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/WritableRaster.html?is-external=true" title="class or interface in java.awt.image" class="externalLink">WritableRaster</a> raster()</pre> |
| <div class="block">Creates a raster with the data specified by the last call to a <code>setData(…)</code> method. |
| The raster upper-left corner is located at the position given by <a href="#getBounds()"><code>getBounds()</code></a>.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the raster.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalStateException</a></code> - if no <code>setData(…)</code> method has been invoked before this method call.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/RasterFormatException.html?is-external=true" title="class or interface in java.awt.image" class="externalLink">RasterFormatException</a></code> - if a call to a <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/WritableRaster.html?is-external=true" title="class or interface in java.awt.image" class="externalLink"><code>WritableRaster</code></a> factory method failed.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ArithmeticException.html?is-external=true" title="class or interface in java.lang" class="externalLink">ArithmeticException</a></code> - if a property of the raster to construct exceeds the capacity of 32 bits integers.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="image()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>image</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/RenderedImage.html?is-external=true" title="class or interface in java.awt.image" class="externalLink">RenderedImage</a> image()</pre> |
| <div class="block">Creates an image with the data specified by the last call to a <code>setData(…)</code> method. |
| The image upper-left corner is located at the position given by <a href="#getBounds()"><code>getBounds()</code></a>.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the image.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalStateException</a></code> - if no <code>setData(…)</code> method has been invoked before this method call.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/RasterFormatException.html?is-external=true" title="class or interface in java.awt.image" class="externalLink">RasterFormatException</a></code> - if a call to a <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/image/WritableRaster.html?is-external=true" title="class or interface in java.awt.image" class="externalLink"><code>WritableRaster</code></a> factory method failed.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ArithmeticException.html?is-external=true" title="class or interface in java.lang" class="externalLink">ArithmeticException</a></code> - if a property of the image to construct exceeds the capacity of 32 bits integers.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">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">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2010–2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |