Spec-Zone.ru › OpenJavaFX 8
javafx.scene.image

Class WritablePixelFormat<T extends Buffer>

java.lang.Object
  • javafx.scene.image.PixelFormat<T>
    • javafx.scene.image.WritablePixelFormat<T>


public abstract class WritablePixelFormat<T extends Buffer>
extends PixelFormat<T>
A PixelFormat object representing a pixel format that can store full colors and so can be used as a destination format to write pixel data from an arbitrary image.

Since:

JavaFX 2.2

  • Nested Class Summary

    • Nested classes/interfaces inherited from class javafx.scene.image.PixelFormat

      PixelFormat.Type
  • Method Summary

    All MethodsInstance MethodsAbstract MethodsConcrete Methods
    Modifier and Type Method and Description
    boolean isWritable()
    Returns true iff this PixelFormat object can convert color information into a pixel representation.
    abstract void setArgb(T buf, int x, int y, int scanlineStride, int argb)
    Stores the appropriate pixel data that represents the specified 32-bit integer representation of a color in the buffer at the specified coordinates.
    • Methods inherited from class javafx.scene.image.PixelFormat

      createByteIndexedInstance, createByteIndexedPremultipliedInstance, getArgb, getByteBgraInstance, getByteBgraPreInstance, getByteRgbInstance, getIntArgbInstance, getIntArgbPreInstance, getType, isPremultiplied
    • Methods inherited from class java.lang.Object

      clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Detail

    • isWritable

      public boolean isWritable()
      Description copied from class: PixelFormat
      Returns true iff this PixelFormat object can convert color information into a pixel representation.

      Specified by:

      isWritable in class PixelFormat<T extends Buffer>

      Returns:

      true iff this PixelFormat can convert colors to pixel data

    • setArgb

      public abstract void setArgb(T buf,
                                   int x,
                                   int y,
                                   int scanlineStride,
                                   int argb)
      Stores the appropriate pixel data that represents the specified 32-bit integer representation of a color in the buffer at the specified coordinates. 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 buf.get(0) would return the pixel information for the pixel at coordinates (0, 0). The scanlineStride 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, scanlineStride 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.

      Color components can be composed into an integer using the following sample code:

      int argb = ((alpha << 24) |
                       (red   << 16) |
                       (green <<  8) |
                       (blue       );

      Parameters:

      buf - the buffer of pixel data

© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API