Resource Base
Table of contents

iImageData

You are viewing a history document page of Dynamsoft Document Normalizer v1.0.30.

Stores the image data.

  • Objective-C
  • Swift
  1. @interface iImageData : NSObject 
    
  2. class iImageData : NSObject
    

Attributes

Attribute Type Description
bytes NSData* The array of bytes that stores the pixel buffer of the image.
width NSInteger The width of the image in pixels.
height NSInteger The height of the image in pixels.
stride NSInteger The stride is measured by the byte length of each line in the pixel buffer.
format NSInteger The image pixel format used in the image byte array. View EnumImagePixelFormat for all supported image pixel formats.
orientation NSInteger The orientation of the image buffer contained in this frame data.

Methods

Method Description
toUIImage Convert the ImageData object to a UIImage object.

 

bytes

The image data content in a byte array.

  • Objective-C
  • Swift
  1. NSData* bytes
    
  2. var bytes: Data? { get set }
    

 

width

The width of the image in pixels.

  • Objective-C
  • Swift
  1. NSInteger width
    
  2. var width: Int { get set }
    

 

height

The height of the image in pixels.

  • Objective-C
  • Swift
  1. NSInteger height
    
  2. var height: Int { get set }
    

 

stride

The stride (or scan width) of the image.

  • Objective-C
  • Swift
  1. NSInteger stride
    
  2. var stride: Int { get set }
    

 

format

The image pixel format used in the image byte array.

  • Objective-C
  • Swift
  1. EnumImagePixelFormat format
    
  2. var format: EnumImagePixelFormat { get set }
    

orientation

The orientation of the image buffer contained in this frame data. The value is the angle that the camera image needs to be rotated clockwise so it shows correctly on the display in its natural orientation. It is 0, 90, 180, or 270. A typical value for this is 90 as most camera modules record the frames in landscape right orientation. Rotating a landscape right frame by 90 degrees will show it correctly on the display in portrait orientation (which is the natural device orientation of most phones).

  • Objective-C
  • Swift
  1. NSInteger orientation
    
  2. var orientation: Int { get set }
    

toUIImage

Convert the ImageData object to a UIImage object.

  • Objective-C
  • Swift
  1. - (UIImage * _Nullable)toUIImage:(NSError *_Nullable *_Nullable)error;
    
  2. func toUIImage() throws -> UIImage
    

Return Value

A UIImage object.

  • Objective-C
  • Swift
  1. NSError* error;
    [imageData toUIImage:error];
    
  2. do{
       try imageData.toUIImage()
    }catch{
       // Add your code to deal with the exceptions.
    }
    

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version
  • Version 2.x
    • Version 2.2.10
    • Version 2.0.20
    • Version 2.0.10
    • Version 2.0.10
  • Version 1.x
    • Version 1.0.30
    • Version 1.0.21
    • Version 1.0.20
    • Version 1.0.12
    • Version 1.0.11
    • Version 1.0.10
    • Version 1.0.0
    • Version 1.0.30
    • Version 1.0.21
    • Version 1.0.20
    • Version 1.0.12
    • Version 1.0.11
    • Version 1.0.10
    • Version 1.0.0
    • Version 1.0.5
    • Version 1.0.4
    • Version 1.0.3
    • Version 1.0.2
    • Version 1.0.1
    • Version 1.0.0
Change +
© 2003–2024 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support