A class in the same form as the three.js loaders for loading and parsing SGI images.
Note Note that RLE parsing for 2 byte per channel images is untested.
const loader = new SGILoader();
loader
.load( 'path/to/file.rgb' )
.then( texture => {
// ... loaded three.js texture ...
} );
name : String
The image name embedded in the file.
rle : Boolean
Whether the file is run length encoded or not.
dimension : Number
The number of dimensions to the stored data.
width : Number
The width of the sgi file in pixels.
height : Number
The height of the sgi file in pixels.
channels : Number
The number of color channels stored in the image.
minValue : Number
The minimum channel value in the file.
maxValue : Number
The maximum channel value in the file.
bytesPerChannel : Number
The amount of bytes used to represent a single color channel.
data : Uint16Array | Uint8Array
The SGI laid out in an array in row major order where each row has a stride
of width * channels * bytesPerChannel
.
Class for loading Silicon Graphics Image files
fetchOptions : Object = { credentials: 'same-origin' }
Fetch options for loading the file.
load( url : String ) : Promise<SGIResult>
Loads and parses the SGI file. The promise resolves with the returned data from the parse function.
parse( buffer : ArrayBuffer | Uint8Array ) : SGIResult
Parses the contents of the given SGI contents and returns an object describing the telemetry.
A three.js implementation of SGILoader that returns a data texture rather than raw results.
extends SGILoaderBase
manager : LoadingManager = DefaultLoadingManager
constructor( manager : LoadingManager = DefaultLoadingManager ) : void
load( url : String, texture : DataTexture = new DataTexture() ) : DataTexture
Loads and parses the SGI file and returns a DataTexture. If a DataTexture is passed into the function the data is applied to it.
parse( buffer : ArrayBuffer | Uint8Array, texture : DataTexture = new DataTexture() ) : DataTexture
Parses the contents of the given SGI contents and returns a texture.