← Programming QuickDraw 1992

Programming QuickDraw 1992

From the originals

13 scans

Machine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.

These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.

Image 1

SERIES EDITOR Scott Knaster Macintosh Inside Out Programming QuickDraw™ Includes Color QuickDraw™ and 32-bit QuickDraw™ DAVID A. SUROVELL FREDERICK M. HALL KONSTANTIN OTHMER

A book cover with a pale yellow background, a pink circle behind a large black serif letter P, a blue downward-pointing triangle holding the Macintosh Inside Out label, and a red and black QuickDraw title on a gold panel, with a green left edge and gray right edge.

Reading notes: Series editor name is printed as SCOTT KNASTER in capitals; transcribed as shown. Cover title words are stylized and the 'Programming' word is set on a slant, so reading order was taken top to bottom. Trademark symbols (™) and small superscript marks after QuickDraw are rendered as printed but may be imperfectly captured.

Printed product names
Macintosh Inside Out
Languages
English
PDF page 1

e DI Includes Color Quick.Draw'" and 32-bit Quick.Draw'" DAVID A. SU ROVELL . FREDERICK M. HALL KONSTANTIN OTHMER

Reading notes: Supplied copy is fragmentary; no image was provided to verify layout, reading order, or artwork. "e" and "DI" at the start may be OCR noise or partial fragments and are not transcribed as copy. "Includes Color Quick.Draw'" and "32-bit Quick.Draw'" may be product lines, but the headline is uncertain and not set. "DAVID A. SU ROVELL" may be a broken or misspelled name (possibly Sutherland); spelling not verified. "FREDERICK M. HALL" and "KONSTANTIN OTHMER" appear to be names, possibly credits or authors rather than advertised products; not listed as products. Transcript is intentionally empty per instruction because exact extracted text is preserved separately.

Printed product names
Quick.Draw'"
Languages
English
PDF page 2

The image is a entirely blank white page with no visible artwork, layout, or text.

Reading notes: No visible text or graphics appear anywhere on the page, so the transcript is empty.

PDF page 3

Programming QuickDraw™ Includes Color QuickDraw™ and 32-bit QuickDraw™ David A. Surovell, Frederick M. Hall, and Konstantin Othmer .A. ...... Addison-Wesley Publishing Company, Inc. Reading, Massachusetts Menlo Park, California New York Don Mills, Ontario Wokingham, England Amsterdam Bonn Sydney Singapore Tokyo Madrid San Juan Paris Seoul Milan Mexico City Taipei - ------.

Reading notes: Trademark symbols and OCR spacing around author names may be imperfect

Printed product names
QuickDraw™ · Color QuickDraw™ · 32-bit QuickDraw™
Languages
English
PDF page 4

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book and Addison-Wesley was aware of a trademark claim, the designations have been printed in initial capital letters. The authors and publishers have taken care in preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. Library: of Congress Cataloging-in-Publication Data Surovell, David A. Programming QuickDraw : includes color QuickDraw and 32-bit QuickDraw I David A. Surovell, Frederick M. Hall, and Konstantin Othmer. p. an. -- (Macintosh inside out) Includes bibliographical references and index. ISBN 0-201-57019-X (p) : $26.9S 1. Macintosh (Computer)--Programming. 2. Computer jlr&phics. 3. QuickDraw. I. Hall, Frederick M. Il. Othmer, Konstanun. ID. Title. IV. Series. QA76.8.M3S86 1992 006.6' 76--dc20 91-40339 CIP Copyright © 1992 by David A. Surovell, Frederick M. Hall, and Konstantin Othmer All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Published simultaneously in Canada. Sponsoring Editor: Carole McClendon Technical Reviewer: Tim Cotter Project Editor: Joanne Clapp Fullagar Cover Design: Ronn Campisi Set in 10.5-point Palatino by CIP 1 2 3 4 5 6 7 8 9 -MW- 9594939291 First printing, December 1991

Reading notes: Price "$26.9S" likely OCR error for $26.95 Garbled OCR in Library of Congress cataloging block (e.g., "jlr&phics", "Konstanun", "Il.") Page count "p. an." is unclear

Printed product names
Macintosh · QuickDraw · Color QuickDraw · 32-bit QuickDraw
Printed prices
$26.9S
Printed dates
1992 · 91-40339 · December 1991 · 9594939291
Languages
English
PDF page 5

' Dedication This book is dedicated to our parents: Edward and Barbara Surovell Robert and Ann Hall Ekkehard and Sieglinde Othmer

Languages
English
PDF page 6

Contents Foreword by Scott Knaster xiii Acknowledgments xv Introduction xvii 1. Graphics Programming Overview 1 Introduction to Graphics Environments 2 Personal Computer Graphics: A Brief Look Backward 2 Why Is Graphics Programming Difficult? 4 Introduction to Macintosh Graphics Environments 4 What's in the Toolbox? 7 QuickDraw 9 Doing It Yourself: The Path Not Taken 10 Defining a Practical Programming Approach 12 Naming Conventions 14 A Nickel's Worth of Objects 15 Use of Atomic Data Types 20 Important QuickDraw Clients 20 Underneath QuickDraw 21 Summary 22 2. Basic Drawing Technique and Theory 23 Raster Graphics 24 Digital Images 26 Points 26 BitMaps 28 Basic Drawing Operations 29 vii

Reading notes: Source is a table of contents with page numbers rather than advertising copy; no headline or advertised products, prices, or dates identified.

Languages
English
PDF page 7

