ImageUploadOptions
ClassProvides configuration options for uploading images via RemoteMediaModule.uploadImage.
- Available on all platforms
Provides configuration options for uploading images via RemoteMediaModule.uploadImage. Allows setting the compression method, compression quality, and whether to include alpha channel.
Index
Example
// @input Asset.RemoteMediaModule remoteMediaModule
// @input Asset.Texture texture
var uploadOptions = ImageUploadOptions.create();
uploadOptions.compressionMethod = ImageUploadCompressionMethod.JPG;
uploadOptions.compressionQuality = CompressionQualityLevel.HighQuality;
// Note: Set includeAlpha last to avoid conflicts with compressionMethod.
// Alpha is not supported for JPG comrpession.
uploadOptions.includeAlpha = false;
script.remoteMediaModule.uploadImage(
script.texture,
function(resource) {
print("Image uploaded successfully");
},
function(error) {
print("Upload failed: " + error);
},
uploadOptions
);
Extends
Properties
compressionMethod
compressionMethod:
ImageUploadCompressionMethod
The compression method (image format) to use when encoding the image.
Default Value
ImageUploadCompressionMethod.JPG
compressionQuality
compressionQuality:
CompressionQuality
The compression quality level to use when encoding the image.
Default Value
CompressionQuality.MaximumQuality
includeAlpha
includeAlpha:
boolean
Whether to include the alpha channel in the uploaded image.
Note: This property must be set after compressionMethod to avoid conflicts.
Alpha channel is not supported for JPG format.
Default Value
false
Methods
create()
staticcreate():ImageUploadOptions
Creates a new ImageUploadOptions instance with default settings.
Returns
ImageUploadOptions
Since
Lens Scripting Version 353
getTypeName()
staticgetTypeName():TypeName<ImageUploadOptions>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<ImageUploadOptions>
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean