-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LUT Loaders: Add support for FloatType and add docs (#745)
- Loading branch information
1 parent
373ada1
commit 3c808f7
Showing
2 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
import { Loader, LoadingManager, DataTexture, Data3DTexture } from '../../../src/Three.js'; | ||
import { Loader, LoadingManager, DataTexture, Data3DTexture, UnsignedByteType, FloatType } from '../../../src/Three.js'; | ||
|
||
export interface LUT3dlResult { | ||
size: number; | ||
texture: DataTexture; | ||
texture3D: Data3DTexture; | ||
} | ||
|
||
/** | ||
* A 3D LUT loader that supports the .3dl file format. | ||
* | ||
* Based on the following references: | ||
* | ||
* http://download.autodesk.com/us/systemdocs/help/2011/lustre/index.html?url=./files/WSc4e151a45a3b785a24c3d9a411df9298473-7ffd.htm,topicNumber=d0e9492 | ||
* https://community.foundry.com/discuss/topic/103636/format-spec-for-3dl?mode=Post&postID=895258 | ||
*/ | ||
export class LUT3dlLoader extends Loader<LUT3dlResult> { | ||
type: typeof UnsignedByteType | typeof FloatType; | ||
|
||
/** | ||
* Creates a new {@link LUT3dlLoader}. | ||
* @param manager The LoadingManager to use. Defaults to {@link DefaultLoadingManager} | ||
*/ | ||
constructor(manager?: LoadingManager); | ||
|
||
parse(data: string): LUT3dlResult; | ||
/** | ||
* Sets the desired texture type. Only {@link THREE.UnsignedByteType} and {@link THREE.FloatType} are supported. The | ||
* default is {@link THREE.UnsignedByteType}. | ||
* @param type The texture type. See the Textures texture constants page for details. | ||
*/ | ||
setType(type: typeof UnsignedByteType | typeof FloatType): this; | ||
|
||
/** | ||
* Parse a 3dl data string and fire {@link onLoad} callback when complete. The argument to {@link onLoad} will be an | ||
* object containing the following LUT data: {@link LUT3dlResult.size}, {@link LUT3dlResult.texture} and | ||
* {@link LUT3dlResult.texture3D}. | ||
* @param input The 3dl data string. | ||
*/ | ||
parse(input: string): LUT3dlResult; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters