Package icyllis.arc3d.engine
Class DataUtils
java.lang.Object
icyllis.arc3d.engine.DataUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
compressionTypeIsOpaque
(int compression) static long
computeCombinedBufferSize
(int mipLevelCount, int bytesPerBlock, int width, int height, int compressionType, long[] mipOffsetsAndRowBytes) Compute the size of the buffer required to hold all the mipLevels of the specified type of data when all rowBytes are tight.static int
computeMipLevelCount
(int width, int height, int depth) static long
computeSize
(ImageDesc desc) static int
num4x4Blocks
(int size) static int
numBlocks
(int compression, int size) static long
numBlocks
(int compression, int width, int height)
-
Method Details
-
compressionTypeIsOpaque
public static boolean compressionTypeIsOpaque(int compression) -
num4x4Blocks
public static int num4x4Blocks(int size) -
numBlocks
public static long numBlocks(int compression, int width, int height) -
numBlocks
public static int numBlocks(int compression, int size) -
computeSize
-
computeMipLevelCount
public static int computeMipLevelCount(int width, int height, int depth) -
computeCombinedBufferSize
public static long computeCombinedBufferSize(int mipLevelCount, int bytesPerBlock, int width, int height, int compressionType, long[] mipOffsetsAndRowBytes) Compute the size of the buffer required to hold all the mipLevels of the specified type of data when all rowBytes are tight.Note there may still be padding between the mipLevels to meet alignment requirements.
Returns total buffer size to allocate, and required offset alignment of that allocation. Updates 'mipOffsetsAndRowBytes' with offsets relative to start of the allocation, as well as the aligned destination rowBytes for each level.
The last pair of 'mipOffsetsAndRowBytes' holds combined buffer size and required alignment.
-