<!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_77) on Fri Apr 22 13:46:54 UTC 2016 --> <title>PixelFormat (JavaFX 8)</title> <meta name="date" content="2016-04-22"> <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="PixelFormat (JavaFX 8)"; } } catch(err) { } //--> var methods = {"i0":9,"i1":9,"i2":6,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":10,"i9":6,"i10":6}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete 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/PixelFormat.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/ImageView.html" title="class in javafx.scene.image"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javafx/scene/image/PixelFormat.Type.html" title="enum in javafx.scene.image"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/image/PixelFormat.html" target="_top">Frames</a></li> <li><a href="PixelFormat.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><a href="#nested.class.summary">Nested</a> | </li> <li>Field | </li> <li>Constr | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="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="Class PixelFormat" class="title">Class PixelFormat<T extends <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/Buffer.html?is-external=true" title="class or interface in java.nio">Buffer</a>></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">java.lang.Object</a></li> <li> <ul class="inheritance"> <li>javafx.scene.image.PixelFormat<T></li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Direct Known Subclasses:</dt> <dd><a href="../../../javafx/scene/image/WritablePixelFormat.html" title="class in javafx.scene.image">WritablePixelFormat</a></dd> </dl> <hr> <br> <pre>public abstract class <span class="typeNameLabel">PixelFormat<T extends <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/Buffer.html?is-external=true" title="class or interface in java.nio">Buffer</a>></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">Object</a></pre> <div class="block">A <code>PixelFormat</code> object defines the layout of data for a pixel of a given format.</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"> <!-- ======== NESTED CLASS SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="nested.class.summary"> <!-- --> </a> <h3>Nested Class Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static class </code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelFormat.Type.html" title="enum in javafx.scene.image">PixelFormat.Type</a></span></code> <div class="block">An enum describing the in-array storage format of a single pixel managed by a <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image"><code>PixelFormat</code></a>.</div> </td> </tr> </table> </li> </ul> <!-- ========== 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="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></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><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="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>static <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelFormat.html#createByteIndexedInstance-int:A-">createByteIndexedInstance</a></span>(int[] colors)</code> <div class="block">Creates a <code>PixelFormat</code> instance describing a pixel layout with the pixels stored as single bytes representing an index into the specified lookup table of <b>non-premultiplied</b> color values in the <a href="../../../javafx/scene/image/PixelFormat.Type.html#INT_ARGB"><code>INT_ARGB</code></a> format.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>static <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelFormat.html#createByteIndexedPremultipliedInstance-int:A-">createByteIndexedPremultipliedInstance</a></span>(int[] colors)</code> <div class="block">Creates a <code>PixelFormat</code> instance describing a pixel layout with the pixels stored as single bytes representing an index into the specified lookup table of <b>premultiplied</b> color values in the <a href="../../../javafx/scene/image/PixelFormat.Type.html#INT_ARGB_PRE"><code>INT_ARGB_PRE</code></a> format.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>abstract int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelFormat.html#getArgb-T-int-int-int-">getArgb</a></span>(<a href="../../../javafx/scene/image/PixelFormat.html" title="type parameter in PixelFormat">T</a> buf, int x, int y, int scanlineStride)</code> <div class="block">Reads pixel data from the buffer at the specified coordinates and converts it to a 32-bit integer representation of the color in the <a href="../../../javafx/scene/image/PixelFormat.Type.html#INT_ARGB"><code>INT_ARGB</code></a> format.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>static <a href="../../../javafx/scene/image/WritablePixelFormat.html" title="class in javafx.scene.image">WritablePixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelFormat.html#getByteBgraInstance--">getByteBgraInstance</a></span>()</code> <div class="block">Returns a <code>WritablePixelFormat</code> instance describing a pixel layout with the pixels stored in adjacent bytes with the <b>non-premultiplied</b> components stored in order of increasing index: blue, green, red, alpha.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>static <a href="../../../javafx/scene/image/WritablePixelFormat.html" title="class in javafx.scene.image">WritablePixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelFormat.html#getByteBgraPreInstance--">getByteBgraPreInstance</a></span>()</code> <div class="block">Returns a <code>WritablePixelFormat</code> instance describing a pixel layout with the pixels stored in adjacent bytes with the <b>premultiplied</b> components stored in order of increasing index: blue, green, red, alpha.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>static <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelFormat.html#getByteRgbInstance--">getByteRgbInstance</a></span>()</code> <div class="block">Returns a <code>PixelFormat</code> instance describing a pixel layout with the pixels stored in adjacent bytes with the color components stored in order of increasing index: red, green, blue.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>static <a href="../../../javafx/scene/image/WritablePixelFormat.html" title="class in javafx.scene.image">WritablePixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/IntBuffer.html?is-external=true" title="class or interface in java.nio">IntBuffer</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelFormat.html#getIntArgbInstance--">getIntArgbInstance</a></span>()</code> <div class="block">Returns a <code>WritablePixelFormat</code> instance describing a pixel layout with the pixels stored in 32-bit integers with the <b>non-premultiplied</b> components stored in order, from MSb to LSb: alpha, red, green, blue.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>static <a href="../../../javafx/scene/image/WritablePixelFormat.html" title="class in javafx.scene.image">WritablePixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/IntBuffer.html?is-external=true" title="class or interface in java.nio">IntBuffer</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelFormat.html#getIntArgbPreInstance--">getIntArgbPreInstance</a></span>()</code> <div class="block">Returns a <code>WritablePixelFormat</code> instance describing a pixel layout with the pixels stored in 32-bit integers with the <b>premultiplied</b> components stored in order, from MSb to LSb: alpha, red, green, blue.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/scene/image/PixelFormat.Type.html" title="enum in javafx.scene.image">PixelFormat.Type</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelFormat.html#getType--">getType</a></span>()</code> <div class="block">Returns the enum representing the storage format of the pixels managed by this <code>PixelFormat</code> object.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code>abstract boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelFormat.html#isPremultiplied--">isPremultiplied</a></span>()</code> <div class="block">Returns true iff the color components decoded (or encoded) by this format are pre-multiplied by the alpha component for more efficient blending calculations.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>abstract boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/image/PixelFormat.html#isWritable--">isWritable</a></span>()</code> <div class="block">Returns true iff this <code>PixelFormat</code> object can convert color information into a pixel representation.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">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">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">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">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">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">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">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">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">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">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">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">wait</a></code></li> </ul> </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="getIntArgbInstance--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getIntArgbInstance</h4> <pre>public static <a href="../../../javafx/scene/image/WritablePixelFormat.html" title="class in javafx.scene.image">WritablePixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/IntBuffer.html?is-external=true" title="class or interface in java.nio">IntBuffer</a>> getIntArgbInstance()</pre> <div class="block">Returns a <code>WritablePixelFormat</code> instance describing a pixel layout with the pixels stored in 32-bit integers with the <b>non-premultiplied</b> components stored in order, from MSb to LSb: alpha, red, green, blue. <p> Pixels in this format can be decoded using the following sample code: <pre> int pixel = array[rowstart + x]; int alpha = ((pixel >> 24) & 0xff); int red = ((pixel >> 16) & 0xff); int green = ((pixel >> 8) & 0xff); int blue = ((pixel ) & 0xff); </pre></div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>a <code>WritabelPixelFormat<IntBuffer></code> describing the indicated pixel format</dd> </dl> </li> </ul> <a name="getIntArgbPreInstance--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getIntArgbPreInstance</h4> <pre>public static <a href="../../../javafx/scene/image/WritablePixelFormat.html" title="class in javafx.scene.image">WritablePixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/IntBuffer.html?is-external=true" title="class or interface in java.nio">IntBuffer</a>> getIntArgbPreInstance()</pre> <div class="block">Returns a <code>WritablePixelFormat</code> instance describing a pixel layout with the pixels stored in 32-bit integers with the <b>premultiplied</b> components stored in order, from MSb to LSb: alpha, red, green, blue. <p> Pixels in this format can be decoded using the following sample code: <pre> int pixel = array[rowstart + x]; int alpha = ((pixel >> 24) & 0xff); int red = ((pixel >> 16) & 0xff); int green = ((pixel >> 8) & 0xff); int blue = ((pixel ) & 0xff); </pre></div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>a <code>WritabelPixelFormat<IntBuffer></code> describing the indicated pixel format</dd> </dl> </li> </ul> <a name="getByteBgraInstance--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getByteBgraInstance</h4> <pre>public static <a href="../../../javafx/scene/image/WritablePixelFormat.html" title="class in javafx.scene.image">WritablePixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>> getByteBgraInstance()</pre> <div class="block">Returns a <code>WritablePixelFormat</code> instance describing a pixel layout with the pixels stored in adjacent bytes with the <b>non-premultiplied</b> components stored in order of increasing index: blue, green, red, alpha. <p> Pixels in this format can be decoded using the following sample code: <pre> int i = rowstart + x * 4; int blue = (array[i+0] & 0xff); int green = (array[i+1] & 0xff); int red = (array[i+2] & 0xff); int alpha = (array[i+3] & 0xff); </pre></div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>a <code>WritablePixelFormat<ByteBuffer></code> describing the indicated pixel format</dd> </dl> </li> </ul> <a name="getByteBgraPreInstance--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getByteBgraPreInstance</h4> <pre>public static <a href="../../../javafx/scene/image/WritablePixelFormat.html" title="class in javafx.scene.image">WritablePixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>> getByteBgraPreInstance()</pre> <div class="block">Returns a <code>WritablePixelFormat</code> instance describing a pixel layout with the pixels stored in adjacent bytes with the <b>premultiplied</b> components stored in order of increasing index: blue, green, red, alpha. <p> Pixels in this format can be decoded using the following sample code: <pre> int i = rowstart + x * 4; int blue = (array[i+0] & 0xff); int green = (array[i+1] & 0xff); int red = (array[i+2] & 0xff); int alpha = (array[i+3] & 0xff); </pre></div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>a <code>WritablePixelFormat<ByteBuffer></code> describing the indicated pixel format</dd> </dl> </li> </ul> <a name="getByteRgbInstance--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getByteRgbInstance</h4> <pre>public static <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>> getByteRgbInstance()</pre> <div class="block">Returns a <code>PixelFormat</code> instance describing a pixel layout with the pixels stored in adjacent bytes with the color components stored in order of increasing index: red, green, blue. <p> Pixels in this format can be decoded using the following sample code: <pre> int i = rowstart + x * 3; int red = (array[i+0] & 0xff); int green = (array[i+1] & 0xff); int blue = (array[i+2] & 0xff); </pre></div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>a <code>PixelFormat<ByteBuffer></code> describing the indicated pixel format</dd> </dl> </li> </ul> <a name="createByteIndexedPremultipliedInstance-int:A-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createByteIndexedPremultipliedInstance</h4> <pre>public static <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>> createByteIndexedPremultipliedInstance(int[] colors)</pre> <div class="block">Creates a <code>PixelFormat</code> instance describing a pixel layout with the pixels stored as single bytes representing an index into the specified lookup table of <b>premultiplied</b> color values in the <a href="../../../javafx/scene/image/PixelFormat.Type.html#INT_ARGB_PRE"><code>INT_ARGB_PRE</code></a> format. <p> Pixels in this format can be decoded using the following sample code: <pre> int pixel = array[rowstart + x] & 0xff; int argb = colors[pixel]; int alpha = ((argb >> 24) & 0xff); int red = ((argb >> 16) & 0xff); int green = ((argb >> 8) & 0xff); int blue = ((argb ) & 0xff); </pre></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>colors</code> - an <code>int[]</code> array of 32-bit color values in the <a href="../../../javafx/scene/image/PixelFormat.Type.html#INT_ARGB_PRE"><code>INT_ARGB_PRE</code></a> format</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a <code>PixelFormat<ByteBuffer></code> describing the indicated pixel format with the specified list of premultiplied colors</dd> </dl> </li> </ul> <a name="createByteIndexedInstance-int:A-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createByteIndexedInstance</h4> <pre>public static <a href="../../../javafx/scene/image/PixelFormat.html" title="class in javafx.scene.image">PixelFormat</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>> createByteIndexedInstance(int[] colors)</pre> <div class="block">Creates a <code>PixelFormat</code> instance describing a pixel layout with the pixels stored as single bytes representing an index into the specified lookup table of <b>non-premultiplied</b> color values in the <a href="../../../javafx/scene/image/PixelFormat.Type.html#INT_ARGB"><code>INT_ARGB</code></a> format. <p> Pixels in this format can be decoded using the following sample code: <pre> int pixel = array[rowstart + x] & 0xff; int argb = colors[pixel]; int alpha = ((argb >> 24) & 0xff); int red = ((argb >> 16) & 0xff); int green = ((argb >> 8) & 0xff); int blue = ((argb ) & 0xff); </pre></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>colors</code> - an <code>int[]</code> array of 32-bit color values in the <a href="../../../javafx/scene/image/PixelFormat.Type.html#INT_ARGB"><code>INT_ARGB</code></a> format</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a <code>PixelFormat<ByteBuffer></code> describing the indicated pixel format with the specified list of non-premultiplied colors</dd> </dl> </li> </ul> <a name="getType--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getType</h4> <pre>public <a href="../../../javafx/scene/image/PixelFormat.Type.html" title="enum in javafx.scene.image">PixelFormat.Type</a> getType()</pre> <div class="block">Returns the enum representing the storage format of the pixels managed by this <code>PixelFormat</code> object.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the <code>Type</code> enum of the pixels</dd> </dl> </li> </ul> <a name="isWritable--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isWritable</h4> <pre>public abstract boolean isWritable()</pre> <div class="block">Returns true iff this <code>PixelFormat</code> object can convert color information into a pixel representation.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true iff this <code>PixelFormat</code> can convert colors to pixel data</dd> </dl> </li> </ul> <a name="isPremultiplied--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isPremultiplied</h4> <pre>public abstract boolean isPremultiplied()</pre> <div class="block">Returns true iff the color components decoded (or encoded) by this format are pre-multiplied by the alpha component for more efficient blending calculations.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true iff the managed color components are premultiplied by alpha</dd> </dl> </li> </ul> <a name="getArgb-java.nio.Buffer-int-int-int-"> <!-- --> </a><a name="getArgb-T-int-int-int-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getArgb</h4> <pre>public abstract int getArgb(<a href="../../../javafx/scene/image/PixelFormat.html" title="type parameter in PixelFormat">T</a> buf, int x, int y, int scanlineStride)</pre> <div class="block">Reads pixel data from the buffer at the specified coordinates and converts it to a 32-bit integer representation of the color in the <a href="../../../javafx/scene/image/PixelFormat.Type.html#INT_ARGB"><code>INT_ARGB</code></a> format. The 32-bit integer will contain the 4 color components in separate 8-bit fields in ARGB order from the most significant byte to the least significant byte. The buffer should be positioned to the start of the pixel data such that <code>buf.get(0)</code> would return the pixel information for the pixel at coordinates <code>(0, 0)</code>. The <code>scanlineStride</code> parameter defines the distance from the pixel data at the start of one row to the pixel data at the start of the immediately following row at the next higher Y coordinate. Usually, <code>scanlineStride</code> is the same as the width of the image multiplied by the number of data elements per pixel (1 for the case of the integer and indexed formats, or 3 or 4 in the case of the byte formats), but some images may have further padding between rows for alignment or other purposes. <p> The color components can be extracted from the returned integer using the following sample code: <pre> int alpha = ((retval >> 24) & 0xff); int red = ((retval >> 16) & 0xff); int green = ((retval >> 8) & 0xff); int blue = ((retval ) & 0xff); </pre></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>buf</code> - the buffer of pixel data</dd> <dd><code>x</code> - the X coordinate of the pixel to be read</dd> <dd><code>y</code> - the Y coordinate of the pixel to be read</dd> <dd><code>scanlineStride</code> - the number of buffer elements between the start of adjacent pixel rows in the buffer</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a 32-bit value with the color of the pixel in a format similar to the <a href="../../../javafx/scene/image/PixelFormat.Type.html#INT_ARGB"><code>INT_ARGB</code></a> pixel format</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/PixelFormat.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/ImageView.html" title="class in javafx.scene.image"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javafx/scene/image/PixelFormat.Type.html" title="enum in javafx.scene.image"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/image/PixelFormat.html" target="_top">Frames</a></li> <li><a href="PixelFormat.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><a href="#nested.class.summary">Nested</a> | </li> <li>Field | </li> <li>Constr | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="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><small><a href="https://docs.oracle.com/javase/8/docs/legal/cpyr.html">Copyright</a> (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.</small></small></p> </body> </html>