Skip to content

Commit

Permalink
cgpoint, cgsize cast shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
yukiny0811 committed Feb 2, 2024
1 parent 46342e6 commit 6cfe59a
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Sources/SimpleSimdSwift/CastShortcuts.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// File.swift
//
//
// Created by Yuki Kuwashima on 2024/02/02.
//

import simd
import CoreGraphics

public extension CGPoint {
var f2Value: f2 {
f2(Float(self.x), Float(self.y))
}
}

public extension f2 {
var cgPoint: CGPoint {
CGPoint(x: CGFloat(x), y: CGFloat(y))
}
}

public extension CGSize {
var f2Value: f2 {
f2(Float(self.width), Float(self.height))
}
}

public extension f2 {
var cgSize: CGSize {
CGSize(width: CGFloat(x), height: CGFloat(y))
}
}

0 comments on commit 6cfe59a

Please sign in to comment.