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

Computer Graphics

Uploaded by

Charles Wanjiru
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Computer Graphics

Uploaded by

Charles Wanjiru
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

COMPUTER GRAPHICS/OUTPUT PRIMITIVE

Introduction
A computer Graphics can be anything like beautiful scenery, images, terrain, trees, or anything else that
we can imagine, however all these computer graphics are made up of the most basic components of
Computer Graphics that are called Graphics Output Primitive or simply primitive. The Primitives are the
simple geometric functions that are used to generate various Computer Graphics required by the User.
Some most basic Output primitives are point-position (pixel), and a straight line. However different
Graphic packages offers different output primitives like a rectangle, conic section, circle, spline curve or
may be a surface. Once it is specified what picture is to be displayed, various locations are converted
into integer pixel positions within the frame buffer and various functions are used to generate the
picture on the two dimensional coordinate system of output display.

Computer Screen Coordinates


In video monitors Locations are referenced using Integer Screen coordinates which corresponds to the
pixel positions in the frame buffer. These coordinates gives us the Column Number(x) and Scan Line
Number(y). During screen refreshing the address of pixel along with other information stored in frame
buffers are used to generate the pixel on the screen with respect to the top left corner of the screen.
However it is possible to modify the origin of the coordinate system using various software commands
or hardware controls. A frame buffer stores the pixel location and other information such as intensity,
color of the pixel position that is to be generated on the screen.

Absolute and Relative Coordinate


The address stored in the Frame Buffer can be absolute or relative. There are various graphics packages
that allows the location of Output primitive to be declared using relative Coordinate. This type of
method is used for various graphics application, used for producing drawings etc. In this type of
coordinate system every pixel location is defined using offset which is added to last pixel position.

Point Function A point function is the most basic Output primitive in the graphic package. A point
function contains location using x and y coordinate and the user may also pass other attributes such as
its intensity and color. The location is stored as two integer tuple. The color is defined using hex codes.
The size of a pixel is equal to the size of pixel on display monitor.

A Line Function
A line function is used to generate a straight line between any two end points. Usually a line function is
provided with the location of two pixel points called the starting point and the end point and it is upto
the computer to decide what pixels fall between these two points so that a straight line is generated.

Line Drawing Algorithms


When a computer need to determine the positions of pixel that falls between two given points to
generate a straight line it requires some algorithm. There are many methodologies that used to draw
the line. The most commonly used are DDA and Bresenhams line drawing algorithm. Line DDA basically
takes the 2 end points of a line and then inputs pixel one at a time on the path.
GRAPHICS DISPLAY TECHNIQUES
COLOR DISPLAY TECHNIQUES
In computer graphics several different mathematical systems exist which are used to describe colors.
The colors system used in computer graphics are typically known as primary 3 color system. Primary
colors are those which cannot be created by mixing other colors. With such system a color is defined by
specifying an ordered set of 3 values. Composite colors are created by mixing varying amount of 3
primary colors which results in the creation of new color.

Two categories of color display techniques are:


1. Additive color system:
Colors in additive systems are created by adding colors to black to create new colors. The more color
that is added to the black tends towards white. The presence of all the primary colors in sufficient
amount creates pure white while the absence of all the primary colors creates pure black. Additive
colors environments are self-luminous. For example, an image displayed on the screen uses additive
color system.

2. Subtractive color system:


The subtractive color system is opposite of additive color system. Conceptually primary colors are
subtracted from white to create new colors. The more colors that are subtracted tend towards black.
Thus the presence of all primary colors creates pure black.

In computer graphics the following color systems are widely used:


(i) RGB – Red, Green, Blue
RGB color system is widely used in color systems for images formats nowadays. It is an additive color
system in which different amounts of the color are added to black to produce new colors. The graphics
format which follows the RGB color system uses a combination of 3 digits to represents a color instance.
This 3 digit combination is representation is known as triplet.
0 0 0 ------- Black
112
222
|||
255 255 255 ---- White

