CS 360 Computer Graphics - PowerPoint PPT Presentation

1 / 33
About This Presentation
Title:

CS 360 Computer Graphics

Description:

1 bit: bi-level, black and white, monochrome. 2 bits: 4 gray levels. 4 bits: 16 ... Monochrome displays: single color displayed at different intensities. 25 ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 34
Provided by: cshi4
Category:

less

Transcript and Presenter's Notes

Title: CS 360 Computer Graphics


1
CS 360 Computer Graphics
  • Chapter 1 - Introduction

2
Topics
  • Introduction
  • Applications
  • Elementary Output Primitives
  • Graphics Output Devices
  • Graphics Input Devices

3
1.1 Introduction
  • What is computer graphics?
  • Pictures generated by computer
  • Tools used to make the pictures
  • Field of study involving the tools and the
    pictures they produce
  • Purpose of course show the tools and how to
    apply them, both hardware and software tools.

4
OpenGL
  • Will be utilizing graphics libraries
  • OpenGL is a device-independent library
  • Developed by Silicon Graphics in 1992
  • Widely used in industry and education

5
1.2 Applications
  • Art, entertainment, publishing
  • Computer graphics image processing
  • Monitoring manufacturing processes
  • Displaying simulations
  • CAD (computer aided design)
  • Scientific analysis and visualization

6
1.3 Elementary Output Primitives
  • Polyline
  • Text
  • Filled regions
  • Raster images
  • Each primitive is associated with a set of
    attributes

7
Polyline
  • A connected sequence of straight lines, can
    appear as a straight curve
  • Polygon 1st and last points are connected, if
    no 2 edges cross it is a simple polygon.

8
Attributes of Polyline
  • Color
  • Thickness
  • How are edges dashed solid, dashed, dotted,
    etc
  • How do edges blend at endpoints butt-end, round
    end, mitered, etc. (Fig 1.13.)

9
Text
  • There are two display modes
  • Text mode
  • Graphics mode

10
Display modes
  • Text mode used for simple input and output,
    uses built in character generator, characters
    only placed in built-in grid
  • Graphics mode richer set of character set, and
    can be placed arbitrarily

11
Attributes of Text
  • Font
  • Color
  • Size
  • Spacing
  • Orientation
  • Others (less important)

12
Filled Regions
  • A shape filled with some color or pattern,
    boundary is typically a polygon
  • Attributes
  • Pattern of filling
  • Color of filling
  • Attributes of enclosing border

13
Raster Image
  • Image made up of pixels (Fig 1.19)
  • Stored as a 2D array of numerical values, each
    pixel has its own color
  • Bit map 1 bit per pixel
  • Pixel map gt1 bit per pixel

14
How to create raster images.
  • Hand designed
  • Computed images use an algorithm to calculate
    color of light that falls on each pixel. Raster
    images frequently contain straight lines decide
    which pixels best fit the ideal line between 2
    endpts.
  • Scanned images place grid over picture, at each
    grid pt, find closest color, store

15
Gray-Scale Raster Image
  • Pixel depth
  • of bits needed to represent the gray level of a
    pixel
  • 1 bit bi-level, black and white, monochrome
  • 2 bits 4 gray levels
  • 4 bits 16 gray levels
  • 8 bits 256 gray levels (acceptably quality in
    scanned images) requires lots of memory.
  • N bits 2n values

16
Color raster images
  • More common as costs come down.
  • Each pixel has a color value
  • Common technique, a color is represented by an
    ordered triple (amount of red, green, blue)
  • Color depth of pixel of bits used to
    represent the color of a pixel, each value in the
    triple is described using a certain number of
    bits.

17
For example
  • Color depth 3 bits ? 1 bit / color ? 8 possible
    colors
  • (0, 1, 1) ? green blue cyan
  • (1, 1, 1) ? white
  • Q how many colors can be represented?
  • Color depth 8 is common, why?

