Class MipMapImageRaster

java.lang.Object
com.jme3.texture.image.ImageRaster
com.jme3.texture.image.MipMapImageRaster

public class MipMapImageRaster extends ImageRaster
  • Constructor Details

    • MipMapImageRaster

      public MipMapImageRaster(Image image, int slice)
  • Method Details

    • setSlice

      public void setSlice(int slice)
    • setMipLevel

      public void setMipLevel(int mipLevel)
    • setPixel

      public void setPixel(int x, int y, ColorRGBA color)
      Description copied from class: ImageRaster
      Sets the pixel at the given coordinate to the given color.

      For all integer based formats (those not ending in "F"), the color is first clamped to 0.0 - 1.0 before converting it to an integer to avoid overflow. For floating point based formats, components larger than 1.0 can be represented, but components lower than 0.0 are still not allowed (as all formats are unsigned).

      If the underlying format is grayscale (e.g. one of the luminance formats, such as Image.Format.Luminance8) then a color to grayscale conversion is done first, before writing the result into the image.

      If the image lacks some components (such as alpha, or any of the color components), then these components will be ignored. The only exception to this is luminance formats for which the color is converted to luminance first (see above).

      After writing the color, the image shall be marked as requiring an update. The next time it is used for rendering, all pixel changes will be reflected when the image is rendered.

      Specified by:
      setPixel in class ImageRaster
      Parameters:
      x - The x coordinate, from 0 to width - 1.
      y - The y coordinate, from 0 to height - 1.
      color - The color to write.
    • getPixel

      public ColorRGBA getPixel(int x, int y, ColorRGBA store)
      Description copied from class: ImageRaster
      Retrieve the color at the given coordinate.

      Any components that are not defined in the image format will be set to 1.0 in the returned color. For example, reading from an Image.Format.Alpha8 format will return a ColorRGBA with the R, G, and B components set to 1.0, and the A component set to the alpha in the image.

      For grayscale or luminance formats, the luminance value is replicated in the R, G, and B components.

      Integer formats are converted to the range 0.0 - 1.0, based on the maximum possible integer value that can be represented by the number of bits the component has. For example, the Image.Format.RGB5A1 format can contain the integer values 0 - 31, a conversion to floating point is done by diving the integer value by 31 (done with floating point precision).

      Specified by:
      getPixel in class ImageRaster
      Parameters:
      x - The x coordinate, from 0 to width - 1.
      y - The y coordinate, from 0 to height - 1.
      store - Storage location for the read color, if null, then a new ColorRGBA is created and returned with the read color.
      Returns:
      The store parameter, if it is null, then a new ColorRGBA with the read color.
    • getWidth

      public int getWidth()
      Description copied from class: ImageRaster
      Returns the pixel width of the underlying image.
      Specified by:
      getWidth in class ImageRaster
      Returns:
      the pixel width of the underlying image.
    • getHeight

      public int getHeight()
      Description copied from class: ImageRaster
      Returns the pixel height of the underlying image.
      Specified by:
      getHeight in class ImageRaster
      Returns:
      the pixel height of the underlying image.