StaticaccessConverts ArrayBuffer or Uint8Array to an image data URL.
The image data buffer
Type/format of the image
Data URL string for the image
StaticaccessAccesses binary data from a buffer view and converts it to an image data URL.
Index of the buffer view in the JSON
JSON object containing buffer view information
The source buffer data
MIME type of the image
Data URL string for the image
StaticaddAdds padding bytes to achieve the specified byte alignment.
The original byte length
The byte alignment requirement
The padded byte length
StaticarrayConverts an ArrayBuffer to a string using TextDecoder when available.
The ArrayBuffer to convert
String representation of the buffer data
StaticatobDecodes a base64 string, compatible with both browser and Node.js environments.
The base64 string to decode
Decoded binary string
Staticbase64StaticbtoaEncodes a string to base64 format, compatible with both browser and Node.js environments.
The string to encode
Base64 encoded string
StaticcalcCalculates the number of padding bytes needed for byte alignment.
The original byte length
The byte alignment requirement
Number of padding bytes needed
StaticcopyCopies data from source ArrayBuffer to destination ArrayBuffer.
Copy configuration object
Number of bytes to copy
Destination ArrayBuffer
Byte offset in destination buffer (default: 0)
Source ArrayBuffer
Byte offset in source buffer
The destination ArrayBuffer
StaticcopyCopies data using 4-byte aligned operations from source to destination ArrayBuffer.
Copy configuration object
Number of bytes to copy (must be 4-byte aligned)
Destination ArrayBuffer
Byte offset in destination buffer (must be 4-byte aligned)
Source ArrayBuffer
Byte offset in source buffer (must be 4-byte aligned)
The destination ArrayBuffer
StaticcopyCopies data using 4-byte aligned operations with padding to achieve 4-byte alignment.
Copy configuration object
Number of bytes to copy
Destination ArrayBuffer
Byte offset in destination buffer
Source ArrayBuffer
Byte offset in source buffer
The destination ArrayBuffer
StaticcopyCopies data from source ArrayBuffer to destination ArrayBuffer with padding if needed.
Copy configuration object
Number of bytes to copy
Destination ArrayBuffer
Byte offset in destination buffer
Source ArrayBuffer
Byte offset in source buffer
The destination ArrayBuffer
StaticcreateCreates a blob image URI from a Uint8Array.
The image data as Uint8Array
MIME type of the image
Blob URL string for the image
StaticcreateCreates default options for glTF loading operations.
Default GltfLoadOption configuration object
StaticcreateCreates an HTMLImageElement from a URI with proper CORS handling.
The image URI
MIME type of the image
Promise that resolves to the loaded HTMLImageElement
StaticcreateStaticdataConverts a data URI to an ArrayBuffer.
The data URI string to convert
ArrayBuffer containing the decoded data
StaticdetectDetects if an image contains transparent pixels below a specified threshold.
The image to analyze (HTMLImageElement, HTMLCanvasElement, or ImageData)
Alpha threshold value (default: 1.0)
True if transparent pixels are found, false otherwise
StaticfetchFetches an ArrayBuffer from a URI using the Fetch API.
The URI to fetch from
Promise that resolves to a Result containing the ArrayBuffer or error
StaticgetCreates a copy of an ArrayBuffer with specified parameters.
Copy configuration object
Number of bytes to copy
Byte offset in destination buffer
Source ArrayBuffer
Byte offset in source buffer
Copied ArrayBuffer
StaticgetCreates a copy of an ArrayBuffer using 4-byte aligned operations.
Copy configuration object
Number of bytes to copy (must be 4-byte aligned)
Byte offset in destination buffer (must be 4-byte aligned)
Source ArrayBuffer
Byte offset in source buffer (must be 4-byte aligned)
Copied ArrayBuffer
StaticgetExtracts the file extension from a filename.
The filename to extract extension from
File extension string
StaticgetGets the appropriate data URL prefix for a given image type.
The image type or MIME type
Data URL prefix string
StaticgetGets the MIME type from a file extension.
The file extension
MIME type string
StaticgetGets the nearest power of two value for a given number.
The input value
The nearest power of two value
StaticgetResizes an image to fit within specified dimensions while maintaining aspect ratio.
The source HTMLImageElement
Maximum size for the largest dimension
Tuple containing the resized canvas, width, and height
StaticisDetermines if the current environment is Node.js.
True if running in Node.js environment, false otherwise
StaticloadLoads a resource asynchronously with support for both binary and text data.
URI of the resource to load
Whether to load as binary data
Callback function for successful loading
Callback function for error handling
Promise that resolves with the loaded resource
StaticnormalizedConverts normalized Int16Array values to Float32Array.
Source Int16Array or number array
Float32Array with normalized values
StaticnormalizedConverts normalized Int8Array values to Float32Array.
Source Int8Array or number array
Float32Array with normalized values
StaticnormalizedConverts normalized Uint16Array values to Float32Array.
Source Uint16Array or number array
Float32Array with normalized values
StaticnormalizedConverts normalized Uint8Array values to Float32Array.
Source Uint8Array or number array
Float32Array with normalized values
StaticstringConverts a string to base64 encoding.
The string to encode
Base64 encoded string
StaticstringConverts a string to an ArrayBuffer using TextEncoder.
The string to convert
ArrayBuffer containing the encoded string data
StatictakeExtracts a Uint8Array from a buffer view based on JSON specification.
RnM2 JSON object containing buffer view information
Index of the buffer view
The source buffer data
Uint8Array view of the specified buffer region
StatictoCalculates CRC32 checksum for a given string.
The string to calculate checksum for
CRC32 checksum as unsigned 32-bit integer
StaticUConverts a Uint8Array to a data URL for image display.
The image data as Uint8Array
Image width in pixels
Image height in pixels
Data URL string for the image
Staticuint8Converts a Uint8Array to a string using TextDecoder when available.
The Uint8Array to convert
String representation of the array data
Staticuint8Internal method to convert Uint8Array to string without TextDecoder.
The Uint8Array to convert
String representation of the array data
Utility class for data manipulation, conversion, and processing operations. Provides methods for handling various data formats including ArrayBuffer, Uint8Array, base64 encoding/decoding, image processing, and file operations.