WTImageTarget Class Reference

Inherits from WTTarget : NSObject
Conforms to NSCopying
Declared in WTImageTarget.h

Overview

WTImageTarget represents image targets that are found by an image tracker.

This class should not be instantiated from outside of the Wikitude Native SDK.

  delegate

The object that acts as a delegate for the WTImageTarget

@property (nonatomic, weak) id<WTImageTargetDelegate> delegate

Discussion

The object that acts as a delegate for the WTImageTarget

Declared In

WTImageTarget.h

  name

The name of the associated target image in the wikitude target collection (.wtc).

@property (nonatomic, strong, readonly) NSString *name

Return Value

name The name of the image target

Discussion

The name of the associated target image in the wikitude target collection (.wtc).

Declared In

WTImageTarget.h

  uniqueId

The unique id of the ImageTarget. This unique id is incremented with every recognition of the same target.

@property (nonatomic, assign, readonly) long uniqueId

Return Value

uniqueId The unique id of the image target

Discussion

The unique id of the ImageTarget. This unique id is incremented with every recognition of the same target.

Declared In

WTImageTarget.h

  xScale

Defines a normalized scale value in x direction that represents the image dimensions proportionally to the uniform scaling given through the modelView matrix

@property (nonatomic, assign, readonly) CGFloat xScale

Return Value

xScale normalized scale in x direction

Discussion

Defines a normalized scale value in x direction that represents the image dimensions proportionally to the uniform scaling given through the modelView matrix

Declared In

WTImageTarget.h

  yScale

Defines a normalized scale value in y direction that represents the image dimensions proportionally to the uniform scaling given through the modelView matrix

@property (nonatomic, assign, readonly) CGFloat yScale

Return Value

xScale normalized scale in y direction

Discussion

Defines a normalized scale value in y direction that represents the image dimensions proportionally to the uniform scaling given through the modelView matrix

Declared In

WTImageTarget.h

  physicalTargetHeight

The physical height of the image target as it is defined in the .wtc or through the WTImageTrackerConfiguration property physicalTargetImageHeights

@property (nonatomic, assign, readonly) NSInteger physicalTargetHeight

Return Value

physicalTargetHeight the physical target height in millimeter

Discussion

The physical height of the image target as it is defined in the .wtc or through the WTImageTrackerConfiguration property physicalTargetImageHeights

Declared In

WTImageTarget.h

  distanceToTarget

The distance from the camera to the image target in millimeter.

This value only contains reliable values if the .wtc file or the cloud archive included physical image target heights.

@property (nonatomic, assign, readonly) NSInteger distanceToTarget

Return Value

distanceToTarget The physical distance in millimeter between the camera and the image target.

Declared In

WTImageTarget.h

– distanceTo:

Use this method to calculate the physical distance between two image targets

The distance is calculated every time the method is called. In case the distance could not be calculated (imageTarget is nil), 0 is returned.

- (NSInteger)distanceTo:(WTImageTarget *)imageTarget

Parameters

imageTarget

The image target to which the distance should be calculated to

Return Value

The physical distance in millimeter between this target and imageTarget

Declared In

WTImageTarget.h

– targetAreaInCameraFrame

The target area at the camera’s original frame.

- (CGRect)targetAreaInCameraFrame

Return Value

targetArea The area of the target in the camera’s original frame

Declared In

WTImageTarget.h

– targetAreaInScreenSpaceWithCameraFrameSize:surfaceSize:angle:

The target area at the camera’s original frame.

This value only contains reliable values if the .wtc file or the cloud archive included physical image target heights.

- (CGRect)targetAreaInScreenSpaceWithCameraFrameSize:(CGSize)cameraFrameSize surfaceSize:(CGSize)surfaceSize angle:(CGFloat)angle

Parameters

cameraFrameSize

The resolution (in pixel) with which the camera is actually running (SD, HD, Full HD)

surfaceSize

The resolution (in pixel) of the current OpenGL or Metal render view

angle

The cameraToSurfaceAngle that describes the device rotation (landscape left, right, portrait, portrait upside down)

Return Value

targetArea The area of the target in the camera’s original frame

Declared In

WTImageTarget.h