< prev index next >

modules/graphics/src/main/java/javafx/scene/image/PixelFormat.java

Print this page

        

*** 95,108 **** * <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> * * @return a {@code WritabelPixelFormat<IntBuffer>} describing the * indicated pixel format */ --- 95,108 ---- * <p> * Pixels in this format can be decoded using the following sample code: * <pre> * int pixel = array[rowstart + x]; * ! * int alpha = ((pixel &gt;&gt; 24) &amp; 0xff); ! * int red = ((pixel &gt;&gt; 16) &amp; 0xff); ! * int green = ((pixel &gt;&gt; 8) &amp; 0xff); ! * int blue = ((pixel &gt;&gt; ) &amp; 0xff); * </pre> * * @return a {@code WritabelPixelFormat<IntBuffer>} describing the * indicated pixel format */
*** 118,131 **** * <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> * * @return a {@code WritabelPixelFormat<IntBuffer>} describing the * indicated pixel format */ --- 118,131 ---- * <p> * Pixels in this format can be decoded using the following sample code: * <pre> * int pixel = array[rowstart + x]; * ! * int alpha = ((pixel &gt;&gt; 24) &amp; 0xff); ! * int red = ((pixel &gt;&gt; 16) &amp; 0xff); ! * int green = ((pixel &gt;&gt; 8) &amp; 0xff); ! * int blue = ((pixel ) &amp; 0xff); * </pre> * * @return a {@code WritabelPixelFormat<IntBuffer>} describing the * indicated pixel format */
*** 141,154 **** * <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> * * @return a {@code WritablePixelFormat<ByteBuffer>} describing the * indicated pixel format */ --- 141,154 ---- * <p> * Pixels in this format can be decoded using the following sample code: * <pre> * int i = rowstart + x * 4; * ! * int blue = (array[i+0] &amp; 0xff); ! * int green = (array[i+1] &amp; 0xff); ! * int red = (array[i+2] &amp; 0xff); ! * int alpha = (array[i+3] &amp; 0xff); * </pre> * * @return a {@code WritablePixelFormat<ByteBuffer>} describing the * indicated pixel format */
*** 164,177 **** * <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> * * @return a {@code WritablePixelFormat<ByteBuffer>} describing the * indicated pixel format */ --- 164,177 ---- * <p> * Pixels in this format can be decoded using the following sample code: * <pre> * int i = rowstart + x * 4; * ! * int blue = (array[i+0] &amp; 0xff); ! * int green = (array[i+1] &amp; 0xff); ! * int red = (array[i+2] &amp; 0xff); ! * int alpha = (array[i+3] &amp; 0xff); * </pre> * * @return a {@code WritablePixelFormat<ByteBuffer>} describing the * indicated pixel format */
*** 187,199 **** * <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> * * @return a {@code PixelFormat<ByteBuffer>} describing the * indicated pixel format */ --- 187,199 ---- * <p> * Pixels in this format can be decoded using the following sample code: * <pre> * int i = rowstart + x * 3; * ! * int red = (array[i+0] &amp; 0xff); ! * int green = (array[i+1] &amp; 0xff); ! * int blue = (array[i+2] &amp; 0xff); * </pre> * * @return a {@code PixelFormat<ByteBuffer>} describing the * indicated pixel format */
*** 207,223 **** * into the specified lookup table of <b>premultiplied</b> color * values in the {@link Type#INT_ARGB_PRE INT_ARGB_PRE} 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> * * @param colors an {@code int[]} array of 32-bit color values in * the {@link Type#INT_ARGB_PRE INT_ARGB_PRE} format * @return a {@code PixelFormat<ByteBuffer>} describing the indicated --- 207,223 ---- * into the specified lookup table of <b>premultiplied</b> color * values in the {@link Type#INT_ARGB_PRE INT_ARGB_PRE} format. * <p> * Pixels in this format can be decoded using the following sample code: * <pre> ! * int pixel = array[rowstart + x] &amp; 0xff; * int argb = colors[pixel]; * ! * int alpha = ((argb &gt;&gt; 24) &amp; 0xff); ! * int red = ((argb &gt;&gt; 16) &amp; 0xff); ! * int green = ((argb &gt;&gt; 8) &amp; 0xff); ! * int blue = ((argb ) &amp; 0xff); * </pre> * * @param colors an {@code int[]} array of 32-bit color values in * the {@link Type#INT_ARGB_PRE INT_ARGB_PRE} format * @return a {@code PixelFormat<ByteBuffer>} describing the indicated
*** 235,251 **** * into the specified lookup table of <b>non-premultiplied</b> color * values in the {@link Type#INT_ARGB INT_ARGB} 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> * * @param colors an {@code int[]} array of 32-bit color values in * the {@link Type#INT_ARGB INT_ARGB} format * @return a {@code PixelFormat<ByteBuffer>} describing the indicated --- 235,251 ---- * into the specified lookup table of <b>non-premultiplied</b> color * values in the {@link Type#INT_ARGB INT_ARGB} format. * <p> * Pixels in this format can be decoded using the following sample code: * <pre> ! * int pixel = array[rowstart + x] &amp; 0xff; * int argb = colors[pixel]; * ! * int alpha = ((argb &gt;&gt; 24) &amp; 0xff); ! * int red = ((argb &gt;&gt; 16) &amp; 0xff); ! * int green = ((argb &gt;&gt; 8) &amp; 0xff); ! * int blue = ((argb ) &amp; 0xff); * </pre> * * @param colors an {@code int[]} array of 32-bit color values in * the {@link Type#INT_ARGB INT_ARGB} format * @return a {@code PixelFormat<ByteBuffer>} describing the indicated
*** 332,345 **** * 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> * * @param buf the buffer of pixel data * @param x the X coordinate of the pixel to be read * @param y the Y coordinate of the pixel to be read --- 332,345 ---- * alignment or other purposes. * <p> * The color components can be extracted from the returned integer using * the following sample code: * <pre> ! * int alpha = ((retval &gt;&gt; 24) &amp; 0xff); ! * int red = ((retval &gt;&gt; 16) &amp; 0xff); ! * int green = ((retval &gt;&gt; 8) &amp; 0xff); ! * int blue = ((retval ) &amp; 0xff); * </pre> * * @param buf the buffer of pixel data * @param x the X coordinate of the pixel to be read * @param y the Y coordinate of the pixel to be read
< prev index next >