18
True color image
  • Highest quality
  • Color depth 24
  • 8 bits/color component
  • This is as good as the eye can see.
  • Q how many colors can be represented?
  • Q how many bytes are required to store a 1080 x
    1024 image?

19
1.4 Graphics Display Devices
  • Line Drawing Display most early graphics were
    of this type, currently not too common except in
    specialized applications
  • Raster Displays common today
  • Video monitors PCs
  • Flat-panel laptops
  • For hard copies laser printers, ink jet,

20
Display surface
  • 2D display surface, with a built in 2D coordinate
    system.
  • Coordinate system is upside down, (or not).
  • Position on display is associated with an image
    pixel
  • Connected to frame buffer a region of memory
    large enough to hold all pixel values for the
    display
  • May be physical memory, or graphics card,

21
Process to create display image
  • Program is executed line by line
  • Program computes values for each pixel loads
    into frame buffer
  • Scan controller (not under program control)
    causes frame buffer to send each pixel through a
    converter to the appropriate physical spot on
    display
  • Converter takes pixel value converts it to the
    corresponding quantity that produces color on
    display

22
Example
  • Location on display (149, 262)
  • Value of the pixel is held in frame buffer
    mem149262
  • Convert value in memory to color intensity

23
Video monitors
  • Use CRT ( cathode ray tube)
  • 3 electron guns one for each color
  • Different intensities receive different voltages
  • DAC (digital to analog converter) converts
    digital number to voltage level
  • The color will fade so must be refreshed (at
    least 60 times/sec).

24
  • Better monitors have frame buffer that supports
    24 planes of memory 24 bits/pixel.
  • Each component gets 8 bits ? 256 levels of red,
    green and blue
  • ? 16 million colors
  • Monochrome displays single color displayed at
    different intensities

25
Another method of associating pixel values with
colors
  • LUT (color lookup table)
  • Pixel value used as an index into LUT
  • Programmable
  • Palette set of possible colors that can be
    displayed

26
How LUT works
  • Fig 1.40 6 bit frame buffer values refer to a
    location in LUT that location specifies the
    color (what the DAC receives).
  • So 6 bits of indexes in table 64 values
    LUT0 --- LUT63
  • Program will set the values held in LUT
    flexibility in choosing colors, how to choose
    color???

27
Why use?
  • 64 entries each entry has 15 bits ? each color
    could be one of 215 32,768 colors.
  • In this example, could be using 64 colors out of
    a possible 32K colors. (size of palette)
  • Contents of LUT can be changed, but not in the
    middle of a scan-out of entire frame buffer.

28
Example
  • Display has color depth of b bits.
  • LUT entry is w bits wide
  • System can display 2w colors, any 2b at a time.
  • W is typically a multiple of 3, and b lt w
  • LUT requires little memory, 2b words of w bits.

29
Example 1024 x 1280 display
  • 24 bit/pixel frame buffer, no LUT
  • 1.3 million pixels, 224 colors
  • 8 bits / DAC
  • Memory 1024 x 1280 x 24 bits 4 MB
  • 8 bit/pixel frame buffer, LUT 24 bits wide
  • 256 colors at a time out of 224 possible colors
  • Memory 1024 x 1280 x 8 1 MB

30
LUTs final comments
  • Indexed color displays with LUT much cheaper than
    true color systems!!
  • LUT will help inexpensive system
  • Becoming less common as cost of memory comes
    down.
  • HOMEWORK due next class period
  • P 29 1, 2

31
Hard copy output devices
  • Plotter (flatbed and drum)
  • Dot matrix printer
  • Laset printer
  • Inkjet printer
  • Film recorder

32
1.5 Graphics Input Primitives Devices
  • Input graphic primitives (each device produces a
    primitive)
  • String
  • Choice
  • Valuator (0 1.0)
  • Locator (x, y)
  • pick

33
Physical Input Devices
  • Keyboard
  • Buttons
  • Mouse
  • Tables
  • Joystick and trackball
  • Knobs
  • Space ball and data glove
Write a Comment
User Comments (0)
About PowerShow.com