CGImageSource 的一个封装,为处理多图像、位置和 GPS 等提供便利。
NSImage
中加载。一个 CGImage 便利库(“包装的” CGImage),提供修改/绘制图像的能力
我有很多次需要进行某种形式的图像处理。虽然它可以相对简单,但现在我们有 UIImage、NSImage 和 CGImage(更不用说 SwiftUI 的 Image 类型)要处理。
我经常发现自己回到 CGImage
,为图像处理提供跨平台支持,因为所有特定于平台的类都有轻松的方法可以转换到/从 CGImage。
我将许多这些 CGImage
例程整理到这个简单的库中。
如果您一个接一个地执行大量这些功能,它肯定不如在单个上下文中创建所有功能那样高效,但是,对于我的需求,这个库是一种简单而轻松的方式来避免一遍又一遍地重写相同的代码。也意味着错误修复发生在单个位置并全面修复。
MIT License
Copyright (c) 2022 Darren Ford
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.