Quartz 2D 编程指南0:简介

Instroduction

Core Graphics,also known as Quartz 2D, is an advanced, two-dimensional drawing engine available for iOS,tvOS, and macOS application development.Quartz 2D provides low-level,lightweight 2D rendering with unmached output fidelity regardless of display or printing device.Quartz 2D is resolution- and device-independent.

核心绘画也被称作Quartz 2D,是先进的二维绘画引擎,适用于iOS,tvOS,macOS应用程序开发。Quartz 2D提供低级别,轻量级的2D渲染与无与伦比的输出保真度无论显示或打印设备。Quartz 2D与分辨率和设备无关。(也就是说,不用关心设备的大小,设备的分辨率,只要利用Quartz 2D,这些设备相关的会自动处理。)

The Quartz 2D API is easy to use and provides access to powerful features such as transparency layers, path-based drawing, offset rendering, advanced color management, anti-aliased rendering, and PDF document creation, display, and parsing.

Quartz 2D接口很容易使用,它提供了强大的功能,例如图层透明,基于路径的绘制,高级颜色管理,反锯齿,PDF文档创建,显示和解析。

Who Should Read This Document?

This document is intended for developers who need to perform any of the following tasks:

  • Draw Graphics
  • Provide graphic editing capabilities in an application
  • Create or display bitmap images
  • Work with PDF documents

谁应该阅读本文档?

  • 绘制图形
  • 在应用程序中提供图形编辑功能
  • 创建或显示位图图像
  • 使用PDF文档

Organization of This Document

This document is organized into the following chapters:

  • Overview of Quartz 2D describes the page, drawing destinations, Quartz opaque data types, graphics states, coordinates, and memory management, and it takes a look at how Quartz works “under the hood.”

  • Graphics Contexts describes the kinds of drawing destinations and provides step-by-step instructions for creating all flavors of graphics contexts.

  • Paths discusses the basic elements that make up paths, shows how to create and paint them, shows how to set up a clipping area, and explains how blend modes affect painting.

  • Color and Color Spaces discusses color values and using alpha values for transparency, and it describes how to create a color space, set colors, create color objects, and set rendering intent.

  • Transforms describes the current transformation matrix and explains how to modify it, shows how to set up affine transforms, shows how to convert between user and device space, and provides background information on the mathematical operations that Quartz performs.

  • Patterns defines what a pattern and its parts are, tells how Quartz renders them, and shows how to create colored and stenciled patterns.

  • Shadows describes what shadows are, explains how they work, and shows how to paint with them.

  • Gradients discusses axial and radial gradients and shows how to create and use CGShading and CGGradient objects.

  • Transparency Layers gives examples of what transparency layers look like, discusses how they work, and provides step-by-step instructions for implementing them.

  • Data Management in Quartz 2D discusses how to move data into and out of Quartz.

  • Bitmap Images and Image Masks describes what makes up a bitmap image definition and shows how to use a bitmap image as a Quartz drawing primitive. It also describes masking techniques you can use on images and shows the various effects you can achieve by using blend modes when drawing images.

  • Core Graphics Layer Drawing describes how to create and use drawing layers to achieve high-performance patterned drawing or to draw offscreen.

  • PDF Document Creation, Viewing, and Transforming shows how to open and view PDF documents, apply transforms to them, create a PDF file, access PDF metadata, add links, and add security features (such as password protection).

  • PDF Document Parsing describes how to use CGPDFScanner and CGPDFContentStream objects to parse and inspect PDF documents.

  • PostScript Conversion gives an overview of the functions you can use in Mac OS X to convert a PostScript file to a PDF document. These functions are not available in iOS.

  • Text describes Quartz 2D low-level support for text and glyphs, and alternatives that provide higher-level and Unicode text support. It also discusses how to copy font variations.

  • Glossary defines the terms used in this guide.

  • Quartz 2D概述描述了页面,绘图目标,Quartz不透明数据类型,图形状态,坐标和内存管理,并且介绍了Quartz如何在“引擎盖”下工作。

  • 图形上下文描述了绘图目的地的种类,并提供了创建各种图形上下文的分步说明。

  • 路径讨论组成路径的基本元素,显示如何创建和绘制它们,显示如何设置裁剪区域,以及解释混合模式如何影响绘画。

  • 颜色和颜色空间讨论颜色值和使用Alpha值进行透明度,并叙述如何创建颜色空间,设置颜色,创建颜色对象和设置渲染意图。

  • 变换描述当前的变换矩阵,并讲述如何修改它,如何设置仿射变换,如何在用户和设备空间之间进行转换,并提供有关Quartz执行的数学运算的背景信息。

  • 模式定义了一个模式及其部分,说明了Quartz如何呈现它们,并展示了如何创建彩色和模板样式。

  • 阴影描述了什么阴影,解释它们的工作原理,并展示如何用它们来绘制。

  • 渐变讨论轴向和径向渐变,并显示如何创建和使用CGShading和CGGradient对象。

  • 透明度层展示了透明层的外观,讨论了它们的工作原理,并提供了实现它们的分步说明。

  • Quartz 2D中的数据管理讨论了如何将数据移入和移出Quartz。

  • 位图图像和图像遮罩描述了构成位图图像定义的内容,并展示了如何使用位图图像作为Quartz绘图图元。它还描述了可以使用在图像上的遮罩技术,并显示了在绘制图像时使用混合模式而实现的各种效果。

  • 核心图形图层描述了如何创建和使用绘图图层来实现高性能图案绘图或离屏渲染。

  • PDF文档创建,查看和转换显示如何打开和查看PDF文档,对其进行转换,创建PDF文件,访问PDF元数据,添加链接以及添加安全功能(如密码保护)。

  • PDF文档解析描述如何使用CGPDFScanner和CGPDFContentStream对象来分析和检查PDF文档。

  • PostScript转换概述了Mac OS X中可用于将PostScript文件转换为PDF文档的功能。这些功能在iOS中不可用。

  • 文本描述Quartz 2D对文本和字形的低级支持,以及提供更高级别和Unicode文本支持的替代方案。它还讨论如何复制字体变体。

  • 词汇表定义本指南中使用的术语。

See Also
These items are essential reading for anyone using Quartz 2D:
Core Graphics Framework Reference] provides a complete reference for the Quartz 2D application programming interface.
Color Management Overview is a brief introduction to the principles of color perception, color spaces, and color management systems.
Mailing lists. Join the quartz-dev mailing list to discuss problems using Quartz 2D.

也可以看看
这些项目是使用Quartz 2D的人员必不可少的阅读材料:
Core Graphics Framework Reference为Quartz 2D应用程序编程接口提供了完整的参考指南。
颜色管理概述是对颜色感知,颜色空间和颜色管理系统原理的简要介绍。
邮寄名单 加入 quartz-dev邮件列表来讨论使用Quartz 2D的问题。

你可能感兴趣的:(Quartz 2D 编程指南0:简介)