(ii) CMY – Cyan, Magenta, Yellow


CMY is a subtractive color system used by printers and photographers for the color with ink and
emulsion normally on a white surface. It is used by most hard copy devices that deposit the color on
white paper such as laser and inkjet printers.

(iii) HSV – Hue, Saturation, Value


HSV color system is one of many color system that vary the degree of properties of colors to create new
colors, rather than using a mixture of the colors themselves. Here the hue color specifies the common
use of colors such as red, orange, etc. The saturation refers to the amount of white in a hue and the
value is called brightness. So the HSV is also called as HSB where H is hue, S is saturation and B is
brightness.
(iv) HLS – Hue, Lightness, Saturation
The HLS color system is closely related to HSV and behaves in the same way. There are several other
color systems that are similar to HSV in that they create color by altering hue with 2 other values. That
includes:
H S I: Hue, Saturation, and Intensity
H S L: Hue, Saturation, and Luminosity
H B L: Hue, Brightness, and Luminosity

GRAPHICS DISPLAY TECHNOLOGIES AND INTERACTIVE DEVICES


(a) Graphics display technologies. They include:
Vector Displays
Raster Displays
CRT
LCD
Plasma Panels
LED
Electroluminescent displays
Three-primary color raster scan
(i) Vector Displays
-Vector graphics terminals are computer graphics displays that draw lines instead of bitmapped images.
A bitmap image is a collection of pixels with different colors and weights.
-In a vector display, also called Random Scan system, stroke-writing, or calligraphic the electron beam
directly draws the picture.

Advantages of random scan:


i. Very high resolution, limited only by monitor
ii. Easy animation, just draw at different positions
iii. Requires little memory (just enough to hold the display program)
Disadvantages of random scan:
i. requires "intelligent electron beam, i.e., processor controlled
ii. Limited screen density before have flicker, can't draw a complex image
iii. Limited color capability (very expensive)

(ii) Raster graphics


-Use pixels to draw graphics.

- A raster graphics image or bitmap is a data structure representing a generally rectangular grid of pixels,
or points of color, viewable via a display medium.
-A bitmap corresponds to a bit-for-bit with an image displayed on a screen, generally in the same
format used for storage in the display's video memory, or maybe as a device-independent bitmap.
Bitmap is technically characterized by the width and height of the image in pixels and by the number of
bits per pixel (a color depth, which determines the number of colors it can represent).

- This memory area holds the intensity values for all screen points. The intensity values are read from
memory area and used to ‗paint‘each point on the screen one row at a time. This row is called a scan
line and each point is called a pixel (picture element). The ordering of pixels by rows is known as raster
order, or raster scan order.

-In a raster scan display system the electron beam is swept across the screen one row at a time from
top to bottom and from left to right. As the electron beam moves across each row, the beam intensity
is turned on or off to create a pattern of illuminated spots.
-The spots to be turned on are dependent on the picture to be drawn. The definition of this picture is
stored in a memory area called the refresh buffer or frame buffer.

-Rasterization-The term rasterization can in general be applied to any process by which vector
information can be converted into a raster format. In normal usage, the term refers to the popular
rendering algorithm for displaying three-dimensional shapes on a computer. Rasterization is currently
the most popular technique for producing real-time 3D computer graphics. Compared to other
rendering techniques such as ray tracing, rasterization is extremely fast. However, rasterization is
simply the process of computing the mapping from scene geometry to pixels and does not prescribe a
particular way to compute the color of those pixels.

-Interlacing- It‘s a method of encoding a bitmap image such that a person who has partially received it
sees a degraded copy of the entire image. When communicating over a slow communications link, this
is often preferable to seeing a perfectly clear copy of one part of the image, as it helps the viewer
decide more quickly whether to abort or continue the transmission.
-Interlacing is supported by the following formats:
i. GIF graphics interchange format
ii. PNG Portable Network Graphics
iii. JPEG Joint Photographic Experts Group. The group realized a need to make large photographic
files smaller,
iv. PGF (Progressive Graphics File) is a wavelet-based bitmapped image format that employs lossless
and lossy data compression.

