One Logo Pool Ball
Vision · IOS API REFERENCE

NormalizedPoint

struct · iOS 18.0+ · SDK 27.1

struct NormalizedPoint

A 2D point with x and y coordinates in the range [0, 1].

Members (12)

init · iOS 18.0+

init

TypeScript
static initNormalizedPoint(normalizedPoint: { x: number; y: number }): NormalizedPoint
Swift declaration
init(normalizedPoint: CGPoint)

Creates a point object from the specified Core Graphics point.

get · iOS 18.0+

cgPoint

TypeScript
get cgPoint(): { x: number; y: number }
Swift declaration
let cgPoint: CGPoint

The Core Graphics point for this point.

init · iOS 18.0+

init

TypeScript
static initImagePointInNormalizedTo(imagePoint: { x: number; y: number }, imageSize: { width: number; height: number }, regionOfInterest: NormalizedRect): NormalizedPoint
Swift declaration
init(imagePoint: CGPoint, in imageSize: CGSize, normalizedTo regionOfInterest: NormalizedRect)

Creates a point normalized to a region of interest within an image. - Parameters: - imagePoint: A point in the image coordinate space. - imageSize: The size of the image. - regionOfInterest: The region within the image that the point will be normalized to

init · iOS 18.0+

init

TypeScript
static initImagePointIn(imagePoint: { x: number; y: number }, imageSize: { width: number; height: number }): NormalizedPoint
Swift declaration
init(imagePoint: CGPoint, in imageSize: CGSize)

Creates a normalized point from a point in an image coordinate space. - Parameters: - imagePoint: A point in the image coordinate space. - imageSize: The size of the image.

get · iOS 18.0+

description

TypeScript
get description(): string
Swift declaration
var description: String { get }

A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.

method · iOS 18.0+

verticallyFlipped

TypeScript
verticallyFlipped(): NormalizedPoint
Swift declaration
func verticallyFlipped() -> NormalizedPoint

Returns a `NormalizedPoint` with the origin flipped between the top and bottom of the image.

method · iOS 18.0+

toImageCoordinates

TypeScript
toImageCoordinatesFromImageSizeOrigin(regionOfInterest: NormalizedRect, imageSize: { width: number; height: number }, origin?: CoordinateOrigin): { x: number; y: number }
Swift declaration
func toImageCoordinates(from regionOfInterest: NormalizedRect, imageSize: CGSize, origin: CoordinateOrigin = .lowerLeft) -> CGPoint

Converts a point normalized to a region within an image into full image coordinates. - Parameters: - imageSize: The size of the image. - regionOfInterest: The region within an image the `NormalizedPoint` is normalized to.

method · iOS 18.0+

toImageCoordinates

TypeScript
toImageCoordinatesOrigin(imageSize: { width: number; height: number }, origin?: CoordinateOrigin): { x: number; y: number }
Swift declaration
func toImageCoordinates(_ imageSize: CGSize, origin: CoordinateOrigin = .lowerLeft) -> CGPoint

Converts a point in normalized coordinates into image coordinates. - Parameters: - imageSize: The size of the image.

get · iOS 18.0+

x

TypeScript
get x(): number
Swift declaration
var x: CGFloat { get }

The x-coordinate.

init · iOS 18.0+

init

TypeScript
static initXY(x: number, y: number): NormalizedPoint
Swift declaration
init(x: CGFloat, y: CGFloat)

Creates a point object with the specified coordinates. - Parameters: - x: The x-coordinate value. - y: The y-coordinate value.

get · iOS 18.0+

y

TypeScript
get y(): number
Swift declaration
var y: CGFloat { get }

The y-coordinate.

get · iOS 18.0+

zero

TypeScript
static get zero(): NormalizedPoint
Swift declaration
static var zero: NormalizedPoint { get }

A point object that represents the origin, [0,0].

Skipped declarations

No declarations were skipped in this snapshot.

All Vision types →