ImageObject
Objective-C
@interface ImageObject : NSObject
Swift
class ImageObject : NSObject
This class encapsulates image object information.
-
Initializes and returns a newly allocated object using the model data.
Declaration
Objective-C
- (nonnull instancetype)initWithModelData:(nonnull void *)data;
-
Initializes and returns a newly allocated object using the data buffer and format.
Declaration
Objective-C
- (nonnull instancetype)initWithDataBuffer:(nonnull NSData *)data format:(ImageFormat)format;
Swift
init(dataBuffer data: Data, format: ImageFormat)
-
Returns the model data.
Declaration
Objective-C
- (nonnull void *)getModelData;
-
Returns the unique ID of the image.
Declaration
Objective-C
- (unsigned int)getUid;
Swift
func getUid() -> UInt32
-
Renders the image.
Declaration
Objective-C
- (nullable UIImage *)renderImageWithSize:(CGSize)size;
Swift
func renderImage(with size: CGSize) -> UIImage?
Parameters
size
The size in pixels.
-
Renders the image.
Declaration
Objective-C
- (nullable UIImage *)renderImageWithSize:(CGSize)size scale:(CGFloat)scale ppi:(NSInteger)ppi;
Swift
func renderImage(with size: CGSize, scale: CGFloat, ppi: Int) -> UIImage?
Parameters
size
The size in pixels.
scale
The screen scale factor.
ppi
The screen pixel per inch.
-
Returns the image of the item.
Declaration
Objective-C
- (nullable UIImage *)renderAspectRatioImage:(CGFloat)height;
Swift
func renderAspectRatioImage(_ height: CGFloat) -> UIImage?
Parameters
height
The image height in pixels. @details Aspect ratio is taking into consideration.
-
Returns the image of the item.
Declaration
Objective-C
- (nullable UIImage *)renderAspectRatioImage:(CGFloat)height scale:(CGFloat)scale ppi:(NSInteger)ppi;
Swift
func renderAspectRatioImage(_ height: CGFloat, scale: CGFloat, ppi: Int) -> UIImage?
Parameters
height
The image height in pixels.
scale
The screen scale factor.
ppi
The screen pixel per inch. @details Aspect ratio is taking into consideration.
-
Returns the size of the image.
Declaration
Objective-C
- (CGSize)getSize;
Swift
func getSize() -> CGSize
-
Returns the aspect ratio of the image. @details If width > height return ( width / height, 1.f ). If width < height return ( 1.f, height / width ).
Declaration
Objective-C
- (CGSize)getAspectRatio;
Swift
func getAspectRatio() -> CGSize
-
Check if icon is scalable ( i.e. it has vectorial format ).
Declaration
Objective-C
- (BOOL)isScalable;
Swift
func isScalable() -> Bool
-
Check the validity of the Image.
Declaration
Objective-C
- (BOOL)isValid;
Swift
func isValid() -> Bool