Package org.ngengine.stbimage
Class BmpDecoder
java.lang.Object
org.ngengine.stbimage.BmpDecoder
- All Implemented Interfaces:
StbDecoder
BMP decoder supporting 1/4/8/24/32-bit, uncompressed and RLE compressed.
-
Constructor Summary
ConstructorsConstructorDescriptionBmpDecoder(ByteBuffer buffer, IntFunction<ByteBuffer> allocator, boolean flipVertically) Creates a BMP 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 booleanisBmp(ByteBuffer buffer) Tests if the buffer starts with BMP magic bytes.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
-
BmpDecoder
Creates a BMP decoder instance.- Parameters:
buffer- source dataallocator- output allocatorflipVertically- true to flip decoded rows
-
-
Method Details
-
isBmp
Tests if the buffer starts with BMP magic bytes.- Parameters:
buffer- source bytes- Returns:
- true if BMP signature matches
-
info
Reads image metadata without fully decoding pixel data.- Specified by:
infoin interfaceStbDecoder- Returns:
- image information
-
getAllocator
Returns the allocator used by this decoder for output buffers.- Specified by:
getAllocatorin interfaceStbDecoder- Returns:
- allocator function
-
load
Decodes image pixels.- Specified by:
loadin interfaceStbDecoder- Parameters:
desiredChannels- requested output channels (0 keeps source/default behavior)- Returns:
- decoded image result
-