ImageStream
Interface for handling image stream operations. Provides functionality for image stream manipulation and conversion.
interface ImageStream {
writeImageToFile(filePath: string): void;
setFormat(format: ImageFormat): void;
setRotation(rotation: CameraRotation): void;
createImageBitmap(isRotate?: boolean, scale?: number): ImageBitmap;
}
Methods
writeImageToFile
Decode the image from ImageStream and store it to a disk path.
writeImageToFile(filePath: string): void
Parameters
Name | Type | Description |
---|---|---|
filePath | string | The path to which the image is written |
Returns
void
setFormat
Set the format of the image stream.
setFormat(format: ImageFormat): void
Parameters
Name | Type | Description |
---|---|---|
format | ImageFormat | Format of the image |
Returns
void
setRotation
Set the rotation of the image stream.
setRotation(rotation: CameraRotation): void
Parameters
Name | Type | Description |
---|---|---|
rotation | CameraRotation | Rotation angle of the image |
Returns
void
createImageBitmap
Create a bitmap image from the stream.
createImageBitmap(isRotate?: boolean, scale?: number): ImageBitmap
Parameters
Name | Type | Description |
---|---|---|
isRotate | boolean | (Optional) Whether to rotate the image |
scale | number | (Optional) The scale of the image |
Returns
ImageBitmap
- The created bitmap image