GPKGImageConverter

Objective-C

@interface GPKGImageConverter : NSObject

Swift

class GPKGImageConverter : NSObject

Conversions between images and image byte data

  • Decode the byte data to an image

    Declaration

    Objective-C

    + (id)toImage:(NSData *)data;

    Swift

    class func toImage(_ data: Data!) -> Any!

    Parameters

    data

    byte data

    Return Value

    image

  • Decode the byte data to an image with scale

    Declaration

    Objective-C

    + (id)toImage:(NSData *)data withScale:(CGFloat)scale;

    Swift

    class func toImage(_ data: Data!, withScale scale: Double) -> Any!

    Parameters

    data

    byte data

    scale

    scale factor, 0.0 to 1.0

    Return Value

    image

  • Compress the image to byte data

    Declaration

    Objective-C

    + (NSData *)toData:(id)image andFormat:(enum GPKGCompressFormat)format;

    Swift

    class func toData(_ image: Any!, andFormat format: GPKGCompressFormat) -> Data!

    Parameters

    image

    image

    format

    compress format

    Return Value

    byte data

  • Compress the image to byte data with quality

    Declaration

    Objective-C

    + (NSData *)toData:(id)image
             andFormat:(enum GPKGCompressFormat)format
            andQuality:(CGFloat)quality;

    Swift

    class func toData(_ image: Any!, andFormat format: GPKGCompressFormat, andQuality quality: Double) -> Data!

    Parameters

    image

    image

    format

    compress format

    quality

    quality, 0.0 to 1.0, only used for GPKG_CF_JPEG

    Return Value

    byte data