-Interlacing is also known as "progressive" encoding, because the image becomes progressively clearer
as it is received.

TYPES OF RASTER DISPAYS


(i) Cathode Ray Tube e

i. Control grid – determines the rate at which the electron will pass thro.
ii. Electron beam- electrons travel without any hindrance from the air/dust as the tube is a vacuum.
iii. Phosphor coated screen – It glows when struck by electrons.
iv. Conductive coating - to soak up the electrons that pile up at the screen-end of the tube.
v. Focusing anode – It attracts scattered electron to a focal point.
vi. Accelerating anode – It gives the anode a high velocity so that we can use the velocity/momentum
to give the light we want.

CRT Monitors
-A CRT monitor contains millions of tiny red, green, and blue phosphor dots that glow when struck by
an electron beam that travels across the screen to create a visible image.
-In a cathode ray tube, the "cathode" is a heated filament. The heated filament is in a vacuum created
inside a glass "tube." The "ray" is a stream of electrons generated by an electron gun that naturally pour
off a heated cathode into the vacuum. Electrons are negative. The anode is positive, so it attracts the
electrons pouring off the cathode. This screen is coated with phosphor, an organic material that glows
when struck by the electron beam.
- There is a conductive coating inside the tube to soak up the electrons that pile up at the screen-end of
the tube.
-There are three ways to filter the electron beam in order to obtain the correct image on the monitor
screen: shadow mask, aperture grill and slot mask. These technologies also impact the sharpness of the
monitor's display. They are:
1. Shadow-mask -A shadow mask is a thin metal screen filled with very small holes. Three electron
beams pass through the holes to focus on a single point on a CRT displays' phosphor surface. The
shadow mask helps to control the electron beams so that the beams strike the correct phosphor at just
the right intensity to create the desired colors and image on the display. The unwanted beams are
blocked or "shadowed."

2. Aperture-grill -Monitors based on the Trinitron technology, which was pioneered by Sony, use an
aperturegrill instead of a shadow-mask type of tube. The aperture grill consists of tiny vertical wires.
Electron beams pass through the aperture grill to illuminate the phosphor on the faceplate. Most
aperture-grill monitors have a flat faceplate and tend to represent a less distorted image over the
entire surface of the display than the curved faceplate of a shadow-mask CRT. However, aperture-grill
displays are normally more expensive.

3. Slot-mask -A less-common type of CRT display, a slot-mask tube uses a combination of the shadow-
mask and aperture-grill technologies. Rather than the round perforations found in shadow-mask CRT
displays, a slotmask display uses vertically aligned slots. The design creates more brightness through
increased electron transmissions combined with the arrangement of the phosphor dots.

Advantages of phosphor
i. electron are easily knocked off to give light
ii. Once electrons starts losing energy, phosphor stay glowing for some time – persistence

-Persistence is defined as the time it takes for the emitted light from the screen to decay to 1/10th of
its origin in intensity. Lower persistence phosphor require higher refresh rates to maintain a picture on
the screen w/o flicker. The phosphor with low persistence is useful for animation. A high persistence
phosphor is useful for displaying high complex static pictures.
-Resolution-The max No. of points that can b displayed on the screen on a CRT w/o overlap is called
resolution. Typical resolution of high definition system is 1280 by 1024.
-Screen size- The physical size of a graphics monitor is given by the length on the screen diagonally n
normally quoted in inches.
-Aspect Ratio- It gives the ratio of vertical points to horizontal points necessary to produce equal length
lines in both direction of the screen.

(ii) Liquid Crystal Display (LCDs).


- In a LCD display, there are 2 polarizers i.e. vertical and horizontal polarizer.
i. A polarizer is a component that filters light. A vertical polarizer filters vertical component of light and
allow horizontal component of light thro.

