0% found this document useful (0 votes)
13 views

Lesson 4

The document is a presentation for the ICS 2311 Computer Graphics course at Jomo Kenyatta University, covering topics such as raster displays, frame buffers, and raster operations. It provides definitions, explanations, and key attributes related to raster memory and display technology. Additionally, it includes revision questions and exercises to reinforce learning.

Uploaded by

kevinnjuguna811
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Lesson 4

The document is a presentation for the ICS 2311 Computer Graphics course at Jomo Kenyatta University, covering topics such as raster displays, frame buffers, and raster operations. It provides definitions, explanations, and key attributes related to raster memory and display technology. Additionally, it includes revision questions and exercises to reinforce learning.

Uploaded by

kevinnjuguna811
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

JOMO KENYATTA UNIVERSITY

OF
AGRICULTURE & TECHNOLOGY
JKUAT SODeL

SCHOOL OF OPEN, DISTANCE AND eLEARNING


P.O. Box 62000, 00200
©2014

Nairobi, Kenya
E-mail: [email protected]

ICS 2311 Computer Graphics

JJ II LAST REVISION ON October 16, 2014


J I
J DocDoc I
Back Close
ICS 2311 Computer Graphics
This presentation is intended to covered within one week.
The notes, examples and exercises should be supple-
mented with a good textbook. Most of the exercises have
solutions/answers appearing elsewhere and accessible by
JKUAT SODeL

clicking the green Exercise tag. To move back to the same


page click the same tag appearing at the end of the solu-
tion/answer.
©2014

Errors and omissions in these notes are entirely the re-


sponsibility of the author who should only be contacted
through the Department of Curricula & Delivery
(SODeL) and suggested corrections may be e-mailed to
[email protected].
JJ II
J I
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 0
ICS 2311 Computer Graphics
JKUAT SODeL
©2014

JJ II
J I
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 1
ICS 2311 Computer Graphics
LESSON 4
Raster Displays - details

4.1. introduction
JKUAT SODeL
©2014

JJ II
J I
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 2
ICS 2311 Computer Graphics
4.2. Raster Memory:
Pixmap:
• A pixmap is storage for a whole raster of pixel values.
• Usually a contiguous area of memory, comprising one row
JKUAT SODeL

(or column) of pixels after another.


Bitmap:
©2014

• 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!
JJ II Pixrect:
J I • A pixrect is any ’rectangular area’ within a pixmap. A
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 3
ICS 2311 Computer Graphics
pixrect thus typically refers to a series of equal-sized frag-
ments of the memory within a pixmap, one for each row
(or column) of pixels.

4.2.1. Frame Buffer:


JKUAT SODeL

• Frame buffers are often special two-ported memory devices


(’video memory’) with one port for writing and another for
©2014

concurrent reading.
• Alternatively they can be part of the ordinary fast RAM
of a computer, which allows them to be extensively recon-
figured by software.

JJ II
J I
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 4
ICS 2311 Computer Graphics
JKUAT SODeL
©2014

Defn:
JJ II A frame buffer is a video output device that drives a video
J I display from a memory buffer containing a complete frame of
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 5
ICS 2311 Computer Graphics
data.
The information in the buffer typically consists of color val-
ues for every pixel (point that can be displayed) on the screen.
Color values are commonly stored in:
JKUAT SODeL

• 1-bit monochrome,
• 4-bit palettized,
• 8-bit palettized,
©2014

• 16-bit highcolor and


• 24-bit truecolor formats.
An additional alpha channel is sometimes used to retain infor-
mation about pixel transparency.
JJ II The total amount of the memory required to drive the frame
J I buffer depends on the resolution of the output signal, and on
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 6
ICS 2311 Computer Graphics
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.
JKUAT SODeL

With a vector display, only the vertices of the graphics prim-


itives are stored.
The electron beam of the output display is then commanded
©2014

to move from vertex to vertex, tracing an analog line across the


area between these points.
With a framebuffer, the electron beam (if the display tech-
nology uses one) is commanded to trace a left-to-right, top-to-
bottom path across the entire screen, the way a television ren-
JJ II ders a broadcast signal.
J I
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 7
ICS 2311 Computer Graphics
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).
Option1: Frame buffer is anywhere in system memory
JKUAT SODeL
©2014

JJ II
J I
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 8
ICS 2311 Computer Graphics
Option2: Permanent place for frame buffer
JKUAT SODeL
©2014

With respect to color displays, there are two types of frame


buffers:
1. Direct color frame buffer
JJ II
J I 2. Color lookup frame buffer
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 9
ICS 2311 Computer Graphics
the frame buffer refresh rate is ussually 60-120hz

4.3. Raster memory cont. . .


