Package org.ngengine.stbimage
Class StbUtils
java.lang.Object
org.ngengine.stbimage.StbUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteBufferconvertChannels(IntFunction<ByteBuffer> allocator, ByteBuffer src, int srcChannels, int width, int height, int desiredChannels, boolean is16Bit) Converts interleaved pixel channels between 1/2/3/4-channel layouts.static ByteBufferverticalFlip(IntFunction<ByteBuffer> allocator, ByteBuffer src, int width, int height, int channels, boolean is16Bit) Flips interleaved pixel data vertically.static ByteBufferverticalFlip(IntFunction<ByteBuffer> allocator, ByteBuffer src, int width, int height, int channels, int bytesPerChannel) Flips interleaved pixel data vertically using explicit channel byte width.
-
Constructor Details
-
StbUtils
public StbUtils()
-
-
Method Details
-
convertChannels
public static ByteBuffer convertChannels(IntFunction<ByteBuffer> allocator, ByteBuffer src, int srcChannels, int width, int height, int desiredChannels, boolean is16Bit) Converts interleaved pixel channels between 1/2/3/4-channel layouts.- Parameters:
allocator- destination allocatorsrc- source interleaved pixel buffersrcChannels- source channel countwidth- image widthheight- image heightdesiredChannels- target channel countis16Bit- true for 16-bit channel elements- Returns:
- converted buffer
-
verticalFlip
public static ByteBuffer verticalFlip(IntFunction<ByteBuffer> allocator, ByteBuffer src, int width, int height, int channels, boolean is16Bit) Flips interleaved pixel data vertically.- Parameters:
allocator- destination allocatorsrc- source pixelswidth- image widthheight- image heightchannels- channel countis16Bit- true for 16-bit elements (2 bytes per channel)- Returns:
- vertically flipped buffer
-
verticalFlip
public static ByteBuffer verticalFlip(IntFunction<ByteBuffer> allocator, ByteBuffer src, int width, int height, int channels, int bytesPerChannel) Flips interleaved pixel data vertically using explicit channel byte width.- Parameters:
allocator- destination allocatorsrc- source pixelswidth- image widthheight- image heightchannels- channel countbytesPerChannel- bytes per channel element- Returns:
- vertically flipped buffer
-