Mac Image Data Type == # NSImage ## Desc A high-level interface for manipulating image data. ## Support SDK: macOS 10.0+ Framework: AppKit ## 原文寫的支援功能 - Loading images **stored** on disk or at a specified URL. - Producing versions of the image in a **different format**. - **Drawing** images into a **view** or **graphics context**. - **Creating new** images based on a series of captured **drawing commands**. - Providing the contents of a **CALayer** object. ## 能做的 API - load/save - 支援不同的圖片格式 - 問能否從剪貼簿載入圖片 - 列出能支援的圖片格式列表 (user or unfiltered) - 從 resource 載入圖片 - 從 資料 載入圖片 - 載入空白圖片 - 產生序列化的 NSData(TIFF格式) - tiffRepresentation - draw - 支援 Drawing Commands - draw(NSRect) - draw(NSPoint, NSRect, operation, fraction) - draw()... - LockFocus()/UnlockFocus() - 根據 Rect 與 Graphic Context,產生一個 CGImage - represent - Cache 機制 - 圖片顯示外觀 (NSImageRep) - HitTest - misc - 一些 delegate - NSImageDelegate - Draw Command 有無成功畫上? - 圖片載入時的前後時機與訊息 # CGImage A bitmap image or image mask. ## Support SDKs: iOS2.0+, macOS 10.0+, tvOS9.0+, watchOS2.0+ Framework: Core Graphices ## API - 載入 - 從 一般 data provider 載入 - 從 jpeg data provider 載入 - 從 png data provider 載入 - 載入成為一個 mask - 屬性檢驗: width/height/pixels/colorspace/alpha/... - clone 或產生到另一個 CGImage - copy() - cropping() - masking() - copy(masking) --- # UIImage An object that manages image data in your app. ## Support SDK: iOS2.0+/tvOS9.0+/watchOS2.0+. No macOS Framework: UIKit --- # CIImage A representation of an image to be processed or produced by Core Image filters. ## Support SDKs: iOS 5.0+, macOS 10.4+ ## Overview CIImage 拿來跟 CIFilter, CIContext, CIVector, 與 CIColor 做 Image Processing。 ## Multi-Threaded CIImage 與 CIContext 是不可修改的,可以安全地在多個 thread 共享。 CIFilter 是可修改的,應該在每個 thread 擁有自己的實體。不要在多個 thread 間共享,否則會有 UB (Undefined Behavior)。 ## 類似 auto-render 的行為 Core Image 能分析當前資料有無不足的部份,會自動再補足一系列該加的 CIFilter去修正。 ## API - 載入 - 從設定單一顏色背景產生空白圖片 - 從 raw buffer 產生 bitmap - 從 CGImage 產生 - 從 BitmapImageRep 產生 - 從 UIImage 產生 - 從 URL 載入檔案 產生 - 從 cvImageBuffer 產生 (CoreVideo) - 從 cvPixelBuffer 產生 (CoreVideo) - 從 實作 CIImageProvider protocol 的 data provider 產生 - 從 IOSurface 產生 (hardware framebuffer) - 從 CGImageSource 產生空白圖片 - 修改並生成新 CIImage - 指定一個 filter 名字 - 給一個矩陣 - Cropped 一個範圍 - 指定一個 exif 方向作旋轉 - 向邊緣外擴展 - 與另一個 CIImage 組合(composite) - matching color space - alpha 操作 - gaussianBlur - Draw - 指定範圍與 draw command (NSCompositingOperation) - 底層 buffer getter - 可能是 CGImage - 可能是 CVPixelBuffer - NSBitmapImageRep - NSImageRep - NSCIImageRep
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up