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 p_84968_, int p_84969_, boolean p_84970_)
    • NativeImage

      public NativeImage(NativeImage.Format p_84972_, int p_84973_, int p_84974_, boolean p_84975_)
    • NativeImage

      public NativeImage(NativeImage.Format p_84977_, int p_84978_, int p_84979_, boolean p_84980_, long p_84981_)
  • Method Details

    • toString

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

      private boolean isOutsideBounds(int p_166423_, int p_166424_)
    • read

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

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

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

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

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

      public static NativeImage read(@Nullable NativeImage.Format p_85052_, ByteBuffer p_85053_) 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 p_364787_, int p_362067_)
    • getPixel

      public int getPixel(int p_361017_, int p_364883_)
    • setPixelABGR

      public void setPixelABGR(int p_364345_, int p_360552_, int p_362876_)
    • setPixel

      public void setPixel(int p_362575_, int p_360685_, int p_361735_)
    • mappedCopy

      public NativeImage mappedCopy(IntUnaryOperator p_267084_)
    • getPixelsABGR

      public int[] getPixelsABGR()
    • getPixels

      public int[] getPixels()
    • getLuminanceOrAlpha

      public byte getLuminanceOrAlpha(int p_85088_, int p_85089_)
    • makePixelArray

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

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

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

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

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

      public void copyFrom(NativeImage p_85055_)
    • fillRect

      public void fillRect(int p_84998_, int p_84999_, int p_85000_, int p_85001_, int p_85002_)
    • copyRect

      public void copyRect(int p_85026_, int p_85027_, int p_85028_, int p_85029_, int p_85030_, int p_85031_, boolean p_85032_, boolean p_85033_)
    • copyRect

      public void copyRect(NativeImage p_261644_, int p_262056_, int p_261490_, int p_261959_, int p_262110_, int p_261522_, int p_261505_, boolean p_261480_, boolean p_261622_)
    • resizeSubRectTo

      public void resizeSubRectTo(int p_85035_, int p_85036_, int p_85037_, int p_85038_, NativeImage p_85039_)
    • untrack

      public void untrack()
    • getPointer

      public long getPointer()