Fall 20066.831 UI Design and Implementation1 Lecture 6: Output.

Slides:



Advertisements
Similar presentations
Graphics You draw on a Graphics object The Graphics object cannot directly be created by your code, instead one is generated when the method paintComponent.
Advertisements

1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
GIMP Tutorial v2.0 Boo Virk
Informationsteknologi Monday, October 29, 2007Computer Graphics - Class 21 Today’s class Graphics programming Color.
Adobe Photoshop CS Design Professional PATHS, & SHAPES USING CLIPPING MASKS,
Graphics File Formats. 2 Graphics Data n Vector data –Lines –Polygons –Curves n Bitmap data –Array of pixels –Numerical values corresponding to gray-
Graphics in the web Digital Media: Communication and Design
Introduction to Computer Graphics
Spring /6.831 User Interface Design and Implementation1 Lecture 11: Output.
Graphical images Bit-mapped (or raster-based) image: Matrix describing the individual dots that are the smallest elements (pixels) of resolution on a computer.
ICS 61 - Graphics. Light Color Wheel Color Perception.
GIMP Graphic Image Manipulation Program. GIMP Image manipulation software Free Open Source Written by two students First version in 1996.
1 Interface Types & Polymorphism & introduction to graphics programming in Java.
COMP Bitmapped and Vector Graphics Pages Using Qwizdom.
COMPUTER GRAPHICS Prepared by S.MAHALAKSHMI Asst. Prof(Sr) / SCSE VIT University.
CGMB214: Introduction to Computer Graphics
Lecture 4 - Introduction to Computer Graphics
Digital Images Chapter 8, Exploring the Digital Domain.
BFTAW BDPA Workshop Introduction to GIMP Chris
BFTAW BDPA Workshop Introduction to GIMP Chris
Simple Graphics. Graphics Used in PowerPoint, Web pages and others Basic Knowledge drawing change of colour, shape and others acquiring, video camera,
Tools for Raster Displays CVGLab Goals of the Chapter To describe pixmaps and useful operations on them. To develop tools for copying, scaling, and rotating.
Tutorial 6 Working with Bitmaps and Gradients, and Publishing Flash Files.
Java Software Solutions Lewis and Loftus Chapter 7 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphics -- Introduction The.
Tutorial 2 Drawing Text, Adding Shapes, and Creating Symbols.
I-1 Steps of Image Generation –Create a model of the objects –Create a model for the illumination of the objects –Create an image (render) the result I.
Digital Image: Representation & Processing (2/2) Lecture-3
CS1315: Introduction to Media Computation Picture encoding and manipulation.
Image Representation. Objectives  Bitmaps: resolution, colour depth and simple bitmap file calculations.  Vector graphics: drawing list – objects and.
Lecture 4 Pixels, Images and Image Files 1. In this Lecture, you will learn the following concepts: Image files (in particular, the BMP file format) How.
Computer Graphics Bitmaps & Sprites CO2409 Computer Graphics Week 3.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
© De Montfort University, Vector and Bitmapped graphics Howell Istance School of Computing De Montfort University.
GDI+ 1. Objectives 2 GDI+ class  Create and render Graphic  Display information on the computer screen, printer 3.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 3 This presentation © 2004, MacAvon Media Productions Introduction to Computer Graphics.
Java Graphics. Review 3 kinds of elements in components API? Layout managers Events Extend vs. Implement.
Computer Images Can store color info about each pixel, but makes file BIG Compression for Web 15.
INT 840E Computer graphics Introduction & Graphic’s Architecture.
CS- 375 Graphics and Human Computer Interaction Lecture 1: 12/4/1435 Fundamental Techniques in Graphics Lecturer: Kawther Abas.
Image Representation. Digital Cameras Scanned Film & Photographs Digitized TV Signals Computer Graphics Radar & Sonar Medical Imaging Devices (X-Ray,
ADOBE PHOTOSHOP VECTOR VS RASTER. Pixel A pixel is the fundamental unit of an image in Photoshop. It is a small square block of color. An image often.
Digital Media Dr. Jim Rowan ITEC So far… We have compared bitmapped graphics and vector graphics We have discussed bitmapped images, some file formats.
Color Web Design Professor Frank. Color Displays Based on cathode ray tubes (CRTs) or back- lighted flat-screen Monitors transmit light - displays use.
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
CISC 110 Day 3 Introduction to Computer Graphics.
1 Perception and VR MONT 104S, Fall 2008 Lecture 20 Computer Graphics and VR.
Intelligent Robotics Today: Vision & Time & Space Complexity.
Image File Formats By Dr. Rajeev Srivastava 1. Image File Formats Header and Image data. A typical image file format contains two fields namely Dr. Rajeev.
Graphics and Image Data Representations 1. Q1 How images are represented in a computer system? 2.
Efficient Game Graphics From Flash MX 2004 Game Design Demystified.
3. Drawing Let’s Learn Saengthong School, June – August 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
BITMAPPED IMAGES & VECTOR DRAWN GRAPHICS
Pixels, Colors and Shapes
Sampling, Quantization, Color Models & Indexed Color
Raster Images CPSC 1030.
Graphics and Multimedia
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
Chapter 3:- Graphics Eyad Alshareef Eyad Alshareef.
1.01 Investigate graphic types and file formats.
Chapter 14 JavaFX Basics Dr. Clincy - Lecture.
Introduction to Computer Graphics
6th Lecture – Rectangles and Regions, and intro to Bitmap Images
Graphics -- Introduction
Digital Media Dr. Jim Rowan ITEC 2110.
Web Programming– UFCFB Lecture 7
Vectors and Paths, also File Export
Multimedia System Image
Primitive Drawing Algorithm
Primitive Drawing Algorithm
Lecture 4 - Introduction to Computer Graphics
Presentation transcript:

Fall UI Design and Implementation1 Lecture 6: Output

Fall UI Design and Implementation2 UI Hall of Fame or Shame?

Fall UI Design and Implementation3 UI Hall of Fame or Shame? Xerox Star scrollbar original Macintosh scrollbar current Macintosh scrollbar

Fall UI Design and Implementation4 Today’s Topics Output models Drawing Rasterization Color models

Fall UI Design and Implementation5 Three Output Models Components –Graphical objects arranged in a tree with automatic redraw –Example: Label object, Line object –Also called: views, interactors, widgets, controls, retained graphics Strokes –High-level drawing primitives: lines, shapes, curves, text –Example: drawText() method, drawLine() method –Also called: vector graphics, structured graphics Pixels –2D array of pixels –Also called: raster, image, bitmap

Fall UI Design and Implementation6 Example: Designing a Graph View Component model –Each node and edge is a component –A node might have two subcomponents: circle and label Stroke model –Graph view draws lines, rectangles and text Pixel model –Graph view has pixel images of the nodes A C B

Fall UI Design and Implementation7 Issues in Choosing Output Models Layout Input Redraw Drawing order Heavyweight objects Device dependence

Fall UI Design and Implementation8 How Output Models Interact Components Strokes Pixels drawing rasterization

Fall UI Design and Implementation9 Drawing in the Component Model Drawing goes top down –Draw self (using strokes or pixels) –For each child component, If child intersects clipping region then –intersect clipping region with child ’ s bounding box –recursively draw child with clip region = intersection A C B clip region

Fall UI Design and Implementation10 Damage and Automatic Redraw A C B A D B A C B damaged region

Fall UI Design and Implementation11 Naïve Redraw Causes Flashing Effects Determine damaged region Redraw parent (children blink out!) Redraw children Object moves

Fall UI Design and Implementation12 Double-Buffering Double-buffering solves the flashing problem Screen Memory buffer

Fall UI Design and Implementation13 Stroke Model Drawing surface –Also called drawable (X Windows), GDI (MS Win) –Screen, memory buffer, print driver, file, remote screen Graphics context –Encapsulates drawing parameters so they don ’ t have to be passed with each call to a drawing primitive –Font, color, line width, fill pattern, etc. Coordinate system –Origin, scale, rotation Clipping region Drawing primitives –Line, circle, ellipse, arc, rectangle, text, polyline, shapes

Fall UI Design and Implementation14 Rasterization Is (0,0) the center of the top-left pixel, or is it the upper left corner of the pixel? –MS Win: center of pixel –Java: upper left corner Where is line (0,0) – (10,0) actually drawn? –MS Win: endpoint pixel excluded –Java Graphics: pen hangs down and right –Java Graphics2D: antialiased pen, optional ½ pixel adjustments made for compatibility Where is empty rectangle (0,0) – (10,10) drawn? –MSWin: connecting those pixels –Java: extends one row below and one column right Where is filled rectangle (0,0) – (10,10) drawn? –MSWin: 121 pixels –Java: 100 pixels

Fall UI Design and Implementation15 Antialiasing and Subpixel Rendering Simple Antialiased Subpixel rendering

Fall UI Design and Implementation16 Pixel Model Pixel model is a rectangular array of pixels –Each pixel is a vector (e.g., red, green, blue components), so pixel array is really 3 dimensional Bits per pixel (bpp) –1 bpp: black/white, or bit mask –4-8 bpp: each pixel is an index into a color palette –24 bpp: 8 bits for each color –32 bpp: 8 bits for each color + alpha channel Color components (e.g. RGB) are also called channels or bands Pixel model can be arranged in many ways –Packed into words (RGBR GBRG … ) or loosely (RGB- RGB- … ) –Separate planes (RRR … GGG … BBB … ) vs. interleaved (RGB RGB RGB … ) –Scanned from top to bottom vs. bottom to top

Fall UI Design and Implementation17 Transparency Alpha is a pixel ’ s transparency –from 0.0 (transparent) to 1.0 (opaque) –so each pixel has red, green, blue, and alpha values Uses for alpha –Antialiasing –Nonrectangular images –Translucent components –Clipping regions with antialiased edges

Fall UI Design and Implementation18 BitBlt BitBlt (bit block transfer) copies a block of pixels from one image to another –Drawing images on screen –Double-buffering –Scrolling –Clipping with nonrectangular masks Compositing rules control how pixels from source and destination are combined –More about this in a later lecture

Fall UI Design and Implementation19 Image File Formats GIF –8 bpp, palette uses 24-bit colors –1 color in the palette can be transparent (1-bit alpha channel) –lossless compression –suitable for screenshots, stroked graphics, icons JPEG –24 bpp, no alpha –lossy compression: visible artifacts (dusty noise, moire patterns) –suitable for photographs PNG –lossless compression –1, 2, 4, 8 bpp with palette –24 or 48 bpp with true color –32 or 64 bpp with true color and alpha channel –suitability same as GIF –better than GIF, but no animation

Fall UI Design and Implementation20 Color Models RGB: cube –Red, green, blue HSV: hexagonal cone –Hue: kind of color Angle around cone –Saturation: amount of pure color 0% = gray, 100% = pure color –Value: brightness 0% = dark, 100% = bright HLS: double-hexagonal cone –Hue, lightness, saturation –Pulls up center of HSV model, so that only white has lightness 1.0 and pure colors have lightness 0.5 Cyan-Magenta-Yellow(-Black) –Used for printing, where pigments absorb wavelengths instead of generating them

Fall UI Design and Implementation21 HSV & HLS

Fall UI Design and Implementation22 Hints for Debugging Output Something you ’ re drawing isn ’ t appearing on the screen. Why not? –Wrong place –Wrong size –Wrong color –Wrong z-order