Foreword by Philip Schneider
PrefaceOur Objective
Outline
Source Code
Header Files
Conventions and Assumptions
Quartz Technologies
Acknowledgements
Chapter 1 Introducing Quartz 2DA Bit of History
Quartz 2D Overview
What Software Can Use Quartz 2D?
Summary
See Also
Chapter 2 Quartz 2D Drawing BasicsQuartz Graphics Contexts
Filling a Rectangle
Stroking a Rectangle
The Order of Fill and Stroke Operations
Transforming the Coordinate System
Constructing Quartz Paths
Painting with Alpha
Making Dashed Lines
Clipping a Drawing
Drawing PDF Content
More About Graphics Contexts
Summary
See Also
Chapter 3 Using Quartz 2D in CocoaXcode Overview
Creating a Cocoa Xcode Project in Tiger
Creating a View in Interface Builder
Connecting the Interface to the Code
Obtaining a Graphics Context in Cocoa
Writing the Drawing Code
Examining the Drawing Output
Cocoa Framework Drawing and Quartz
Summary
See Also
Chapter 4 Using Quartz 2D in CarbonCreating a Carbon Xcode Project
Setting Up a Carbon Window
Creating an Event Handler
Examining the Drawing Output
Using QDBeginCGContext
Summary
See Also
Chapter 5 The Quartz Coordinate System and Coordinate TransformationsUser Space and Device Space
Coordinate Transformations
The Current Transformation Matrix
The Mathematics of Affine Transforms
Saving and Restoring a Coordinate System
Affine Transform Convenience Functions
Summary
See Also
Chapter 6 Drawing with PathsProperties of Paths
- Path Construction Primitives
- Cubic Bézier Curves
- Quadratic Bézier Curves
Closing Subpaths
Path Construction Convenience Functions
- Additional Path Convenience Functions (Tiger)
Stroking Paths
- Line Width
- Line Joins
- Line Caps
- Line Dash
Filling Paths
Clipping With Paths
CGPath Objects (Jaguar and later only)
Anti-aliasing
Path Utility Functions
- Aligning User Space Coordinates on Pixel Boundaries
Summary
See Also
Chapter 7 Color, Alpha Transparency, and the Quartz Graphics StateColor and Color Spaces
- A General Approach to Setting Color
- Calibrated Color Spaces
- Device Color Spaces
- Special Color Spaces
- Creating Color Spaces by Name
- Rendering Intents
Alpha Transparency
CGColorRef Objects (Panther and later)
Graphics State Parameters
Summary
See Also
Chapter 8 Data Providers and Data ConsumersData Providers
- CGDataProviderCreateWithURL
- CGDataProviderCreateWithData
- CGDataProviderCreate
- CGDataProviderCreateDirectAccess
- CGDataProviderCreateWithCFData (Tiger and later)
Guidelines for Using Data Providers
Data Consumers
Summary
Chapter 9 Drawing ImagesCreating CGImage Objects
- Specialized Functions for JPEG and PNG
- Drawing Images into a Flipped Coordinate System
- A General Function for Uncompressed Data
- Generalized Functions for Compressed Image Data (Tiger and later)
- Importing Image Data With QuickTime
- Guidelines for Image Creation
Best Practices for Working With Images
Image Utility Functions
- Getting Image Dimensions
- Getting the Pixel Format
- Creating an Image from a Bitmap Context
- Working With Color Spaces
- Creating Subimages
Writing Image Data using CGImageDestination (Tiger)
Exporting to JPEG Using a QuickTime Exporter
Summary
See Also
Chapter 10 Image MaskingCreating an Image Mask
- Drawing and Inverting a 1-Bit Image Mask
- Drawing an 8-Bit Deep Mask
Masking an Image (Tiger)
- Masking an Image with an Image Mask
- Masking an Image with an Image
- Masking Guidelines
Using Color as a Mask (Tiger)
Clipping to a Mask (Tiger)
Summary
See Also
Chapter 11 TextText Drawing Parameters
- Font and Font Size
- Text Matrix and Text Position
- Text Drawing Modes
- Font Smoothing (Jaguar)
- Character Spacing
Drawing Text Using Quartz
- Drawing with Characters
- Drawing with Glyphs
Drawing Text Using Cocoa
- Using NSString
- Using NSLayoutManager
- Subclassing to Get Additional Control
Drawing Text Using Carbon
- Using HIThemeDrawTextBox (Panther)
- Using Multilingual Text Engine
- Using Apple Type Services for Unicode Imaging
Drawing Text in a Flipped Coordinate System
Summary
See Also
Chapter 12 Creating BitsBitmap Graphics Context
- Supported Pixel Formats
- Creating a Bitmap Graphics Context
- Getting Information About a Bitmap Context
- Using the Bitmap Data from a Bitmap Context
CGLayers (Tiger)
- Creating a CGLayer Object
- Drawing to a CGLayer
- Drawing the Contents of a CGLayer
- Using a CGLayer to Draw a Checkerboard
Caching Drawing Offscreen
- Drawing Repeatedly Without Caching
- Drawing Repeatedly With Bitmap Context Caching
- Drawing Repeatedly With CGLayer Caching
- Display Profile Issues
Replacing CopyBits
Summary
See Also
Chapter 13 Opening and Drawing PDF DocumentsPDF Document Properties
Opening a PDF Document
Using PDF as a Graphical Interchange
- Creating PDF Data From the Pasteboard: Cocoa
- Creating PDF from the Pasteboard: Carbon
Drawing PDF Pages
- Drawing With CGContextDrawPDFDocument
- Drawing PDF Documents in a Flipped Coordinate System
- Using CGPDFPage Objects (Panther)
- Drawing with PDF Rotation on Jaguar and Earlier
Handling Protected PDF Documents (Jaguar)
PDF Document Utility Functions
Summary
See Also
Chapter 14 Creating and Examining PDF DocumentsCreating New PDF Documents
- Using CGPDFContextCreateWithURL
- Using the Auxiliary Information Dictionary
Copying PDF Content to the Pasteboard
Adding Content to Existing PDF Documents
Adding Links to PDF Documents (Tiger)
- Creating a Link to a URL
- Creating a Link to Another Page in the Document
Creating Encrypted PDF Output (Tiger)
PDF Document Generation Issues
Examining PDF Document Content (Panther, Tiger)
- Quartz PDF Introspection
- Scanning the PDF Content Stream (Tiger)
Summary
See Also
Chapter 15 Advanced Drawing FeaturesDrawing with Patterns
- Creating Patterns
- Creating and Drawing Colored Patterns
- Base Space, the Pattern Matrix, and Transforming Patterns
- Pattern Phase
- Creating and Drawing Stencil Patterns
- Drawing Complex Patterns
- Pattern Issues
Drawing with Shadows (Panther)
- Shadow Attributes
- Creating and Drawing With Shadows
- Shadow Offset and Quartz Base Space
- Shadows and Grouped Objects
- Shadows and PDF Documents
Drawing with Transparency Layers (Panther)
- Using Transparency Layers
- Alpha Compositing and Transparency Layers
- Transparency Layers and PDF Documents
- Transparency Layers Compared to CGLayers
Drawing With Shadings (Jaguar)
- Shading Concepts and the CGFunction
- Axial Shadings
- Radial Shadings
- Radial Shading Geometries
- Transforming Shadings
Summary
See Also
Chapter 16 Supporting PostScript and EPS DataOverview of the Conversion Process
Quartz Conversion Functions and Callbacks (Panther)
Creating a PDF Data File From PostScript Data
Using Converted PostScript Data in Your Application
PSConverter Advanced Issues
Printing Source EPS Data
Guidelines for Supporting EPS Data in Your Application
Summary
See Also
Chapter 17 Performance and DebuggingOptimizing Performance
- The Quartz Compositor
- Quartz Object and Memory Model
- Improving Performance
- Measuring Performance
Debugging Your Drawing
- Examining the Coordinate System
- Checking the Clipping Area
- Drawing a Debugging Rectangle
- Looking for Console Messages
- Checking for Data Provider Integrity
- Checking for Immutability Violations
- Checking for Improperly Initialized Contexts
- Checking for Out-of-Sync Color Setting
- Drawing Images to a PDF Context
- Releasing a CGPDFContext Object
- Checking Pattern Color Space Usage
- Using PDF Generation as a Debugging Aid
Summary
See Also
Chapter 18 Creating Quartz Tools and Python ScriptsPython Scripting with Quartz (Panther)
Creating Bits with Python
Using Quartz in UNIX Tools
The PDF Workflow in Printing (Jaguar)
Summary
See Also
Index