Class NativeImage

java.lang.Object
com.mojang.blaze3d.platform.NativeImage
All Implemented Interfaces:
AutoCloseable

public final class NativeImage extends Object implements AutoCloseable
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • MEMORY_POOL

      private static final com.mojang.jtracy.MemoryPool MEMORY_POOL
    • OPEN_OPTIONS

      private static final Set<StandardOpenOption> OPEN_OPTIONS
    • format

      private final NativeImage.Format format
    • width

      private final int width
    • height

      private final int height
    • useStbFree

      private final boolean useStbFree
    • pixels

      private long pixels
    • size

      private final long size
  • Constructor Details

    • NativeImage

      public NativeImage(int pWidth, int pHeight, boolean pUseCalloc)
    • NativeImage

      public NativeImage(NativeImage.Format pFormat, int pWidth, int pHeight, boolean pUseCalloc)
    • NativeImage

      public NativeImage(NativeImage.Format pFormat, int pWidth, int pHeight, boolean pUseStbFree, long pPixels)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isOutsideBounds

      private boolean isOutsideBounds(int pX, int pY)
    • read

      public static NativeImage read(InputStream pTextureStream) throws IOException
      Throws:
      IOException
    • read

      public static NativeImage read(@Nullable NativeImage.Format pFormat, InputStream pTextureStream) throws IOException
      Throws:
      IOException
    • read

      public static NativeImage read(ByteBuffer pTextureData) throws IOException
      Throws:
      IOException
    • read

      public static NativeImage read(byte[] pBytes) throws IOException
      Throws:
      IOException
    • putAndRead

      private static NativeImage putAndRead(ByteBuffer pBuffer, byte[] pBytes) throws IOException
      Throws:
      IOException
    • read

      public static NativeImage read(@Nullable NativeImage.Format pFormat, ByteBuffer pTextureData) throws IOException
      Throws:
      IOException
    • checkAllocated

      private void checkAllocated()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • format

      public NativeImage.Format format()
    • getPixelABGR

      private int getPixelABGR(int pX, int pY)
    • getPixel

      public int getPixel(int pX, int pY)
    • setPixelABGR

      public void setPixelABGR(int pX, int pY, int pColor)
    • setPixel

      public void setPixel(int pX, int pY, int pColor)
    • mappedCopy

      public NativeImage mappedCopy(IntUnaryOperator pFunction)
    • getPixelsABGR

      public int[] getPixelsABGR()
    • getPixels

      public int[] getPixels()
    • getLuminanceOrAlpha

      public byte getLuminanceOrAlpha(int pX, int pY)
    • makePixelArray

      @Deprecated public int[] makePixelArray()
      Deprecated.
    • writeToFile

      public void writeToFile(File pFile) throws IOException
      Throws:
      IOException
    • copyFromFont

      public boolean copyFromFont(org.lwjgl.util.freetype.FT_Face p_320757_, int p_85070_)
    • writeToFile

      public void writeToFile(Path pPath) throws IOException
      Throws:
      IOException
    • writeToChannel

      private boolean writeToChannel(WritableByteChannel pChannel) throws IOException
      Throws:
      IOException
    • copyFrom

      public void copyFrom(NativeImage pOther)
    • fillRect

      public void fillRect(int pX, int pY, int pWidth, int pHeight, int pValue)
    • copyRect

      public void copyRect(int pXFrom, int pYFrom, int pXToDelta, int pYToDelta, int pWidth, int pHeight, boolean pMirrorX, boolean pMirrorY)
    • copyRect

      public void copyRect(NativeImage pSource, int pXFrom, int pYFrom, int pXTo, int pYTo, int pWidth, int pHeight, boolean pMirrorX, boolean pMirrorY)
    • resizeSubRectTo

      public void resizeSubRectTo(int pX, int pY, int pWidth, int pHeight, NativeImage pImage)
    • untrack

      public void untrack()
    • getPointer

      public long getPointer()