|
5 | 5 | * Review Manager: TBD
|
6 | 6 | * Status: **Awaiting review**
|
7 | 7 | * Implementation: [swiftlang/swift-testing#1245](https://github.com/swiftlang/swift-testing/pull/1245), [swiftlang/swift-testing#1254](https://github.com/swiftlang/swift-testing/pull/1254), _et al_.
|
8 |
| -* Review: ([pitch](https://forums.swift.org/...)) |
| 8 | +* Review: ([pitch](https://forums.swift.org/t/pitch-image-attachments-in-swift-testing-windows/81871)) |
9 | 9 |
|
10 | 10 | ## Introduction
|
11 | 11 |
|
@@ -233,28 +233,31 @@ Conveniences over those COM classes' `CLSID` values are provided:
|
233 | 233 |
|
234 | 234 | ```swift
|
235 | 235 | extension AttachableImageFormat {
|
236 |
| - /// The `CLSID` value corresponding to the WIC image encoder for this image |
237 |
| - /// format. |
238 |
| - public var clsid: CLSID { get } |
| 236 | + /// The `CLSID` value of the Windows Imaging Component (WIC) encoder class |
| 237 | + /// that corresponds to this image format. |
| 238 | + /// |
| 239 | + /// For example, if this image format equals ``png``, the value of this |
| 240 | + /// property equals [`CLSID_WICPngEncoder`](https://learn.microsoft.com/en-us/windows/win32/wic/-wic-guids-clsids#wic-guids-and-clsids). |
| 241 | + public var encoderCLSID: CLSID { get } |
239 | 242 |
|
240 |
| - /// Construct an instance of this type with the given `CLSID` value and |
241 |
| - /// encoding quality. |
| 243 | + /// Construct an instance of this type with the `CLSID` value of a Windows |
| 244 | + /// Imaging Component (WIC) encoder class and the desired encoding quality. |
242 | 245 | ///
|
243 | 246 | /// - Parameters:
|
244 |
| - /// - clsid: The `CLSID` value corresponding to a WIC image encoder to use |
245 |
| - /// when encoding images. |
| 247 | + /// - encoderCLSID: The `CLSID` value of the Windows Imaging Component |
| 248 | + /// encoder class to use when encoding images. |
246 | 249 | /// - encodingQuality: The encoding quality to use when encoding images. For
|
247 | 250 | /// the lowest supported quality, pass `0.0`. For the highest supported
|
248 | 251 | /// quality, pass `1.0`.
|
249 | 252 | ///
|
250 | 253 | /// If the target image encoder does not support variable-quality encoding,
|
251 | 254 | /// the value of the `encodingQuality` argument is ignored.
|
252 | 255 | ///
|
253 |
| - /// If `clsid` does not represent an image encoder type supported by WIC, the |
254 |
| - /// result is undefined. For a list of image encoders supported by WIC, see |
255 |
| - /// the documentation for the [`IWICBitmapEncoder`](https://learn.microsoft.com/en-us/windows/win32/api/wincodec/nn-wincodec-iwicbitmapencoder) |
| 256 | + /// If `clsid` does not represent an image encoder class supported by WIC, the |
| 257 | + /// result is undefined. For a list of image encoder classes supported by WIC, |
| 258 | + /// see the documentation for the [`IWICBitmapEncoder`](https://learn.microsoft.com/en-us/windows/win32/api/wincodec/nn-wincodec-iwicbitmapencoder) |
256 | 259 | /// class.
|
257 |
| - public init(_ clsid: CLSID, encodingQuality: Float = 1.0) |
| 260 | + public init(encoderCLSID: CLSID, encodingQuality: Float = 1.0) |
258 | 261 | }
|
259 | 262 | ```
|
260 | 263 |
|
@@ -337,10 +340,17 @@ None needed.
|
337 | 340 | `var attachableIWICBitmapSource: IWICBitmapSource { get throws }`) as it would
|
338 | 341 | be able to participate in Swift's automatic reference counting.
|
339 | 342 |
|
| 343 | + The Swift team is tracking COM interop with [swiftlang/swift#84056](https://github.com/swiftlang/swift/issues/84056). |
| 344 | + |
340 | 345 | - Adding support for managed (.NET or C#) image types. Support for managed types
|
341 | 346 | on Windows would first require a new Swift/.NET or Swift/C# interop feature
|
342 | 347 | and is therefore beyond the scope of this proposal.
|
343 | 348 |
|
| 349 | +- Adding support for WinRT image types. WinRT is a thin wrapper around COM and |
| 350 | + has C++ and .NET projections, neither of which are readily accessible from |
| 351 | + Swift. It may be possible to add support for WinRT image types if COM interop |
| 352 | + is implemented. |
| 353 | + |
344 | 354 | - Adding support for other platforms. See [ST-0014](https://github.com/swiftlang/swift-evolution/blob/main/proposals/testing/0014-image-attachments-in-swift-testing-apple-platforms.md#future-directions)
|
345 | 355 | for further discussion about supporting additional platforms.
|
346 | 356 |
|
|
0 commit comments