viii .,... Contents Using Shapes 29 GrafVerbs 30 Pens and PenStates 33 Lines 38 Rectangles 40 Rectangle-Based Shapes 41 Polygons 53 Arcs and Wedges 55 Basic Text 57 Pictures 65 The GrafPort 69 Boundaries and Coordinate Systems 73 Visible Area 75 Clipping 76 Bottleneck Procedures 77 Summary 78 3. Drawing in Color 81 Software Components of Color 82 Graphics Toolbox Organization 82 Multi-Bit Pixels 88 Color Models 89 Indexed Color 89 Direct Color 90 Fixed Color 92 Classic Color 92 Basic Color Theory 93 RGB Color 93 Chromaticity and Primary Colors 94 RGB Color Values 97 Limits of Color Display 99 Color Picker 100 Color Picker Dialog 100 HSV Colorspace 103 CMY Colorspace 104 ColorTables 104

Reading notes: Source appears to be a table of contents; no advertised products, prices, or dates are present.

Languages
English
PDF page 8

Graphic Devices 106 Using the Graphics Device Manager 107 Color Mapping 113 Color Gra£Ports 122 Pen Colors 124 Transfer Modes 127 Digital Images 135 PixMaps 136 PixMap Data Structure Description 137 PixMap Management Traps 140 PixMap Management Strategies 141 Creating Offscreen PixMaps 142 Color Patterns 146 Using PixPats 147 CGrafPort PixPats 147 Creating Custom PixPats 148 Moving Pixels Around 148 Introducing CopyBits() 149 Horizontal and Vertical Scaling 151 Examples of Using CopyBits() 152 Performance Considerations 157 .,.. Contents ix PixMap Resolution and Patching the StdBits() Bottleneck 160 Summary 163 4. Display Control and Offscreen Drawing 165 The Need for Drawing Offscreen 165 Video Display Overview 166 Causes of Flicker 166 Basic Offscreen Drawing Procedure 168 GWorlds 170 Using GWorlds 170 More G World Techniques 173 GWorld Usage Summary 178 Application Display Control 178 Rules about Changing GDevice Settings 178 Using HasDepth() and SetDepth() 179

Reading notes: Table of contents page numbers and section headings are partly OCR-like; the source contains a stray character in 'Color Gra£Ports' and an uncertain '.,..' line before 'Contents ix'.

Languages
English
PDF page 9

x ~ Contents The Palette Manager 180 Basic Palette Concepts 181 Important Palette Manager Traps 187 The Dark Past of the Palette Manager 190 Using Palettes 191 Palette Review 201 Specialized ColorTables 201 GDevice ColorTables 203 User Interface ColorTables 203 Summary 204 5. Applied Graphics Techniques 205 Building a Paint Application - ArtToy 205 Objectives and Goals 206 Software Tools Needed 206 Window Fundamentals 207 Graphic Foundations of Windows 208 Window Regions 209 Window Types and Presentation Considerations 213 Views 214 Focusing 218 Basic Window Event-Handling Techniques 221 Desktop Interactions 224 Introduction to Document Organization 227 Rasterizing 228 Document Rendering Techniques 229 Printing 230 Overview of the Printing Process 231 Print Data Structures 232 Important Print Traps 233 A Basic Window Object 234 Objectives 234 Class Definition 235 Public Methods 238

Reading notes: Source text appears to be a table of contents with page numbers; headline taken as the primary heading 'Contents'.

Languages
English
PDF page 10

A GWorld Window Object 243 Objectives 243 Class Definition 243 Public Methods 244 Summary 247 6. Mouse-Based Graphics 249 ~ Contents xi The Two Basic Types of Mouse-Based Tools 250 Sketching 250 What All Mouse-Based Objects Have in Common 253 Drawing Tools and Abstract Differentiation 256 Regular Shapes 256 Irregular Shapes: Collected Points 270 Selection Tools 284 Summary 310 7. Image Processing with QuickDraw 311 Pixel-Processing Traps 312 Basic CopyDeepMask() and CopyMask() Functionality 314 Explicit Arguments 314 Global Arguments 317 Altering Images with CopyBits() 320 Aliasing 326 Rasterizing 328 Aliased Regions 331 Antialiased Lines 332 Antialiased Text 334 Review of Key Points 338 Depth Conversion and Dithering 338 Depth Conversion Cases 338 What Are Dithering and Error Diffusion? 341 How CopyBits() Dithers 342 Image Resizing 343 Dithered Patterns 348 Using Deep PixMaps on Classic QuickDraw Machines 349

Reading notes: Table of contents lists page numbers with OCR-style spacing artifacts such as 'Class Definition' and 'Mouse-Based Graphics' that may not reflect exact original spacing.

Languages
English
PDF page 11

xii .,... Contents The BitMapToRgnO Trap 350 Device Loops 352 The DeviceLoop() Trap 353 Using DeviceLoop(): A Source Code Example 354 Summary 355 8. All About Pictures 357 Picture Analysis with the Picture Utilities 358 Taking Pictures, in Review 359 Using the Picture Utilities 361 Count of Basic QuickDraw Objects 364 Color Analysis 366 Using Deep PixMaps on Classic QuickDraw Machines 376 Summary 384 9. Compatibility and Configuration Issues 385 Hardware Configuration 386 The Well-Behaved Application 387 Software Compatibility 393 Detecting and Handling Limited System Software 394 Imposing Configuration Requirements 396 32-Bit Addressing Issues 397 A Short History 398 Addressing Video Display Memory 399 Handling 32-Bit Addressing Mode 400 Other Issues 403 Summary 404 Bibliography 405 Index 411

Reading notes: Source appears to be a table of contents with no primary heading or advertised products, prices, or dates.

Languages
English