In a bit-mapped display, the display processor refreshes the
JKUAT SODeL

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
©2014

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
JJ II an a-buffer (combining both ideas).
J I
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 10
ICS 2311 Computer Graphics
4.3.1. Key Attributes of Raster Displays:
•.1. Major attributes that vary between different raster displays
include the following:
1. ’Colour’: bi-level, greyscale, pseudo-colour, true colour:
JKUAT SODeL

Refer to ’pixel values’ in lecture3


2. Size: usually measured on the diagonal: inches or degrees;
©2014

3. Aspect ratio: now usually 5:4 or 4:3 (625-line TV: 4:3;


HDTV: 5:3);
4. Resolution: e.g. 1024×1280 (pixels). Multiplying these
numbers together we can say e.g. ’a 1.25 Mega-pixel dis-
play’. Avoid terms such as low/medium/high resolution
JJ II which may change over time.
J I 5. Pixel shape: now usually square; other rectangular shapes
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 11
ICS 2311 Computer Graphics
have been used.
6. Brightness, sharpness, contrast: possibly varying signifi-
cantly with respect to view angle.
7. Speed, interlacing: now usually 50 Hz or more and flicker-
JKUAT SODeL

free to most humans;


8. Computational features, as discussed next...
©2014

• Computational features:
Since the 1970s, raster display systems have evolved to offer in-
creasingly powerful facilities, often packaged in optional graphics
accelerator boards or chips.
These facilities have typically consisted of hardware imple-
JJ II mentation or acceleration of computations which would other-
J I wise be coded in software, such as:
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 12
ICS 2311 Computer Graphics
Raster-ops: fast 2D raster-combining operations explained
next;
2D scan conversion, i.e. creating raster images required by
2D drawing primitives such as:
JKUAT SODeL

• 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
©2014

with colour interpolation;


• Text (often copied from rasterised fonts using raster-ops);
3D graphics acceleration - now often including 3D scan conver-
sion.
It is useful for graphics software developers to be aware of
JJ II such features and how they can be accessed, and to have insight
J I into their cost in terms of time taken as a function of length or
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 13
ICS 2311 Computer Graphics
area.

4.3.2. Raster Ops:


’Raster Ops’ are logical operations affecting multiple pixels in a
JKUAT SODeL

pixmap (or raster frame buffer).


Raster graphics terminals typically have special hardware
which executes Raster Ops very quickly.
©2014

A raster-op assigns to a destination pixrect D a logical func-


tion 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.
All bits in a destination pixel are processed in parallel.
JJ II • So each bit in a destination pixrect D is assigned the spec-
J I ified logical function of its initial value and the value of
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 14
ICS 2311 Computer Graphics
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
JKUAT SODeL

may be used,
The functions commonly used are 0 (clear), 3 (copy), 6 (xor),
a (invert) and f (set), especially copy.
©2014

• 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
JJ II object over it, then copying back the saved image and re-
J I peating this process for further positions and states of the
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 15
ICS 2311 Computer Graphics
moving object.
The basic raster-op scheme is often extended as follows:
• By the use of a clip mask to distinguish between desti-
nation pixels the raster-op affects and destination pixels
JKUAT SODeL

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 in-
©2014

dependent source and destination pixrects. In some cases


a clip mask and a colour may be used as an alternative to
a source pixrect.
By the use of a plane mask to limit the planes of a frame buffer
that will be affected.
JJ II • A plane mask is a pixel value in which (usually) 1’s specify
J I affected planes and 0’s specify unaffected planes.
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 16
ICS 2311 Computer Graphics
• 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.
JKUAT SODeL

Among other things, raster-ops enabled draggable icons, sprites


(animated icons) and a whole generation of computer games us-
ing 2D graphics operations to achieve cheap-and-cheerful pseudo-
©2014

3D effects.
Multiple window user interfaces make extensive use of raster-
ops.
• The X window system has long done this with particu-
lar efficiency, both in using raster-ops in conjunction with
JJ II advanced repainting algorithms and in making raster-op
J I functionality accessible to applications programmers.
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 17
ICS 2311 Computer Graphics
Revision Questions

Example . define a frame buffer and describe the type of


information it consists
Solution:
JKUAT SODeL

frame buffer is a video output device that drives a video


©2014

display from a memory buffer containing a complete frame of


data.
The information in the buffer typically consists of color val-
ues for every pixel (point that can be displayed) on the screen.
Color values are commonly stored in:
1-bit monochrome,
JJ II
4-bit palettized,
J I
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 18
ICS 2311 Computer Graphics
8-bit palettized,
16-bit highcolor and
24-bit truecolor formats.
. 
JKUAT SODeL

Exercise 1.  ...
©2014

JJ II
J I
J DocDoc I
JKUAT: Setting trends in higher Education, Research and Innovation

Back Close 19

You might also like