CSC 406
Applied Computer
Graphics
LECTURE 4:LECTURE 4:
Raster Displays - detailsRaster Displays - details
Daroko blog-
 Do Not just learn computer graphics an close
your computer tab and go away..
 APPLY them in real business,
 Visit Daroko blog for real IT skills
applications,androind, Computer
graphics,Networking,Programming,IT jobs
Types, IT news and
applications,blogging,Builing a website, IT
companies and how you can form yours,
Technology news and very many More ITLecture4 CSC 406 - Computer Graphics 2
Lecture4 CSC 406 - Computer Graphics 3
Lecture 4:Lecture 4:
 Scope:
 Raster memory.
 Attributes.
 Raster Ops.
 Lecture Goals:
 To examine the memory concepts in raster
display.
 To understand the different attributes of raster
desplay.
Lecture4 CSC 406 - Computer Graphics 4
Lecture4 CSC 406 - Computer Graphics 5
Raster Memory:Raster Memory:
 Pixmap:
 A pixmap is storage for a whole raster of pixel values.
 Usually a contiguous area of memory, comprising one row
(or column) of pixels after another.
 Bitmap:
 Technically a bitmap is a pixmap with 1 bit per pixel, i.e.
boolean colour values, e.g. for use in a black-and-white
display.
 But 'bitmap' is often misused to mean any pixmap - please
try to avoid this!
Lecture4 CSC 406 - Computer Graphics 6
Raster memory…
 Pixrect:
 A pixrect is any 'rectangular area' within a pixmap.
A pixrect thus typically refers to a series of equal-
sized fragments of the memory within a pixmap,
one for each row (or column) of pixels.
Lecture4 CSC 406 - Computer Graphics 7
Frame Buffer:
 Frame buffers are often special two-ported
memory devices ('video memory') with one
port for writing and another for concurrent
reading.
 Alternatively they can be part of the ordinary
fast RAM of a computer, which allows them
to be extensively reconfigured by software.
Lecture4 CSC 406 - Computer Graphics 8
Lecture4 CSC 406 - Computer Graphics 9
Frame buffer…
 Defn: A frame buffer is a video output
device that drives a video display from a
memory buffer containing a complete frame
of data.
 The information in the buffer typically
consists of color values for every pixel (point
that can be displayed) on the screen.
Lecture4 CSC 406 - Computer Graphics 10
Frame buffer…
 Color values are commonly stored in:
 1-bit monochrome,
 4-bit palettized,
 8-bit palettized,
 16-bit highcolor and
 24-bit truecolor formats.
 An additional alpha channel is sometimes
used to retain information about pixel
transparency.
Lecture4 CSC 406 - Computer Graphics 11
Frame buffer…
 The total amount of the memory required to
drive the frame buffer depends on the
resolution of the output signal, and on the
color depth and palette size.
 Frame buffers differ significantly from the
vector graphics displays that were common
prior to the advent of the frame buffer.
Lecture4 CSC 406 - Computer Graphics 12
Frame buffer…
 With a vector display, only the vertices of the
graphics primitives are stored.
 The electron beam of the output display is then
commanded to move from vertex to vertex,
tracing an analog line across the area between
these points.
Lecture4 CSC 406 - Computer Graphics 13
Frame buffer…
 With a framebuffer, the electron beam (if the
display technology uses one) is commanded
to trace a left-to-right, top-to-bottom path
across the entire screen, the way a television
renders a broadcast signal.
 At the same time, the color information for each
point on the screen is pulled from the frame
buffer, creating a set of discrete picture elements
(pixels).
Lecture4 CSC 406 - Computer Graphics 14
Option1: Frame buffer is anywhere
in system memory
System Bus
CPU Video
Controller
System
Memory
Monitor
Frame buffer
Cartesian
Coordinates
Lecture4 CSC 406 - Computer Graphics 15
Option2: Permanent place for
frame buffer
System Bus
CPU Video
Controller
System
Memory
Monitor
Frame buffer
Cartesian
Coordinates
Frame
Buffer
•Direct
connection to
video controller
Lecture4 CSC 406 - Computer Graphics 16
Frame buffer…
 With respect to color displays, there are two
types of frame buffers:
 Direct color frame buffer
 Color lookup frame buffer
