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
    • 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

      private 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
    • read

      public static NativeImage read(@Nullable NativeImage.Format p_85052_, ByteBuffer p_85053_) throws IOException
      Throws:
      IOException
    • setFilter

      private static void setFilter(boolean p_85082_, boolean p_85083_)
    • 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()
    • getPixelRGBA

      public int getPixelRGBA(int p_84986_, int p_84987_)
    • setPixelRGBA

      public void setPixelRGBA(int p_84989_, int p_84990_, int p_84991_)
    • mappedCopy

      public NativeImage mappedCopy(IntUnaryOperator p_267084_)
    • applyToAllPixels

      public void applyToAllPixels(IntUnaryOperator p_285490_)
    • getPixelsRGBA

      public int[] getPixelsRGBA()
    • setPixelLuminance

      public void setPixelLuminance(int p_166403_, int p_166404_, byte p_166405_)
    • getRedOrLuminance

      public byte getRedOrLuminance(int p_166409_, int p_166410_)
    • getGreenOrLuminance

      public byte getGreenOrLuminance(int p_166416_, int p_166417_)
    • getBlueOrLuminance

      public byte getBlueOrLuminance(int p_166419_, int p_166420_)
    • getLuminanceOrAlpha

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

      public void blendPixel(int p_166412_, int p_166413_, int p_166414_)
    • makePixelArray

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

      public void upload(int p_85041_, int p_85042_, int p_85043_, boolean p_85044_)
    • upload

      public void upload(int p_85004_, int p_85005_, int p_85006_, int p_85007_, int p_85008_, int p_85009_, int p_85010_, boolean p_85011_, boolean p_85012_)
    • upload

      public void upload(int p_85014_, int p_85015_, int p_85016_, int p_85017_, int p_85018_, int p_85019_, int p_85020_, boolean p_85021_, boolean p_85022_, boolean p_85023_, boolean p_85024_)
    • _upload

      private void _upload(int p_85091_, int p_85092_, int p_85093_, int p_85094_, int p_85095_, int p_85096_, int p_85097_, boolean p_85098_, boolean p_85099_, boolean p_85100_, boolean p_85101_)
    • downloadTexture

      public void downloadTexture(int p_85046_, boolean p_85047_)
    • downloadDepthBuffer

      public void downloadDepthBuffer(float p_166401_)
    • drawPixels

      public void drawPixels()
    • writeToFile

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

      public void copyFromFont(org.lwjgl.stb.STBTTFontinfo p_85069_, int p_85070_, int p_85071_, int p_85072_, float p_85073_, float p_85074_, float p_85075_, float p_85076_, int p_85077_, int p_85078_)
    • writeToFile

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

      public byte[] asByteArray() 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_)
    • flipY

      public void flipY()
    • resizeSubRectTo

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

      public void untrack()