![]() |
Tuya iOS Smart Life App SDK 5.15.0
|
#import <ThingEncryptImageCoder.h>
Instance Methods | |
| (instancetype) | - UNAVAILABLE_ATTRIBUTE |
| (nullable instancetype) | - initWithType: |
| (void) | - addImage:duration: |
| (void) | - addImageWithData:duration: |
| (void) | - addImageWithFile:duration: |
| (nullable NSData *) | - encode |
| (BOOL) | - encodeToFile: |
| (instancetype) | - UNAVAILABLE_ATTRIBUTE |
| (nullable instancetype) | - initWithType: |
| (void) | - addImage:duration: |
| (void) | - addImageWithData:duration: |
| (void) | - addImageWithFile:duration: |
| (nullable NSData *) | - encode |
| (BOOL) | - encodeToFile: |
| (instancetype) | - UNAVAILABLE_ATTRIBUTE |
| (nullable instancetype) | - initWithType: |
| (void) | - addImage:duration: |
| (void) | - addImageWithData:duration: |
| (void) | - addImageWithFile:duration: |
| (nullable NSData *) | - encode |
| (BOOL) | - encodeToFile: |
| (instancetype) | - UNAVAILABLE_ATTRIBUTE |
| (nullable instancetype) | - initWithType: |
| (void) | - addImage:duration: |
| (void) | - addImageWithData:duration: |
| (void) | - addImageWithFile:duration: |
| (nullable NSData *) | - encode |
| (BOOL) | - encodeToFile: |
Class Methods | |
| (instancetype) | + UNAVAILABLE_ATTRIBUTE |
| (nullable NSData *) | + encodeImage:type:quality: |
| (nullable NSData *) | + encodeImageWithDecoder:type:quality: |
| (instancetype) | + UNAVAILABLE_ATTRIBUTE |
| (nullable NSData *) | + encodeImage:type:quality: |
| (nullable NSData *) | + encodeImageWithDecoder:type:quality: |
| (instancetype) | + UNAVAILABLE_ATTRIBUTE |
| (nullable NSData *) | + encodeImage:type:quality: |
| (nullable NSData *) | + encodeImageWithDecoder:type:quality: |
| (instancetype) | + UNAVAILABLE_ATTRIBUTE |
| (nullable NSData *) | + encodeImage:type:quality: |
| (nullable NSData *) | + encodeImageWithDecoder:type:quality: |
Properties | |
| ThingEncryptImageType | type |
| Image type. More... | |
| NSUInteger | loopCount |
| Loop count, 0 means infinit, only available for GIF/APNG/WebP. More... | |
| BOOL | lossless |
| Lossless, only available for WebP. More... | |
| CGFloat | quality |
| Compress quality, 0.0~1.0, only available for JPG/JP2/WebP. More... | |
An image encoder to encode image to data.
@discussion It supports encoding single frame image with the type defined in ThingImageType. It also supports encoding multi-frame image with GIF, APNG and WebP.
Example:
ThingImageEncoder *jpegEncoder = [[ThingImageEncoder alloc] initWithType:ThingImageTypeJPEG]; jpegEncoder.quality = 0.9; [jpegEncoder addImage:image duration:0]; NSData jpegData = [jpegEncoder encode];
ThingImageEncoder *gifEncoder = [[ThingImageEncoder alloc] initWithType:ThingImageTypeGIF]; gifEncoder.loopCount = 5; [gifEncoder addImage:image0 duration:0.1]; [gifEncoder addImage:image1 duration:0.15]; [gifEncoder addImage:image2 duration:0.2]; NSData gifData = [gifEncoder encode];
Definition at line 214 of file ThingEncryptImageCoder.h.
| - (void) addImage: | (UIImage *) | image | |
| duration: | (NSTimeInterval) | duration | |
Add an image to encoder.
| image | Image. |
| duration | Image duration for animation. Pass 0 to ignore this parameter. |
| - (void) addImage: | (UIImage *) | image | |
| duration: | (NSTimeInterval) | duration | |
Add an image to encoder.
| image | Image. |
| duration | Image duration for animation. Pass 0 to ignore this parameter. |
| - (void) addImage: | (UIImage *) | image | |
| duration: | (NSTimeInterval) | duration | |
Add an image to encoder.
| image | Image. |
| duration | Image duration for animation. Pass 0 to ignore this parameter. |
| - (void) addImage: | (UIImage *) | image | |
| duration: | (NSTimeInterval) | duration | |
Add an image to encoder.
| image | Image. |
| duration | Image duration for animation. Pass 0 to ignore this parameter. |
| - (void) addImageWithData: | (NSData *) | data | |
| duration: | (NSTimeInterval) | duration | |
Add an image with image data to encoder.
| data | Image data. |
| duration | Image duration for animation. Pass 0 to ignore this parameter. |
| - (void) addImageWithData: | (NSData *) | data | |
| duration: | (NSTimeInterval) | duration | |
Add an image with image data to encoder.
| data | Image data. |
| duration | Image duration for animation. Pass 0 to ignore this parameter. |
| - (void) addImageWithData: | (NSData *) | data | |
| duration: | (NSTimeInterval) | duration | |
Add an image with image data to encoder.
| data | Image data. |
| duration | Image duration for animation. Pass 0 to ignore this parameter. |
| - (void) addImageWithData: | (NSData *) | data | |
| duration: | (NSTimeInterval) | duration | |
Add an image with image data to encoder.
| data | Image data. |
| duration | Image duration for animation. Pass 0 to ignore this parameter. |
| - (void) addImageWithFile: | (NSString *) | path | |
| duration: | (NSTimeInterval) | duration | |
Add an image from a file path to encoder.
| path | Image file path. |
| duration | Image duration for animation. Pass 0 to ignore this parameter. |
| - (void) addImageWithFile: | (NSString *) | path | |
| duration: | (NSTimeInterval) | duration | |
Add an image from a file path to encoder.
| path | Image file path. |
| duration | Image duration for animation. Pass 0 to ignore this parameter. |
| - (void) addImageWithFile: | (NSString *) | path | |
| duration: | (NSTimeInterval) | duration | |
Add an image from a file path to encoder.
| path | Image file path. |
| duration | Image duration for animation. Pass 0 to ignore this parameter. |
| - (void) addImageWithFile: | (NSString *) | path | |
| duration: | (NSTimeInterval) | duration | |
Add an image from a file path to encoder.
| path | Image file path. |
| duration | Image duration for animation. Pass 0 to ignore this parameter. |
| - (nullable NSData *) encode |
Encodes the image and returns the image data.
| - (nullable NSData *) encode |
Encodes the image and returns the image data.
| - (nullable NSData *) encode |
Encodes the image and returns the image data.
| - (nullable NSData *) encode |
Encodes the image and returns the image data.
| + (nullable NSData *) encodeImage: | (UIImage *) | image | |
| type: | (ThingEncryptImageType) | type | |
| quality: | (CGFloat) | quality | |
Convenience method to encode single frame image.
| image | The image. |
| type | The destination image type. |
| quality | Image quality, 0.0~1.0. |
| + (nullable NSData *) encodeImage: | (UIImage *) | image | |
| type: | (ThingEncryptImageType) | type | |
| quality: | (CGFloat) | quality | |
Convenience method to encode single frame image.
| image | The image. |
| type | The destination image type. |
| quality | Image quality, 0.0~1.0. |
| + (nullable NSData *) encodeImage: | (UIImage *) | image | |
| type: | (ThingEncryptImageType) | type | |
| quality: | (CGFloat) | quality | |
Convenience method to encode single frame image.
| image | The image. |
| type | The destination image type. |
| quality | Image quality, 0.0~1.0. |
| + (nullable NSData *) encodeImage: | (UIImage *) | image | |
| type: | (ThingEncryptImageType) | type | |
| quality: | (CGFloat) | quality | |
Convenience method to encode single frame image.
| image | The image. |
| type | The destination image type. |
| quality | Image quality, 0.0~1.0. |
| + (nullable NSData *) encodeImageWithDecoder: | (ThingEncryptImageDecoder *) | decoder | |
| type: | (ThingEncryptImageType) | type | |
| quality: | (CGFloat) | quality | |
Convenience method to encode image from a decoder.
| decoder | The image decoder. |
| type | The destination image type; |
| quality | Image quality, 0.0~1.0. |
| + (nullable NSData *) encodeImageWithDecoder: | (ThingEncryptImageDecoder *) | decoder | |
| type: | (ThingEncryptImageType) | type | |
| quality: | (CGFloat) | quality | |
Convenience method to encode image from a decoder.
| decoder | The image decoder. |
| type | The destination image type; |
| quality | Image quality, 0.0~1.0. |
| + (nullable NSData *) encodeImageWithDecoder: | (ThingEncryptImageDecoder *) | decoder | |
| type: | (ThingEncryptImageType) | type | |
| quality: | (CGFloat) | quality | |
Convenience method to encode image from a decoder.
| decoder | The image decoder. |
| type | The destination image type; |
| quality | Image quality, 0.0~1.0. |
| + (nullable NSData *) encodeImageWithDecoder: | (ThingEncryptImageDecoder *) | decoder | |
| type: | (ThingEncryptImageType) | type | |
| quality: | (CGFloat) | quality | |
Convenience method to encode image from a decoder.
| decoder | The image decoder. |
| type | The destination image type; |
| quality | Image quality, 0.0~1.0. |
| - (BOOL) encodeToFile: | (NSString *) | path |
Encodes the image to a file.
| path | The file path (overwrite if exist). |
| - (BOOL) encodeToFile: | (NSString *) | path |
Encodes the image to a file.
| path | The file path (overwrite if exist). |
| - (BOOL) encodeToFile: | (NSString *) | path |
Encodes the image to a file.
| path | The file path (overwrite if exist). |
| - (BOOL) encodeToFile: | (NSString *) | path |
Encodes the image to a file.
| path | The file path (overwrite if exist). |
| - (nullable instancetype) initWithType: | (ThingEncryptImageType) | NS_DESIGNATED_INITIALIZER |
Create an image encoder with a specified type.
| type | Image type. |
| - (nullable instancetype) initWithType: | (ThingEncryptImageType) | NS_DESIGNATED_INITIALIZER |
Create an image encoder with a specified type.
| type | Image type. |
| - (nullable instancetype) initWithType: | (ThingEncryptImageType) | NS_DESIGNATED_INITIALIZER |
Create an image encoder with a specified type.
| type | Image type. |
| - (nullable instancetype) initWithType: | (ThingEncryptImageType) | NS_DESIGNATED_INITIALIZER |
Create an image encoder with a specified type.
| type | Image type. |
| + (instancetype) UNAVAILABLE_ATTRIBUTE |
| - (instancetype) UNAVAILABLE_ATTRIBUTE |
| + (instancetype) UNAVAILABLE_ATTRIBUTE |
| - (instancetype) UNAVAILABLE_ATTRIBUTE |
| + (instancetype) UNAVAILABLE_ATTRIBUTE |
| - (instancetype) UNAVAILABLE_ATTRIBUTE |
| + (instancetype) UNAVAILABLE_ATTRIBUTE |
| - (instancetype) UNAVAILABLE_ATTRIBUTE |
|
readwritenonatomicassign |
Loop count, 0 means infinit, only available for GIF/APNG/WebP.
Definition at line 217 of file ThingEncryptImageCoder.h.
|
readwritenonatomicassign |
Lossless, only available for WebP.
Definition at line 218 of file ThingEncryptImageCoder.h.
|
readwritenonatomicassign |
Compress quality, 0.0~1.0, only available for JPG/JP2/WebP.
Definition at line 219 of file ThingEncryptImageCoder.h.
|
readnonatomicassign |
Image type.
Definition at line 216 of file ThingEncryptImageCoder.h.