A class in the same form as the three.js loaders for loading and parsing PGM images (ref 1, ref 2).
const loader = new PGMLoader();
loader.load( 'path/to/file.pgm', array => {
// ... loaded data ...
} );
data : Uint16Array | Uint8Array
The PGM laid out in an array in row major order where each row has a stride of width
.
width : Number
The width of the pgm file in pixels.
height : Number
The height of the pgm file in pixels.
maxValue : Number
The maximum gray value in the file.
Class for loading and parsing PGM image files
fetchOptions : Object = { credentials: 'same-origin' }
Fetch options for loading the file.
load( url : String ) : Promise<PGMResult>
Loads and parses the PGM file. The promise resolves with the returned data from the parse function.
parse( buffer : ArrayBuffer ) : PGMResult
Parses the contents of the given PGM and returns an object describing the telemetry.
Three.js implementation of PGMLoaderBase.
extends PGMLoaderBase
manager : LoadingManager = DefaultLoadingManager
constructor( manager : LoadingManager = DefaultLoadingManager ) : void
load( url : String, texture : DataTexture = new DataTexture() ) : Promise<DataTexture>
Loads and parses the PGM file and returns a DataTexture. If a DataTexture is passed into the function the data is applied to it.
parse( buffer : Uint8Array | ArrayBuffer, texture : DataTexture = new DataTexture() ) : DataTexture
Parses the contents of the given PGM file and returns a texture with the contents.