<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_141) on Mon Oct 30 09:22:31 GMT 2017 --> <title>PixelWriter (JavaFX 8)</title> <meta name="date" content="2017-10-30"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="PixelWriter (JavaFX 8)"; } } catch(err) { } //--> var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/PixelWriter.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 class="aboutLanguage">JavaFX 8</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../javafx/scene/image/PixelReader.html" title="interface in javafx.scene.image"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javafx/scene/image/WritableImage.html" title="class in javafx.scene.image"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/image/PixelWriter.html" target="_top">Frames</a></li> <li><a href="PixelWriter.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All Classes</a></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> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li>Field | </li> <li>Constr | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li>Constr | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">javafx.scene.image</div> <h2 title="Interface PixelWriter" class="title">Interface PixelWriter</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public interface <span class="typeNameLabel">PixelWriter</span></pre> <div class="block">This interface defines methods for writing the pixel data of a <a href="../../../javafx/scene/image/WritableImage.html" title="class in javafx.scene.image"><code>WritableImage</code></a> or other surface containing writable pixels.</div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 2.2</dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelWriter.html#getPixelFormat--">getPixelFormat</a></span>()</code> <div class="block">This method returns the <code>PixelFormat</code> in which the surface stores its pixels, or a roughly equivalent pixel format from which it can easily convert pixels for purposes of writing them.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelWriter.html#setArgb-int-int-int-">setArgb</a></span>(int x, int y, int argb)</code> <div class="block">Stores pixel data for a color into the specified coordinates of the surface.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelWriter.html#setColor-int-int-javafx.scene.paint.Color-">setColor</a></span>(int x, int y, <a href="../../../javafx/scene/paint/Color.html" title="class in javafx.scene.paint">Color</a> c)</code> <div class="block">Stores pixel data for a <a href="../../../javafx/scene/paint/Color.html" title="class in javafx.scene.paint"><code>Color</code></a> into the specified coordinates of the surface.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelWriter.html#setPixels-int-int-int-int-javafx.scene.image.PixelFormat-byte:A-int-int-">setPixels</a></span>(int x, int y, int w, int h, <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a><java.nio.ByteBuffer> pixelformat, byte[] buffer, int offset, int scanlineStride)</code> <div class="block">Stores pixel data from a byte array into a rectangular region of the surface.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelWriter.html#setPixels-int-int-int-int-javafx.scene.image.PixelFormat-int:A-int-int-">setPixels</a></span>(int x, int y, int w, int h, <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a><java.nio.IntBuffer> pixelformat, int[] buffer, int offset, int scanlineStride)</code> <div class="block">Stores pixel data from an int array into a rectangular region of the surface.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code><T extends java.nio.Buffer><br>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelWriter.html#setPixels-int-int-int-int-javafx.scene.image.PixelFormat-T-int-">setPixels</a></span>(int x, int y, int w, int h, <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a><T> pixelformat, T buffer, int scanlineStride)</code> <div class="block">Stores pixel data from a buffer into a rectangular region of the surface.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelWriter.html#setPixels-int-int-int-int-javafx.scene.image.PixelReader-int-int-">setPixels</a></span>(int dstx, int dsty, int w, int h, <a href="../../../javafx/scene/image/PixelReader.html" title="interface in javafx.scene.image">PixelReader</a> reader, int srcx, int srcy)</code> <div class="block">Stores pixel data retrieved from a <code>PixelReader</code> instance into a rectangular region of the surface.</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getPixelFormat--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getPixelFormat</h4> <pre><a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a> getPixelFormat()</pre> <div class="block">This method returns the <code>PixelFormat</code> in which the surface stores its pixels, or a roughly equivalent pixel format from which it can easily convert pixels for purposes of writing them.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the <code>PixelFormat</code> that best describes the underlying pixels</dd> </dl> </li> </ul> <a name="setArgb-int-int-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setArgb</h4> <pre>void setArgb(int x, int y, int argb)</pre> <div class="block">Stores pixel data for a color into the specified coordinates of the surface. The 32-bit integer <code>argb</code> parameter should contain the 4 color components in separate 8-bit fields in ARGB order from the most significant byte to the least significant byte.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>x</code> - the X coordinate of the pixel color to write</dd> <dd><code>y</code> - the Y coordinate of the pixel color to write</dd> <dd><code>argb</code> - the color information to write, specified in the format described by the <a href="../../../javafx/scene/image/PixelFormat.Type.html#INT_ARGB"><code>INT_ARGB</code></a> PixelFormat type.</dd> </dl> </li> </ul> <a name="setColor-int-int-javafx.scene.paint.Color-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setColor</h4> <pre>void setColor(int x, int y, <a href="../../../javafx/scene/paint/Color.html" title="class in javafx.scene.paint">Color</a> c)</pre> <div class="block">Stores pixel data for a <a href="../../../javafx/scene/paint/Color.html" title="class in javafx.scene.paint"><code>Color</code></a> into the specified coordinates of the surface.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>x</code> - the X coordinate of the pixel color to write</dd> <dd><code>y</code> - the Y coordinate of the pixel color to write</dd> <dd><code>c</code> - the Color to write or null</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.NullPointerException</code> - if <code>color</code> is <code>null</code></dd> </dl> </li> </ul> <a name="setPixels-int-int-int-int-javafx.scene.image.PixelFormat-java.nio.Buffer-int-"> <!-- --> </a><a name="setPixels-int-int-int-int-javafx.scene.image.PixelFormat-T-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setPixels</h4> <pre><T extends java.nio.Buffer> void setPixels(int x, int y, int w, int h, <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a><T> pixelformat, T buffer, int scanlineStride)</pre> <div class="block">Stores pixel data from a buffer into a rectangular region of the surface. The format of the pixels in the buffer is defined by the <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image"><code>PixelFormat</code></a> object and pixel format conversions will be performed as needed to store the data into the surface. The buffer is assumed to be positioned to the location where the first pixel data to be stored in the surface pixel at location <code>(x, y)</code> is located. Pixel data for a row will be read from adjacent locations within the buffer packed as tightly as possible for increasing X coordinates. Pixel data for adjacent rows will be read offset from each other by the number of buffer data elements defined by <code>scanlineStride</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>x</code> - the X coordinate of the rectangular region to write</dd> <dd><code>y</code> - the Y coordinate of the rectangular region to write</dd> <dd><code>w</code> - the width of the rectangular region to write</dd> <dd><code>h</code> - the height of the rectangular region to write</dd> <dd><code>pixelformat</code> - the <code>PixelFormat</code> object defining the format to read the pixels from the buffer</dd> <dd><code>buffer</code> - a buffer of a type appropriate for the indicated <code>PixelFormat</code> object</dd> <dd><code>scanlineStride</code> - the distance between the pixel data for the start of one row of data in the buffer to the start of the next row of data.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.NullPointerException</code> - if @{code pixelformat} or <code>buffer</code> is <code>null</code></dd> </dl> </li> </ul> <a name="setPixels-int-int-int-int-javafx.scene.image.PixelFormat-byte:A-int-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setPixels</h4> <pre>void setPixels(int x, int y, int w, int h, <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a><java.nio.ByteBuffer> pixelformat, byte[] buffer, int offset, int scanlineStride)</pre> <div class="block">Stores pixel data from a byte array into a rectangular region of the surface. The format of the pixels in the buffer is defined by the <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image"><code>PixelFormat</code></a> object and pixel format conversions will be performed as needed to store the data into the surface. The <code>pixelformat</code> must be a compatible <code>PixelFormat<ByteBuffer></code> type. The data for the first pixel at location <code>(x, y)</code> will be read from the array index specified by the <code>offset</code> parameter. Pixel data for a row will be read from adjacent locations within the array packed as tightly as possible for increasing X coordinates. Pixel data for adjacent rows will be read offset from each other by the number of byte array elements defined by <code>scanlineStride</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>x</code> - the X coordinate of the rectangular region to write</dd> <dd><code>y</code> - the Y coordinate of the rectangular region to write</dd> <dd><code>w</code> - the width of the rectangular region to write</dd> <dd><code>h</code> - the height of the rectangular region to write</dd> <dd><code>pixelformat</code> - the <code>PixelFormat<ByteBuffer></code> object defining the byte format to read the pixels from buffer</dd> <dd><code>buffer</code> - a byte array containing the pixel data to store</dd> <dd><code>offset</code> - the offset into <code>buffer</code> to read the first pixel data</dd> <dd><code>scanlineStride</code> - the distance between the pixel data for the start of one row of data in the buffer to the start of the next row of data</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.NullPointerException</code> - if @{code pixelformat} or <code>buffer</code> is <code>null</code></dd> </dl> </li> </ul> <a name="setPixels-int-int-int-int-javafx.scene.image.PixelFormat-int:A-int-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setPixels</h4> <pre>void setPixels(int x, int y, int w, int h, <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a><java.nio.IntBuffer> pixelformat, int[] buffer, int offset, int scanlineStride)</pre> <div class="block">Stores pixel data from an int array into a rectangular region of the surface. The format of the pixels in the buffer is defined by the <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image"><code>PixelFormat</code></a> object and pixel format conversions will be performed as needed to store the data into the surface. The <code>pixelformat</code> must be a compatible <code>PixelFormat<IntBuffer></code> type. The data for the first pixel at location <code>(x, y)</code> will be read from the array index specified by the <code>offset</code> parameter. Pixel data for a row will be read from adjacent locations within the array packed as tightly as possible for increasing X coordinates. Pixel data for adjacent rows will be read offset from each other by the number of int array elements defined by <code>scanlineStride</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>x</code> - the X coordinate of the rectangular region to write</dd> <dd><code>y</code> - the Y coordinate of the rectangular region to write</dd> <dd><code>w</code> - the width of the rectangular region to write</dd> <dd><code>h</code> - the height of the rectangular region to write</dd> <dd><code>pixelformat</code> - the <code>PixelFormat<IntBuffer></code> object defining the int format to read the pixels from buffer</dd> <dd><code>buffer</code> - an int array to containing the pixel data to store</dd> <dd><code>offset</code> - the offset into <code>buffer</code> to read the first pixel data</dd> <dd><code>scanlineStride</code> - the distance between the pixel data for the start of one row of data in the buffer to the start of the next row of data</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.NullPointerException</code> - if @{code pixelformat} or <code>buffer</code> is <code>null</code></dd> </dl> </li> </ul> <a name="setPixels-int-int-int-int-javafx.scene.image.PixelReader-int-int-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>setPixels</h4> <pre>void setPixels(int dstx, int dsty, int w, int h, <a href="../../../javafx/scene/image/PixelReader.html" title="interface in javafx.scene.image">PixelReader</a> reader, int srcx, int srcy)</pre> <div class="block">Stores pixel data retrieved from a <code>PixelReader</code> instance into a rectangular region of the surface. The data for the pixel on the surface at <code>(dstx, dsty)</code> will be retrieved from the <code>reader</code> from its location <code>(srcx, srcy)</code>. This method performs an operation which is semantically equivalent to (though likely much faster than) this pseudo-code: <pre> for (int y = 0; y < h, y++) { for (int x = 0; x < w; x++) { setArgb(dstx + x, dsty + y, reader.getArgb(srcx + x, srcy + y)); } } </pre></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>dstx</code> - the X coordinate of the rectangular region to write</dd> <dd><code>dsty</code> - the Y coordinate of the rectangular region to write</dd> <dd><code>w</code> - the width of the rectangular region to write</dd> <dd><code>h</code> - the height of the rectangular region to write</dd> <dd><code>reader</code> - the <a href="../../../javafx/scene/image/PixelReader.html" title="interface in javafx.scene.image"><code>PixelReader</code></a> used to get the pixel data to write</dd> <dd><code>srcx</code> - the X coordinate of the data to read from <code>reader</code></dd> <dd><code>srcy</code> - the Y coordinate of the data to read from <code>reader</code></dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.NullPointerException</code> - if @{code reader} is <code>null</code></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/PixelWriter.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 class="aboutLanguage">JavaFX 8</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../javafx/scene/image/PixelReader.html" title="interface in javafx.scene.image"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javafx/scene/image/WritableImage.html" title="class in javafx.scene.image"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/image/PixelWriter.html" target="_top">Frames</a></li> <li><a href="PixelWriter.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.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> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li>Field | </li> <li>Constr | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li>Constr | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><font size="-1"><a href="http://bugreport.java.com/bugreport/" target="_blank">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="https://docs.oracle.com/javase/8/docs/index.html" target="_blank">Java SE Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> <a href="https://docs.oracle.com/javase/8/docs/legal/cpyr.html" target="_blank">Copyright</a> © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to <a href="http://download.oracle.com/otndocs/jcp/java_se-8-mrel-spec/license.html" target="_blank">license terms</a>. Also see the <a target="_blank" href="http://www.oracle.com/technetwork/java/redist-137594.html" target="_blank">documentation redistribution policy</a>.</font></small></p> </body> </html>