Skip to content

Commit

Permalink
Make image types to conform to Sendable
Browse files Browse the repository at this point in the history
  • Loading branch information
koher committed Sep 15, 2024
1 parent 58a1ac0 commit 5d4d4a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/SwiftImage/Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public struct Image<Pixel> : ImageProtocol {
}
}

extension Image : Sendable where Pixel : Sendable {}

extension Image { // Initializers for ImageSlice
public init(_ imageSlice: ImageSlice<Pixel>) {
self.init(width: imageSlice.width, height: imageSlice.height, pixels: Array(imageSlice))
Expand Down
2 changes: 2 additions & 0 deletions Sources/SwiftImage/ImageSlice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public struct ImageSlice<Pixel> : ImageProtocol {
}
}

extension ImageSlice : Sendable where Pixel : Sendable {}

extension ImageSlice {
public init(_ image: Image<Pixel>) {
self.init(image: image, xRange: image.xRange, yRange: image.yRange)
Expand Down

0 comments on commit 5d4d4a4

Please sign in to comment.