Lecture4 CSC 406 - Computer Graphics 17
Lecture4 CSC 406 - Computer Graphics 18
Lecture4 CSC 406 - Computer Graphics 19
Lecture4 CSC 406 - Computer Graphics 20
Lecture4 CSC 406 - Computer Graphics 21
Raster memory…
 In a bit-mapped display, the display processor
refreshes the screen 25 or more times per second, a
line at a time, from a pixmap termed its frame buffer.
 In each refresh cycle, each pixel's colour value is
'copied' from the frame buffer to the screen.
 Additional raster memory may exist 'alongside' that
for colour values.
 For example there may be an 'alpha channel'
(transparency values) a z-buffer (depth values for hidden
object removal), or an a-buffer (combining both ideas).
Lecture4 CSC 406 - Computer Graphics 22
Key Attributes of RasterKey Attributes of Raster
Displays:Displays:
 Major attributes that vary between different raster
displays include the following:
 'Colour':
 bi-level, greyscale, pseudo-colour, true colour:
 Refer to 'pixel values' in lecture3
 Size:
 usually measured on the diagonal: inches or degrees;
 Aspect ratio:
 now usually 5:4 or 4:3 (625-line TV: 4:3; HDTV: 5:3);
Lecture4 CSC 406 - Computer Graphics 23
Attributes…
 Resolution:
 e.g. 1024×1280 (pixels).
 Multiplying these numbers together we can say e.g. 'a 1.25
Mega-pixel display'.
 Avoid terms such as low/medium/high resolution which may
change over time.
 Pixel shape:
 now usually square;
 other rectangular shapes have been used.
 Brightness, sharpness, contrast:
 possibly varying significantly with respect to view angle.
Lecture4 CSC 406 - Computer Graphics 24
Attributes…
 Speed, interlacing:
 now usually 50 Hz or more and flicker-free to
most humans;
 Computational features, as discussed
next...
Lecture4 CSC 406 - Computer Graphics 25
Computational features:Computational features:
 Since the 1970s, raster display systems have
evolved to offer increasingly powerful
facilities, often packaged in optional graphics
accelerator boards or chips.
 These facilities have typically consisted of
hardware implementation or acceleration of
computations which would otherwise be
coded in software, such as:
Lecture4 CSC 406 - Computer Graphics 26
Computational features…
 Raster-ops: fast 2D raster-combining operations
explained next;
 2D scan conversion, i.e. creating raster images
required by 2D drawing primitives such as:
 2D lines, e.g. straight/circular/elliptical lines, maybe spline
curves (based on several points);
 2D coloured areas, e.g. polygons or just triangles, possibly
with colour interpolation;
 Text (often copied from rasterised fonts using raster-ops);
Lecture4 CSC 406 - Computer Graphics 27
Computational features…
 3D graphics acceleration - now often
including 3D scan conversion.
 It is useful for graphics software developers to be
aware of such features and how they can be
accessed,
and to have insight into their cost in terms of time
taken as a function of length or area.
Lecture4 CSC 406 - Computer Graphics 28
Raster Ops:Raster Ops:
 'Raster Ops' are logical operations affecting multiple
pixels in a pixmap (or raster frame buffer).
 Raster graphics terminals typically have special
hardware which executes Raster Ops very quickly.
 A raster-op assigns to a destination pixrect D a
logical function of the initial state D and an equal-
sized source pixrect S.
 This logical function is the same for each pixel of D and
each corresponding pixel of S.
Lecture4 CSC 406 - Computer Graphics 29
Raster Ops…
 All bits in a destination pixel are processed in
parallel.
 So each bit in a destination pixrect D is assigned the
specified logical function of its initial value and the value of
the corresponding bit in a congruent source pixrect S.
 Or S may be a bitmap; then the same source bit is applied
with each bit of a destination pixel.
 There are 16 possible 'logical functions' (boolean
operators) which may be used,
 See truth table on next slide:
Lecture4 CSC 406 - Computer Graphics 30
Raster Ops…
Source 001 1
Destination 01 01
0 0 (clear) 0000
1 and 0001
2 S and not D 0010
3 S (copy) 0011
4 D and not S 0100
5 D (no op) 0101
6 xor 0110
7 or 0111
8 nor 1000
9 equiv 1001
a not D (invert) 1010
b S or not D 1011
c not S 1100
d D or not S 1101
e nand 1110
f 1 (set) 1111
Lecture4 CSC 406 - Computer Graphics 31
Raster Ops…
 The functions commonly used are 0 (clear), 3
