Skip to content

Commit

Permalink
Merge pull request #2 from yukiny0811/cast-coregraphics
Browse files Browse the repository at this point in the history
cgpoint, cgsize cast shortcuts
  • Loading branch information
yukiny0811 authored Feb 2, 2024
2 parents 7756eac + 6cfe59a commit 4a0b195
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 4a0b195

Please sign in to comment.