HERE iOS SDK Developer's Guide

NMAImage

Class Summary

class NMAImage

Derived from: NSObject

Encapsulates an image file.

Include: NMAKit.framework/headers/NMAImage.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAImage

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, assign] CGSize  size

The size of the NMAImage in points

[readable, assign] BOOL  valid

The BOOL indicating whether the NMAImage contains a valid image

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(nullable UIImage *) UIImageRepresentation

Provides a UIImage representation of the NMAImage

-(nonnull) init

Initializes an NMAImage

-(nullable) initWithData:(nonnull NSData *) data

Initializes an NMAImage from raw data; see the class description for supported file types

-(nullable) initWithUIImage:(nonnull UIImage *) image

Initializes an NMAImage from an UIImage.

-(nullable) initWithURL:(nonnull NSString *) url

Initializes an NMAImage from a local image file URL; the path may be absolute or relative to the main bundle

Class Method Summary

Table 3. Class Methods
Class Methods

+(nullable) imageWithData:(nonnull NSData *) data

Constructs an NMAImage from raw data; see the class description for supported file types

+(nullable) imageWithUIImage:(nonnull UIImage *) image

Constructs an NMAImage from an UIImage.

+(nullable) imageWithURL:(nonnull NSString *) url

Constructs an NMAImage from a local image file URL; the path may be absolute or relative to the main bundle

Class Details

Encapsulates an image file.

Notes on NMAImage objects:
  • BMP, SVG, JPEG and PNG data formats are supported
  • SVG Tiny 1.1 is supported
  • BMP data format support is limited to either standard BMP v3 with 24/32 bits per pixel (without compression) or BMP v4/v5 (newer BMP formats) with 24/32 bits per pixel plus bitfields compression and A8R8G8B8 pixel formatting
  • Only basic parsing of the BMP header is done, while gamma correction and color profile information is ignored
Note:

PNG compression may be enabled by default in Xcode; files compressed this way cannot be loaded into an NMAImage through raw data or URL. These files may be first loaded into a UIImage and then used to create an NMAImage.

Public Property Details

[readable, assign] CGSize size

The size of the NMAImage in points.

[readable, assign] BOOL valid

The BOOL indicating whether the NMAImage contains a valid image.

Instance Method Details

-(nullable UIImage *) UIImageRepresentation

Provides a UIImage representation of the NMAImage.

Note:

Will return nil if the image could not be converted.

-(nonnull) init

Initializes an NMAImage.

-(nullable) initWithData:(nonnull NSData *) data

Initializes an NMAImage from raw data; see the class description for supported file types.

-(nullable) initWithUIImage:(nonnull UIImage *) image

Initializes an NMAImage from an UIImage.

When converting a UIImage to an NMAImage, the scale of the original image is compared against the scale of the device. If they are different, the image is resized so that the scale of the final image is the same as the device scale.

For example, if a 100x100 pixel UIImage with a scale of 2x is converted to an NMAImage on a 3x scale device, the NMAImage will have dimensions of 150x150 (and an implicit scale of 3x to match the device).

-(nullable) initWithURL:(nonnull NSString *) url

Initializes an NMAImage from a local image file URL; the path may be absolute or relative to the main bundle.

Class Method Details

+(nullable) imageWithData:(nonnull NSData *) data

Constructs an NMAImage from raw data; see the class description for supported file types.

+(nullable) imageWithUIImage:(nonnull UIImage *) image

Constructs an NMAImage from an UIImage.

When converting a UIImage to an NMAImage, the scale of the original image is compared against the scale of the device. If they are different, the image is resized so that the scale of the final image is the same as the device scale.

For example, if a 100x100 pixel UIImage with a scale of 2x is converted to an NMAImage on a 3x scale device, the NMAImage will have dimensions of 150x150 (and an implicit scale of 3x to match the device).

+(nullable) imageWithURL:(nonnull NSString *) url

Constructs an NMAImage from a local image file URL; the path may be absolute or relative to the main bundle.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.