-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
94 additions
and
29 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
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// TYPES | ||
export {ImageDataType, ImageType, ImageTypeEnum} from './types'; | ||
|
||
// LOADERS AND WRITERS | ||
export {default as ImageLoader} from './image-loader'; | ||
export {default as ImageWriter} from './image-writer'; | ||
|
||
// IMAGE CATEGORY API | ||
|
||
// Binary Image API | ||
export {getBinaryImageMetadata} from './lib/category-api/binary-image-api'; | ||
|
||
// Parsed Image API | ||
export {isImageTypeSupported, getDefaultImageType} from './lib/category-api/image-type'; | ||
|
||
export { | ||
isImage, | ||
getImageType, | ||
getImageSize, | ||
getImageData | ||
} from './lib/category-api/parsed-image-api'; | ||
|
||
// Texture Loading API | ||
export {loadImage} from './lib/texture-api/load-image'; | ||
export {loadImageArray} from './lib/texture-api/load-image-array'; | ||
export {loadImageCube} from './lib/texture-api/load-image-cube'; | ||
|
||
// DEPRECATED | ||
// TODO - Remove in V3 | ||
|
||
export {default as HTMLImageLoader} from './image-loader'; | ||
|
||
import {getDefaultImageType} from './lib/category-api/image-type'; | ||
|
||
export function getSupportedImageType(imageType?); | ||
|
||
export { | ||
isBinaryImage, | ||
getBinaryImageMIMEType, | ||
getBinaryImageSize | ||
} from './lib/deprecated/binary-image-api-deprecated'; |
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,16 +1,13 @@ | ||
/** | ||
* Image type string used to control or determine the type of images returned from ImageLoader | ||
*/ | ||
export type ImageType = 'imagebitmap' | 'image' | 'data'; | ||
import {ImageTypeEnum} from '../../types'; | ||
|
||
/** | ||
* Checks if a loaders.gl image type is supported | ||
* @param type image type string | ||
*/ | ||
export function isImageTypeSupported(type: ImageType): boolean; | ||
export function isImageTypeSupported(type: string): boolean; | ||
|
||
/** | ||
* Returns the "most performant" supported image type on this platform | ||
* @returns image type string | ||
*/ | ||
export function getDefaultImageType(): ImageType; | ||
export function getDefaultImageType(): ImageTypeEnum; |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import {ImageType, ImageTypeEnum, ImageDataType} from '../../types'; | ||
|
||
export function isImage(image: ImageType): boolean; | ||
export function getImageType(image: ImageType, throwOnError?: boolean): ImageTypeEnum; | ||
export function getImageData(image: ImageType): ImageDataType | ImageData; | ||
export function getImageSize(image: ImageType): {width: number; height: number}; |
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
2 changes: 1 addition & 1 deletion
2
modules/images/src/lib/deprecated/binary-image-api-deprecated.d.ts
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
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,11 +1,9 @@ | ||
|
||
/** | ||
* Returns data bytes representing a compressed image in PNG or JPG format, | ||
* This data can be saved using file system (f) methods or used in a request. | ||
* @param image - Image or Canvas | ||
* @param mimeType | ||
* TODO clean up | ||
* param {String} opt.type='png' - png, jpg or image/png, image/jpg are valid | ||
* param {String} opt.dataURI= - Whether to include a data URI header | ||
* @param image - ImageBitmap Image or Canvas | ||
* @param options | ||
* param opt.type='png' - png, jpg or image/png, image/jpg are valid | ||
* param mimeType= - Whether to include a data URI header | ||
*/ | ||
export function encodeImage(image: any, mimeType: string): ArrayBuffer; | ||
export function encodeImage(image: any, type?: string): string; |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
/** | ||
* data images | ||
*/ | ||
export type ImageDataType = { | ||
data: Uint8Array; | ||
width: number; | ||
height: number; | ||
compressed?: boolean; | ||
} | ||
|
||
/** | ||
* Supported Image Types | ||
*/ | ||
export type ImageType = ImageBitmap | typeof Image | ImageDataType; | ||
|
||
/** | ||
* Image type string used to control or determine the type of images returned from ImageLoader | ||
*/ | ||
export type ImageTypeEnum = 'imagebitmap' | 'image' | 'data'; |
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
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
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
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