Package org.ngengine.stbimage
Class TgaDecoder
java.lang.Object
org.ngengine.stbimage.TgaDecoder
- All Implemented Interfaces:
StbDecoder
TGA decoder supporting uncompressed and RLE compressed, grayscale and color.
-
Constructor Summary
ConstructorsConstructorDescriptionTgaDecoder(ByteBuffer buffer, IntFunction<ByteBuffer> allocator, boolean flipVertically) Creates a TGA decoder instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the allocator used by this decoder for output buffers.info()Reads image metadata without fully decoding pixel data.static booleanisTga(ByteBuffer src) Performs a lightweight TGA probe.load(int desiredChannels) Decodes image pixels.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ngengine.stbimage.StbDecoder
load16, loadAllFrames, loadf, loadNextFrame
-
Constructor Details
-
TgaDecoder
Creates a TGA decoder instance.- Parameters:
buffer- source dataallocator- output allocatorflipVertically- true to vertically flip decoded output
-
-
Method Details
-
getAllocator
Returns the allocator used by this decoder for output buffers.- Specified by:
getAllocatorin interfaceStbDecoder- Returns:
- allocator function
-
isTga
Performs a lightweight TGA probe.- Parameters:
src- source bytes- Returns:
- true when the source can be considered a potential TGA payload
-
info
Reads image metadata without fully decoding pixel data.- Specified by:
infoin interfaceStbDecoder- Returns:
- image information
-
load
Decodes image pixels.- Specified by:
loadin interfaceStbDecoder- Parameters:
desiredChannels- requested output channels (0 keeps source/default behavior)- Returns:
- decoded image result
-