(copy), 6 (xor), a (invert) and f (set),
especially copy.
 Scrolling is generally done by repeated use of the copy
function such that the source and destination pixrects
are overlapping regions of the frame buffer.
 Another frequent use of the copy function is to save a
copy of part of a background image before drawing a
moving object over it, then copying back the saved
image and repeating this process for further positions
and states of the moving object.
Lecture4 CSC 406 - Computer Graphics 32
Raster Ops…
 The basic raster-op scheme is often
extended as follows:
 By the use of a clip mask to distinguish between
destination pixels the raster-op affects and
destination pixels which are unaffected.
 The clip mask is usually just a bitmap.
 Some raster-op hardware allows a clip mask bitmap to
be used in with independent source and destination
pixrects.
 In some cases a clip mask and a colour may be used
as an alternative to a source pixrect.
Lecture4 CSC 406 - Computer Graphics 33
Raster Ops…
 By the use of a plane mask to limit the
planes of a frame buffer that will be affected.
 A plane mask is a pixel value in which (usually)
1's specify affected planes and 0's specify
unaffected planes.
 Thus pixmaps with n-bit pixel values can be
treated as having n different 'bit-planes'.
 For example an 8-bit-pixel pixmap can be used to hold
two 4-bit-pixel images or four 2-bit-pixel images.
Lecture4 CSC 406 - Computer Graphics 34
Raster Ops…summary
 Among other things, raster-ops enabled draggable
icons, sprites (animated icons) and a whole
generation of computer games using 2D graphics
operations to achieve cheap-and-cheerful pseudo-
3D effects.
 Multiple window user interfaces make extensive use
of raster-ops.
 The X window system has long done this with particular
efficiency, both in using raster-ops in conjunction with
advanced repainting algorithms and in making raster-op
functionality accessible to applications programmers.
Lecture4 CSC 406 - Computer Graphics 35
Next Lecture…
 Scan conversion.
 Device independence/ normalization.

