init
TypeScriptstatic initNormalizedPoint(normalizedPoint: { x: number; y: number }): NormalizedPointSwift declarationinit(normalizedPoint: CGPoint)Creates a point object from the specified Core Graphics point.
struct · iOS 18.0+ · SDK 27.1
struct NormalizedPointA 2D point with x and y coordinates in the range [0, 1].
static initNormalizedPoint(normalizedPoint: { x: number; y: number }): NormalizedPointSwift declarationinit(normalizedPoint: CGPoint)Creates a point object from the specified Core Graphics point.
get cgPoint(): { x: number; y: number }Swift declarationlet cgPoint: CGPointThe Core Graphics point for this point.
static initImagePointInNormalizedTo(imagePoint: { x: number; y: number }, imageSize: { width: number; height: number }, regionOfInterest: NormalizedRect): NormalizedPointSwift declarationinit(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
static initImagePointIn(imagePoint: { x: number; y: number }, imageSize: { width: number; height: number }): NormalizedPointSwift declarationinit(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 description(): stringSwift declarationvar 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.
verticallyFlipped(): NormalizedPointSwift declarationfunc verticallyFlipped() -> NormalizedPointReturns a `NormalizedPoint` with the origin flipped between the top and bottom of the image.
toImageCoordinatesFromImageSizeOrigin(regionOfInterest: NormalizedRect, imageSize: { width: number; height: number }, origin?: CoordinateOrigin): { x: number; y: number }Swift declarationfunc toImageCoordinates(from regionOfInterest: NormalizedRect, imageSize: CGSize, origin: CoordinateOrigin = .lowerLeft) -> CGPointConverts 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.
toImageCoordinatesOrigin(imageSize: { width: number; height: number }, origin?: CoordinateOrigin): { x: number; y: number }Swift declarationfunc toImageCoordinates(_ imageSize: CGSize, origin: CoordinateOrigin = .lowerLeft) -> CGPointConverts a point in normalized coordinates into image coordinates. - Parameters: - imageSize: The size of the image.
get x(): numberSwift declarationvar x: CGFloat { get }The x-coordinate.
static initXY(x: number, y: number): NormalizedPointSwift declarationinit(x: CGFloat, y: CGFloat)Creates a point object with the specified coordinates. - Parameters: - x: The x-coordinate value. - y: The y-coordinate value.
get y(): numberSwift declarationvar y: CGFloat { get }The y-coordinate.
static get zero(): NormalizedPointSwift declarationstatic var zero: NormalizedPoint { get }A point object that represents the origin, [0,0].
No declarations were skipped in this snapshot.