main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

59
node_modules/three/examples/jsm/loaders/TIFFLoader.js generated vendored Normal file
View File

@@ -0,0 +1,59 @@
import {
DataTextureLoader,
LinearFilter,
LinearMipmapLinearFilter
} from 'three';
import UTIF from '../libs/utif.module.js';
/**
* A loader for the TIFF texture format.
*
* ```js
* const loader = new TIFFLoader();
* const texture = await loader.loadAsync( 'textures/tiff/crate_lzw.tif' );
* texture.colorSpace = THREE.SRGBColorSpace;
* ```
*
* @augments DataTextureLoader
* @three_import import { TIFFLoader } from 'three/addons/loaders/TIFFLoader.js';
*/
class TIFFLoader extends DataTextureLoader {
/**
* Constructs a new TIFF loader.
*
* @param {LoadingManager} [manager] - The loading manager.
*/
constructor( manager ) {
super( manager );
}
/**
* Parses the given TIFF texture data.
*
* @param {ArrayBuffer} buffer - The raw texture data.
* @return {DataTextureLoader~TexData} An object representing the parsed texture data.
*/
parse( buffer ) {
const ifds = UTIF.decode( buffer );
UTIF.decodeImage( buffer, ifds[ 0 ] );
const rgba = UTIF.toRGBA8( ifds[ 0 ] );
return {
width: ifds[ 0 ].width,
height: ifds[ 0 ].height,
data: rgba,
flipY: true,
magFilter: LinearFilter,
minFilter: LinearMipmapLinearFilter
};
}
}
export { TIFFLoader };