Adopted Span and MutableSpan for buffers across the library to adapt to Swift 6.4.

This commit is contained in:
2026-09-18 12:06:21 +02:00
parent 89c8d7a04c
commit 4cb0f8f500
18 changed files with 127 additions and 83 deletions
@@ -1,18 +1,14 @@
extension Graphics.Bitmap {
/// The bitmap's dimensions, row stride, and raw pixel/mask storage.
/// The pointers are owned by the bitmap.
public struct Data {
/// The bitmap's dimensions and row stride. Access the pixels themselves
/// with `withPixelData(_:)` and `withMaskData(_:)`.
public struct Data: Sendable {
/// The bitmap's width, in pixels.
public let width: Int
/// The bitmap's height, in pixels.
public let height: Int
/// The stride of one row of pixel data, in bytes.
/// The stride of one row of pixel (and mask) data, in bytes.
public let rowBytes: Int
/// The bitmap's mask data, or `nil` if it has no mask. One bit per
/// pixel; rows are `rowBytes` wide.
public let mask: UnsafeMutablePointer<UInt8>?
/// The bitmap's pixel data. One bit per pixel; rows are `rowBytes`
/// wide.
public let data: UnsafeMutablePointer<UInt8>?
/// Whether the bitmap has a mask.
public let hasMask: Bool
}
}