Skip to content

Class NCBitmapRegionDecoder

Il Kadyrov edited this page Nov 5, 2020 · 1 revision

NCBitmapRegionDecoder class is used for getting UIImage from byte array.

Referenced from: NCResourceManager.

Public methods

Function newInstance

+ (nullable NCBitmapRegionDecoder *)newInstance:(nonnull NSData *)data
                                         length:(int32_t)length;

Function returns the instance of NCBitmapRegionDecoder, which could be used for decoding byte array to UIImage.

Parameters
  • data — byte array of compressed image data.
  • length — length of data byte array.
Return value

NCBitmapRegionDecoder class instance.

Function decodeRegion

- (nullable UIImage *)decodeRegion:(nonnull NCRectangle *)rect
                        sampleSize:(int32_t)sampleSize;

Function decodes a rectangle region in the image specified by rect.

Parameters
  • rect — byte array of image data.
  • sampleSize — if set to a value > 1, requests the decoder to subsample the original image, returning a smaller image to save memory.
Return value

UIImage class instance.

Clone this wiki locally