lecture4 raster details in computer graphics(Computer graphics tutorials)

  • 1.
    CSC 406 Applied Computer Graphics LECTURE4:LECTURE 4: Raster Displays - detailsRaster Displays - details
  • 2.
    Daroko blog-  DoNot just learn computer graphics an close your computer tab and go away..  APPLY them in real business,  Visit Daroko blog for real IT skills applications,androind, Computer graphics,Networking,Programming,IT jobs Types, IT news and applications,blogging,Builing a website, IT companies and how you can form yours, Technology news and very many More ITLecture4 CSC 406 - Computer Graphics 2
  • 3.
    Lecture4 CSC 406- Computer Graphics 3 Lecture 4:Lecture 4:  Scope:  Raster memory.  Attributes.  Raster Ops.  Lecture Goals:  To examine the memory concepts in raster display.  To understand the different attributes of raster desplay.
  • 4.
    Lecture4 CSC 406- Computer Graphics 4
  • 5.
    Lecture4 CSC 406- Computer Graphics 5 Raster Memory:Raster Memory:  Pixmap:  A pixmap is storage for a whole raster of pixel values.  Usually a contiguous area of memory, comprising one row (or column) of pixels after another.  Bitmap:  Technically a bitmap is a pixmap with 1 bit per pixel, i.e. boolean colour values, e.g. for use in a black-and-white display.  But 'bitmap' is often misused to mean any pixmap - please try to avoid this!
  • 6.
    Lecture4 CSC 406- Computer Graphics 6 Raster memory…  Pixrect:  A pixrect is any 'rectangular area' within a pixmap. A pixrect thus typically refers to a series of equal- sized fragments of the memory within a pixmap, one for each row (or column) of pixels.
  • 7.
    Lecture4 CSC 406- Computer Graphics 7 Frame Buffer:  Frame buffers are often special two-ported memory devices ('video memory') with one port for writing and another for concurrent reading.  Alternatively they can be part of the ordinary fast RAM of a computer, which allows them to be extensively reconfigured by software.
  • 8.
    Lecture4 CSC 406- Computer Graphics 8
  • 9.
    Lecture4 CSC 406- Computer Graphics 9 Frame buffer…  Defn: A frame buffer is a video output device that drives a video display from a memory buffer containing a complete frame of data.  The information in the buffer typically consists of color values for every pixel (point that can be displayed) on the screen.
  • 10.
    Lecture4 CSC 406- Computer Graphics 10 Frame buffer…  Color values are commonly stored in:  1-bit monochrome,  4-bit palettized,  8-bit palettized,  16-bit highcolor and  24-bit truecolor formats.  An additional alpha channel is sometimes used to retain information about pixel transparency.
  • 11.
    Lecture4 CSC 406- Computer Graphics 11 Frame buffer…  The total amount of the memory required to drive the frame buffer depends on the resolution of the output signal, and on the color depth and palette size.  Frame buffers differ significantly from the vector graphics displays that were common prior to the advent of the frame buffer.
  • 12.
    Lecture4 CSC 406- Computer Graphics 12 Frame buffer…  With a vector display, only the vertices of the graphics primitives are stored.  The electron beam of the output display is then commanded to move from vertex to vertex, tracing an analog line across the area between these points.
  • 13.
    Lecture4 CSC 406- Computer Graphics 13 Frame buffer…  With a framebuffer, the electron beam (if the display technology uses one) is commanded to trace a left-to-right, top-to-bottom path across the entire screen, the way a television renders a broadcast signal.  At the same time, the color information for each point on the screen is pulled from the frame buffer, creating a set of discrete picture elements (pixels).
  • 14.
    Lecture4 CSC 406- Computer Graphics 14 Option1: Frame buffer is anywhere in system memory System Bus CPU Video Controller System Memory Monitor Frame buffer Cartesian Coordinates
  • 15.
    Lecture4 CSC 406- Computer Graphics 15 Option2: Permanent place for frame buffer System Bus CPU Video Controller System Memory Monitor Frame buffer Cartesian Coordinates Frame Buffer •Direct connection to video controller
  • 16.
    Lecture4 CSC 406- Computer Graphics 16 Frame buffer…  With respect to color displays, there are two types of frame buffers:  Direct color frame buffer  Color lookup frame buffer
  • 17.
    Lecture4 CSC 406- Computer Graphics 17
  • 18.
    Lecture4 CSC 406- Computer Graphics 18
  • 19.
    Lecture4 CSC 406- Computer Graphics 19
  • 20.
    Lecture4 CSC 406- Computer Graphics 20
  • 21.
    Lecture4 CSC 406- Computer Graphics 21 Raster memory…  In a bit-mapped display, the display processor refreshes the screen 25 or more times per second, a line at a time, from a pixmap termed its frame buffer.  In each refresh cycle, each pixel's colour value is 'copied' from the frame buffer to the screen.  Additional raster memory may exist 'alongside' that for colour values.  For example there may be an 'alpha channel' (transparency values) a z-buffer (depth values for hidden object removal), or an a-buffer (combining both ideas).
  • 22.
    Lecture4 CSC 406- Computer Graphics 22 Key Attributes of RasterKey Attributes of Raster Displays:Displays:  Major attributes that vary between different raster displays include the following:  'Colour':  bi-level, greyscale, pseudo-colour, true colour:  Refer to 'pixel values' in lecture3  Size:  usually measured on the diagonal: inches or degrees;  Aspect ratio:  now usually 5:4 or 4:3 (625-line TV: 4:3; HDTV: 5:3);
  • 23.
    Lecture4 CSC 406- Computer Graphics 23 Attributes…  Resolution:  e.g. 1024×1280 (pixels).  Multiplying these numbers together we can say e.g. 'a 1.25 Mega-pixel display'.  Avoid terms such as low/medium/high resolution which may change over time.  Pixel shape:  now usually square;  other rectangular shapes have been used.  Brightness, sharpness, contrast:  possibly varying significantly with respect to view angle.
  • 24.
    Lecture4 CSC 406- Computer Graphics 24 Attributes…  Speed, interlacing:  now usually 50 Hz or more and flicker-free to most humans;  Computational features, as discussed next...
  • 25.
    Lecture4 CSC 406- Computer Graphics 25 Computational features:Computational features:  Since the 1970s, raster display systems have evolved to offer increasingly powerful facilities, often packaged in optional graphics accelerator boards or chips.  These facilities have typically consisted of hardware implementation or acceleration of computations which would otherwise be coded in software, such as:
  • 26.
    Lecture4 CSC 406- Computer Graphics 26 Computational features…  Raster-ops: fast 2D raster-combining operations explained next;  2D scan conversion, i.e. creating raster images required by 2D drawing primitives such as:  2D lines, e.g. straight/circular/elliptical lines, maybe spline curves (based on several points);  2D coloured areas, e.g. polygons or just triangles, possibly with colour interpolation;  Text (often copied from rasterised fonts using raster-ops);
  • 27.
    Lecture4 CSC 406- Computer Graphics 27 Computational features…  3D graphics acceleration - now often including 3D scan conversion.  It is useful for graphics software developers to be aware of such features and how they can be accessed, and to have insight into their cost in terms of time taken as a function of length or area.
  • 28.
    Lecture4 CSC 406- Computer Graphics 28 Raster Ops:Raster Ops:  'Raster Ops' are logical operations affecting multiple pixels in a pixmap (or raster frame buffer).  Raster graphics terminals typically have special hardware which executes Raster Ops very quickly.  A raster-op assigns to a destination pixrect D a logical function of the initial state D and an equal- sized source pixrect S.  This logical function is the same for each pixel of D and each corresponding pixel of S.
  • 29.
    Lecture4 CSC 406- Computer Graphics 29 Raster Ops…  All bits in a destination pixel are processed in parallel.  So each bit in a destination pixrect D is assigned the specified logical function of its initial value and the value of the corresponding bit in a congruent source pixrect S.  Or S may be a bitmap; then the same source bit is applied with each bit of a destination pixel.  There are 16 possible 'logical functions' (boolean operators) which may be used,  See truth table on next slide:
  • 30.
    Lecture4 CSC 406- Computer Graphics 30 Raster Ops… Source 001 1 Destination 01 01 0 0 (clear) 0000 1 and 0001 2 S and not D 0010 3 S (copy) 0011 4 D and not S 0100 5 D (no op) 0101 6 xor 0110 7 or 0111 8 nor 1000 9 equiv 1001 a not D (invert) 1010 b S or not D 1011 c not S 1100 d D or not S 1101 e nand 1110 f 1 (set) 1111
  • 31.
    Lecture4 CSC 406- Computer Graphics 31 Raster Ops…  The functions commonly used are 0 (clear), 3 (copy), 6 (xor), a (invert) and f (set), especially copy.  Scrolling is generally done by repeated use of the copy function such that the source and destination pixrects are overlapping regions of the frame buffer.  Another frequent use of the copy function is to save a copy of part of a background image before drawing a moving object over it, then copying back the saved image and repeating this process for further positions and states of the moving object.
  • 32.
    Lecture4 CSC 406- Computer Graphics 32 Raster Ops…  The basic raster-op scheme is often extended as follows:  By the use of a clip mask to distinguish between destination pixels the raster-op affects and destination pixels which are unaffected.  The clip mask is usually just a bitmap.  Some raster-op hardware allows a clip mask bitmap to be used in with independent source and destination pixrects.  In some cases a clip mask and a colour may be used as an alternative to a source pixrect.
  • 33.
    Lecture4 CSC 406- Computer Graphics 33 Raster Ops…  By the use of a plane mask to limit the planes of a frame buffer that will be affected.  A plane mask is a pixel value in which (usually) 1's specify affected planes and 0's specify unaffected planes.  Thus pixmaps with n-bit pixel values can be treated as having n different 'bit-planes'.  For example an 8-bit-pixel pixmap can be used to hold two 4-bit-pixel images or four 2-bit-pixel images.
  • 34.
    Lecture4 CSC 406- Computer Graphics 34 Raster Ops…summary  Among other things, raster-ops enabled draggable icons, sprites (animated icons) and a whole generation of computer games using 2D graphics operations to achieve cheap-and-cheerful pseudo- 3D effects.  Multiple window user interfaces make extensive use of raster-ops.  The X window system has long done this with particular efficiency, both in using raster-ops in conjunction with advanced repainting algorithms and in making raster-op functionality accessible to applications programmers.
  • 35.
    Lecture4 CSC 406- Computer Graphics 35 Next Lecture…  Scan conversion.  Device independence/ normalization.