您的位置:首页 > 产品设计 > UI/UE

Core Image Programming Guide编程指南-Introduction

2016-10-26 16:36 323 查看
About Core ImageCore Image is an image processing and analysis technology designed to provide near real-time processing for still and video
images. It operates on image data types from the Core Graphics, Core Video, and Image I/O frameworks, using either a GPU or CPU rendering path. Core Image hides the details of low-level graphics processing by providing an easy-to-use application programming
interface (API). You don’t need to know the details of OpenGL, OpenGL ES, or Metal to leverage the power of the GPU, nor do you need to know anything about Grand Central Dispatch (GCD) to get the benefit of multicore processing. Core Image handles the details
for you.Core Image是一种图片处理和分析的技术,被设计用于对静态和视频图片进行实时的处理。Core
Image操作的图片数据类型来自Core Graphics, Core Video, Image I/O 等框架,使用GPU或CPU渲染路径。Core
Image隐藏了底层图形的处理过程并提供了容易使用的应用编程接口。你并不需要知道OpenGL, OpenGL ES的详情,或者金属对CPU的使用能力,也不需要知道任何有关GCD从多核处理中所获得的利益,Core
Image将为你处理所有的细节。Figure I-1 Core
Image in relation to the operating systemAt a Glance
The Core Image framework provides: Core
Image提供了如下内容:Access to built-in image processing filters 使用内嵌的图像处理滤镜
Feature detection capability 具有可检测的能力特性
Support for automatic image enhancement 支持自动图像增强
The ability to chain multiple filters together to create custom effects 可以链式组合多种滤镜效果来创建自定义效果
Support for creating custom filters that run on a GPU 支持创建自定义滤镜并运行在GPU上
Feedback-based image processing capabilities 基于图像处理能力的反馈On macOS, Core Image also provides a means for packaging custom filters for use by other apps. 在macOS上,Core
Image也提供了相应的手段打包自定义滤镜,并在其他APP中使用。Core Image is Efficient and Easy to Use for Processing and Analyzing ImagesCore Image provides hundreds of built-in filters. You set up filters by supplying key-value pairs for a filter’s input parameters.
The output of one filter can be the input of another, making it possible to chain numerous filters together to create amazing effects. If you create a compound effect that you want to use again, you can subclass CIFilter to capture the effect “recipe.”
Core Image提供了上百个内嵌的滤镜。通过使用键值对为filter提供输入参数来创建filter。一个滤镜的输出能够作为其它滤镜的输入,这样组合使用多个filter来创建惊人的效果。如果你创建了一个复合效果并且想再次使用,你可以子类化CIFilter来捕获“秘诀”效果。There are more than a dozen categories of filters. Some are designed to achieve artistic results, such as the stylize and halftone
filter categories. Others are optimal for fixing image problems, such as color adjustment and sharpen filters.
这里有十多个filters的分类。有些设计用于实现艺术结果,比如stylize和
halftone滤镜分类。另外一些是最理想的处理图片问题,比如color adjustment和sharpen滤镜。Core Image can analyze the quality of an image and provide a set of filters with optimal settings for adjusting such things
as hue, contrast, and tone color, and for correcting for flash artifacts such as red eye. It does all this with one method call on your part.
Core Image能够分析图片的质量并且提供一套最优化的滤镜设置来进行调节,比如色彩,对比,声响颜色,解决快闪伪像比如红眼。所有的这些都只需要使用一个方法进行调用即可。Core Image can detect human face features in still images and track them over time in video images. Knowing where faces are
can help you determine where to place a vignette or apply other special filters.
Core Image能够在静态图中检测人脸,并且可以在视频图像中进行跟踪。能够帮助你确定哪个地方需要放置装饰或者使用其它特殊滤镜。Relevant chapters: Processing
Images, Detecting
Faces in an Image, Auto
Enhancing Images, Subclassing
CIFilter: Recipes for Custom EffectsNextQuery Core Image to Get a List of Filters and Their AttributesCore Image has “built-in” reference documentation for its filters. You can query the system to find out which filters are available. Then, for each filter, you can retrieve a dictionary that contains its attributes, such as
its input parameters, defaults parameter values, minimum and maximum values, display name, and more.
Core Image为filters内嵌了引用文档,你能够查寻系统来找到哪一个filters是可以获取的。这时,对于每一个filters,你能够获取一个字典并且包含它所有的属性,比如它的输入参数,默认参数值,最小和最大值,显示名称等。Relevant chapter: Querying
the System for FiltersCore Image Can Achieve Real-Time Video Performance
If your app needs to process video in real-time, there are several things you can do to optimize performance.
如果你的APP需要实时处理video,这里有一些能够优化性能的事情可以处理。Relevant
chapter: Getting
the Best PerformanceUse an Image Accumulator to Support Feedback-Based Processing
The
CIImageAccumulator
class is designed
for efficient feedback-based image processing, which you might find useful if your app needs to image dynamical systems.
CIImageAccumulator类是被设计用于高效的图片处理反馈,如果你的APP需要image动态系统,这里可以找到有用的信息。

Relevant chapter:  Using
Feedback to Process ImagesQCreate and Distribute Custom Kernels and Filters
If none of the built-in filters suits your needs, even when chained together, consider creating a custom filter. You’ll need
to understand kernels—programs that operate at the pixel level—because they are at the heart of every filter.In macOS, you can package one or more custom filter as an image unit so that other apps can load and use them.
如果内嵌的 filters并不能够满足需求,甚至组合多种滤镜也不能够满足需求,那么可以考虑自定义 filter。你将需要理解核心程序,操作像素级别的程序,因为它们是每一个 filter的核心。
在macOS中,你能够打包一个或多个自定义filter最为图片单元以至于其它APP能够加载和使用它们。Relevant chapters: What
You Need to Know Before Writing a Custom Filter, Creating
Custom Filters, Packaging
and Loading Image UnitsSee Also
Other important documentation for Core Image includes: Core Image中其它重要的文档:Core
Image Reference Collection provides a detailed description of the classes available in the Core Image framework.
Core
Image Reference Collection 提供了在Core Image框架中可获取类的详细描述Core
Image Filter Reference describes the built-in image processing filters that Apple provides, and shows how images appear before and after processing
with a filter.
Core
Image Filter Reference 描述了Apple提供的内嵌图片处理滤镜,显示了怎样呈现被滤镜处理之前和处理之后的图片。Core
Image Kernel Language Reference describes the language for creating kernel routines for custom filters.
Core
Image Kernel Language Reference 描述了为自定义滤镜中创建核心程序的语言
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: