1 Lecture 4: Output Models, Structured Graphics & Display PostScript Brad Myers 05-830 Advanced User Interface Software.

Slides:



Advertisements
Similar presentations
This terms course Last term we both worked on learning 2 things –Processing –The concepts of graphics etc. This term will focus more on the basic concepts.
Advertisements

Tutorial 12: Enhancing Excel with Visual Basic for Applications
Chapter 3 Drawing and Composing an Illustration. Objectives Draw straight lines Draw curved lines Draw elements of an illustration Apply attributes to.
User Interface Programming in C#: Graphics
Lecture 12: Interactive Tools: Prototypers (HyperCard, Director, Visual Basic), Interface Builders, Sketching Tools Brad Myers Advanced User Interface.
Chapter 7 Introduction to High-Level Language Programming.
1 Lecture 5: Other Output Models: Structured Graphics; Object-Oriented Techniques Brad Myers Advanced User Interface Software.
1 Lecture 3: Basic Computer Graphics Brad Myers Advanced User Interface Software.
1 Lecture 13: Demonstrational Tools Brad Myers Advanced User Interface Software.
CMPE 466 COMPUTER GRAPHICS
Spring /6.831 User Interface Design and Implementation1 Lecture 11: Output.
Vector vs. Bitmap SciVis V
V Obtained from a summer workshop in Guildford County July, 2014
Vector Graphics Making custom images. Raster vs. Vector Graphics In computer graphics, a raster graphics image, or bitmap, is a dot matrix data structure.
1 Lecture 4: Basic Computer Graphics For User Interfaces Brad Myers Advanced User Interface Software.
SWHIG Seminar Ian Kim 1/18/12.  General overview of printing technology ◦ Background information:  Vector vs. raster graphics  How inkjet printers.
1 Lecture 3: Overview of UI Software and Tools Brad Myers Advanced User Interface Software.
1 Lecture 9: Deep Dive: Selecting and Creating Objects across Different Kinds of Views Brad Myers A/05-499A: Interaction Techniques Spring, 2014.
Chapter 3 Working with Symbols and Interactivity.
Introduction to Interactive Media 06: Text: Static Interactive Media Component.
CGMB214: Introduction to Computer Graphics
Java Software Solutions Lewis and Loftus Chapter 7 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphics -- Introduction The.
Vector vs. Bitmap
1 Lecture 3: Other Output Models: Structured Graphics; Object-Oriented Techniques Brad Myers Advanced User Interface Software © Brad Myers.
Graphics A graphics program allows you to combine pictures and text in many different ways. Features – General Level Draw graphics Enter Text Common Tools.
Working with Symbols and Interactivity
Element. The element Used to dynamically draw graphics using javascript. Capable of drawing paths, circles, rectangles, text, and images.
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
1 Introduction Line attribute Color and gray scale Area filled attribute Anti-aliasing.
Introduction to Interactive Media Interactive Media Components: Text.
Robert Crawford, MBA West Middle School.  Explain how the binary system is used by computers.  Describe how software is written and translated  Summarize.
Java Graphics. Review 3 kinds of elements in components API? Layout managers Events Extend vs. Implement.
Lecture 16 Image Document Formats. Bitmap vs. Vector Images Bitmaps do not generally.
Lecture 10: Toolkits: Intrinsics, Callbacks, Resources, Widget hierarchies, Geometry management Brad Myers Advanced User Interface Software 1© 2013.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
1 Lecture 2: Overview of UI Software and Tools Brad Myers Advanced User Interface Software.
Digital Media Dr. Jim Rowan ITEC So far… We have compared bitmapped graphics and vector graphics We have discussed bitmapped images, some file formats.
Advanced 2D Design Concepts Guilford County Sci Vis V
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
Graphics Concepts CS 2302, Fall /17/20142 Drawing in Android.
In the name of God Computer Graphics.
1 Lecture 5: Interactive Tools: Prototypers (HyperCard, Director, Visual Basic), Interface Builders Brad Myers Advanced User Interface Software.
Fall UI Design and Implementation1 Lecture 6: Output.
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
Computer Graphics Matrices
1 Introduction to PostScript Sep. 21 Dae-Eun Hyun 3D MAP Lab.
Digital Media Lecture 5: Vector Graphics Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
Chapter1 The flash interface and action script 3.0.
Graphics and Image Data Representations 1. Q1 How images are represented in a computer system? 2.
Guilford County SciVis V104.03
CS100A, Fall 1998, Lecture 201 CS100A, Fall 1998 Lecture 20, Tuesday Nov 10 More Matlab Concepts: plotting (cont.) 2-D arrays Control structures: while,
Advanced Java Screen Update Techniques SD’98 - Session 4406 Ted Faison Faison Computing Inc.
Chapter 7 Vector Editing © 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website,
Main characteristics of Vector graphics  Vector graphics provide an elegant way of constructing digital images (diagrams, technical illustration and.
1 U08181 Computer Graphics Clipping Transformations –Transformations and matrices –Homogeneous matrices –Transformations in SVG.
Vector vs. Bitmap. Vector Images Vector images (also called outline images) are images made with lines, text, and shapes. Test type is considered to be.
Brad Myers Advanced User Interface Software, 2017
In the name of God Computer Graphics.
Vector vs. Bitmap.
Adobe Flash Professional CS5 – Illustrated
Lecture Week 4 Images.
IMAGES.
Java Graphics The basic rendering mechanism is the drawing system that controls when and how programs can draw on a graphics component. When a component.
Topic 8: (Last two papers)
6th Lecture – Rectangles and Regions, and intro to Bitmap Images
Chapter 7 Vector Editing
Graphics -- Introduction
Digital Media Dr. Jim Rowan ITEC 2110.
Brad Myers : Interaction Techniques Spring, 2019
Presentation transcript:

1 Lecture 4: Output Models, Structured Graphics & Display PostScript Brad Myers Advanced User Interface Software

2 Drawing Operation Lots of parameters control the drawing of objects. X drawline has at least: 1.Window in which to draw 2.X1 3.Y1 4.X2 5.Y2 6.relative-p 7.line-width 8.draw function 9.background-color 10.foreground-color 11.cap style 12.line style (solid, dashed, double-dashed) 13.dash pattern 14.dash offset 15.stipple bitmap 16.stipple origin X 17.stipple origin Y 18.clip mask 19.plane mask (for drawing on specific planes)

3 Models for Parameters Two basic models: 1. Graphics package stores the state: Set Pen color, width, etc. Draw object Used by Macintosh, Display PostScript, etc. Example (pseudo code): SetColor(Red) MoveTo(70, 30) DrawTo(70, 200) + Fewer parameters to calls + Don't have to set properties don't care about - Interrupts, multi-processing, may result in unexpected settings

4 Models for Parameters, cont. 2. Each operation supplies full parameters Example: DrawLine(70,30,70,200, Red,......) X uses a "graphics context" to store them all, so not regular parameters to functions Amulet uses Am_Style objects Issue: Am_Red used as fill style vs. line style

5 Java model Parameters stored in the “graphics” object More like global model, since rarely create new graphics objects – just reuse the standard one and pass it around

6 Structured Graphics Saves a list of all the graphical objects Edit the screen by editing the saved list Also called "display list" or "retained object model" Provided by many toolkits and graphics packages early vector displays CORE (~1977), GKS (1985), PHIGS (1988) Optional in InterViews, CLIM, etc. Required in Amulet, Garnet, Rendezvous, etc.

7 Structured Graphics, cont. Advantages: Simpler to program with: don't call "draw" and "erase" Automatic refresh of windows when uncovered, etc. Automatic redisplay of objects when change and also of other overlapping objects

8 Structured Graphics Can Support Ability to support: high-level behaviors like move, grow, cut/copy/paste, etc. high-level widgets like selection handles constraints among objects automatic layout grouping: "Groups" in Garnet automatic PostScript printing tutors and monitors external scripting,...

9 Structured Graphics Disadvantages Disadvantages: Significant space penalties objects take up to 1000 bytes each imagine a scene with 40,000 dots (200x200 fat bits) Time penalties redisplay doesn't take advantage of special properties of data: regularity non-overlapping

10 Amulet and Garnet Videos Brad A. Myers, Dario Giuse, Andrew Mickish, Brad Vander Zanden, David Kosbie, Richard McDaniel, James Landay, Matthew Goldberg, and Rajan Parthasarathy. “The Garnet User Interface Development Environment.” Technical Video Program of the CHI'94 conference. SIGGRAPH Video Review, Issue 97, no. 13. ACM, ISBN Brad A. Myers, Richard G. McDaniel, Robert C. Miller, Alan Ferrency, Ellen Borison, Andrew Faulring, Andy Mickish, Patrick Doane, and Alex Klimovitski, “The Amulet User Interface Development Environment”. 8 minute video. Technical Video Program of the CHI'97 conference. ACM,

11 Redisplay Algorithms Redisplay everything each time Most appropriate for small numbers of objects, and if drawing is really quick compared to computation Used on the Macintosh and many others Used by Amulet Used by homework 2 May add clipping region and/or double-buffering

12 Redisplay only the affected areas of the screen Requires computing what areas are affected Garnet: 1.keep track of objects that change any "interesting" slot 2.compute the bounding box of all these changed objects in their old and new locations 3.assert this as the clipping region (must not self-intersect; Garnet uses 2 regions) 4.erase the area 5.go through objects from top-to-bottom, back to front draw those which overlap the bounding box for step 4: goes through all top level aggregates, and any children of the aggregates that intersect (recursively) Other techniques: quad trees

13 Issue: Anti-Aliasing Can’t assume clipping regions will work Can draw outside of the bounding boxes Mac OS X uses anti-aliasing and seems to redraw lots of windows

14 Optimizing Redraw Special additions in Garnet; not in Amulet "Fast-redraws" declared by the programmer objects drawn with XOR on top of other objects those that have a solid color behind them (nothing in front) so can be erased with a rectangle or by redrawing with the background color When change, have to be erased using old values No bounding boxes, no intersections, etc. "Virtual aggregates" only pretend to allocate storage for elements provide table and arbitrary layouts

15 Optimizing Redraw “Glyphs” in InterViews Calder, P.R. and Linton, M.A. “Glyphs: Flyweight Objects for User Interfaces,” in Proceedings UIST'90: ACM SIGGRAPH Symposium on User Interface Software and Technology Snowbird, Utah: pp Don't include position information, etc. so very small Much of the layout retained by the aggregate (computed as needed) Object can be reused in many places: e.g.: the letter "a" Used for a text editor Issue: why is location special? What about red vs. blue "a"s?

16 Display PostScript Used by NeXT, Galaxy PostScript™ developed by Adobe Systems Inc. to describe documents for printing Display PostScript™ is PostScript adapted for drawing on the screen Machine independent graphics model: colors are always full color coordinates are always in physical units (point, inch) Global graphics state containing all the parameters Coordinates from lower-left, in points

17 Display Postscript, cont. Drawing model: Define a "path" = any arbitrary shape or collection of shapes Then "stroke" or "fill" the path with current settings So all the "drawing" operations, actually add a primitive to the current path Note similarities to Java 2D model! Real PostScript is pure postfix (stack) language: moveto lineto dup dup sum arc stroke Display PostScript and Galaxy have C procedures with normal syntax: vdrawMoveTo(20, 40); vdrawLineTo(60, 80); vdrawArc(60, 80, 30, 45, 2*45); vdrawStroke();

18 Display Postscript, cont. Uses 2-D "transformation matrices" to control scaling, rotation, and translation. "Homogeneous coordinate matrices" allow all three to be combined in one matrix. Postscript represents matrix as: a b 0 c d 0 = [a b c d tx ty] tx ty 1

19 Display PDF used in OS-X Display-PDF Successor to Display Postscript Used in Macintosh OS X