ii. As light strikes the first filter, it is polarized. The molecules in each layer of the liquid crystal then
guide the light they receive to the next layer. As the light passes through the liquid crystal layers, the
molecules also change the light's plane of vibration to match their own angle. When the light reaches
the far side of is matched up with the second polarized glass filter, then the light will pass through. -
For a particular the liquid crystal substance, it vibrates at the same angle as the final layer of molecules.
If the final layer
voltage the liquid material at that intersection of electrons changes the orientation of that liquid crystal
of that intersection. The horizontal component is converted to a vertical component hence transmit
light.
If we apply an electric charge to liquid crystal molecules, they untwist. When they straighten out, they
change the angle of the light passing through them so that it no longer matches the angle of the top
polarizing filter. Consequently, no light can pass through that area of the LCD, which makes that area
darker than the surrounding areas.

(iii) FLAT PANEL DISPLAY

-Plasma Panel
The basic idea of a plasma display is to illuminate tiny, colored fluorescent lights to form an image. Each
pixel is made up of three fluorescent lights -- a red light, a green light and a blue light.
What is Plasma?
The central element in a fluorescent light is plasma, a gas made up of free-flowing ions (electrically
charged atoms) and electrons (negatively charged particles).
-Under normal conditions, a gas is mainly made up of uncharged particles. That is, the individual gas
atoms include equal numbers of protons (positively charged particles in the atom's nucleus) and
electrons. The negatively charged electrons perfectly balance the positively charged protons, so the
atom has a net charge of zero.
If you introduce many free electrons into the gas by establishing an electrical voltage across it,
negatively charged particles rush toward the positively charged area of the plasma, and positively
charged particles rush toward the negatively charged area.

In this mad rush, particles are constantly bumping into each other. These collisions excite the gas atoms
in the plasma, causing them to release photons of energy.
How the system works
-It‘s composed of 2 glass plates:
-The 1st plate is brought to the 2nd plate until the space between them is small. The edges are sealed
off and space is left with air. The air inside is then removed and replaced with the plasma gas (e.g
neon).
Properties of the gas
-Must produce light when ionized.
-Must be easily ionized.
-Produce the correct color of gas when ionized.

(b) INTERACTIVE DEVICES


- They are devices that help in input of data in the system and also help in giving out the processed
information. They include:
Mouse
Space balls – right handed co-ordinate system. The space ball doesn‘t move. It has a strain gauge that
measure the amount of pressure applied to the space ball to provide input.
Trackball – it‘s an upside down mouse
Touch pad
Touch panel

Data Structures
-The need to create, modify or manipulate individual portions of the picture without affecting other
parts of the same picture, makes it necessary to be:
1. Able to independently reference those individual portions of the picture.
2. Be able to specify certain attributes for the portion which are diff from those other parts.
3. Be able to make additional details to a part of the pic while making additional provision for storage
space etc.
-All this happens in any graphical implementation such as modeling, animation & comp aided design
application
-A data structure is a set of elements that are related to each other by a set of relations.
Edge – is defined by a set of surfaces (also defined by vertices)
Surface – is defined be a set of edges which are defined by a set of vertices.
Three different kinds of data structures can be used to construct an object. They are based on edges,
vertices & surfaces.
-Vertex data are coordinate values for each vertex in the object.
-Edge data consists of pointers back into the vertex table to identify the vertices for each polygon edge.
-Polygon table contain pointers back into the edge table to identify the edges for each polygon

S2
S1
Databases
-It‘s an organized collection of graphics& non-graphics data related to each other in the support of a
common purpose and is stored on secondary storage in a computer.
-A database therefore may be viewed as the implementation of data structures into the computer.
Thus a decision on the data structure has to be made first followed by the choice of a database to
implement such a structure.
-A graphics database must be able to store pictorial data in addition to textural & alpha numeric data.

You might also like