Unit 1 Basics of Computer Graphics - Final
Unit 1 Basics of Computer Graphics - Final
CO1 :
Manipulate visual and geometric information of images
Pixel:
A pixel (short for picture element, using the common abbreviation "pix" for
"picture") is one of the many tiny dots that make up the representation of a
picture in a computer's memory.
The intensity of each pixel is variable; in color systems, each pixel has
typically three or four dimensions of variability such as red, green and blue,
or cyan, magenta, yellow and black.
Resolution
• Resolution is the number of rows that appear from top to bottom of a screen
and in turn the number of pixels or pixel elements that appear from left to
right on each scanline.
1
UNIT 1: BASICS OF COMPUTER GRAPHICS
Text mode
• Text mode is a personal computer display setting that divides the display
screen into 25 rows and 80 columns in order to display text without images.
• In text mode, each box can contain one character. Text mode is also known as
character mode or alphanumeric mode. In character mode, the display screen
is treated as an array of blocks, each of which can hold one ASCII character.
Graphics Mode
The graphics-mode functions allow you to draw dots, lines, and shapes (like
circles, rectangles, and ellipse etc.), add color to lines and areas, and
perform many other graphics-related activities.
detectgraph() : This function checks the system and returns two integer
parameters: a value representing the system's graphics driver and a value for the
recommended graphics mode if an adapter is installed.
The mode value is the highest resolution possible with that adapter. Syntax:
detectgraph(int *gdriver, int *gmode);
initgraph (): This library function must be executed before any other graphics
mode functions can be used.
This requires the GRAPHICS.Hheaderfile. Syntax: initgraph(int*driver, int
*mode, char *path);
where *driver is the graphics driver, given by an integer.
*mode is the graphics mode, given by an integer.
2
UNIT 1: BASICS OF COMPUTER GRAPHICS
Graphics Pipeline
The application step is executed by the software on the main processor (CPU), it cannot
be divided into individual steps, which are executed in a pipelined manner. However,
it is possible to parallelize it on multi-core processors or multi-processor systems. In
the application step, changes are made to the scene as required, for example, by user
interaction by means of input devices or during an animation. The new scene with all
its primitives, usually triangles, lines and points, is then passed on to the next step in
the pipeline.
The geometry step (with Geometry pipeline), which is responsible for the majority of
the operations with polygons and their vertices (with Vertex pipeline), can be divided
into the following five tasks. It depends on the particular implementation of how these
tasks are organized as actual parallel pipeline steps.
3
UNIT 1: BASICS OF COMPUTER GRAPHICS
The Rasterization step is the task of taking an image described in a vector graphics
format (shapes) and converting it into a raster image (pixels or dots) for output on a
video display or printer, or for storage in a bitmap file format. It refers to both
rasterization of models and 2D rendering primitives such as polygons, line
segments, etc.
Or
following Diagram can be used for above explanation
4
UNIT 1: BASICS OF COMPUTER GRAPHICS
Bitmap (or raster) images are stored as a series of tiny dots called pixels. Each pixel is
actually a very small square that is assigned a color, and then arranged in a pattern to
form the image. When you zoom in on a bitmap image you can see the individual
pixels that make up that image. The three most popular image formats used on the
Web (PNG, JPEG, and GIF) are bitmap formats. The bitmap format is excellent for
creating backgrounds and overlay elements.
Vector images are not based on pixel patterns, but instead use mathematical
formulas to draw lines and curves that can be combined to create an image from
geometric objects such as circles and polygons. All major browsers support the
SVG (Scalable Vector Graphics) format. Vector graphics are more flexible than bit-
maps because they can be easily re-sized. Vector-based graphics can be very useful
when creating large illustrations, as these graphics are resolution independent.
5
UNIT 1: BASICS OF COMPUTER GRAPHICS
6
UNIT 1: BASICS OF COMPUTER GRAPHICS
RASTER-SCAN DISPLAYS
In a raster scan system, the electron beam is swept across the screen,
one row at a time from top to bottom. As the electron beam moves across
each row, the beam intensity is turned on and off to create a pattern of
illuminated spots.
Picture definition is stored in memory area called the Refresh Buffer or
Frame Buffer. This memory area holds the set of intensity values for all the
screen points. Stored intensity values are then retrieved from the refresh
buffer and “painted” on the screen one row (scan line) at a time as shown in
the following illustration.
7
UNIT 1: BASICS OF COMPUTER GRAPHICS
Random-Scan Display
In this technique, the electron beam is directed only to the part of the screen
where the picture is to be drawn rather than scanning from left to right and
8
UNIT 1: BASICS OF COMPUTER GRAPHICS
9
UNIT 1: BASICS OF COMPUTER GRAPHICS
The term flat–panel displays refers to a class of video devices that have
reduced volume, weight, and power requirements compared to a CRT. A
significant feature of flat-panel displayed is that they are thinner than CRTs,
and we can hang them on walls or wear them on our wrists.
Flat-panel displays into two categories: emissive displays and non emissive
displays.
The emissive displays are devices that displays, and light-emitting diodes
are examples of emissive displays.
Non emissive displays use optical effects to convert sunlight or light from
some other source into graphics patterns.
10
UNIT 1: BASICS OF COMPUTER GRAPHICS
A matrix of diodes is arranged to form the pixel positions in the display, and picture
definition is stored in refresh buffer. As in scan- line refreshing of a CRT, information is
read from the refresh buffer and converted to voltage levels that are applied to the
diodes to produce the light patterns in the display.
• The working of the LED depends on the quantum theory.The energy of the
photons is equal to the gap between the higher and lower level.
• The LED is connected in the forward biased, which allows the current to flows
in the forward direction. The flow of current is because of the movement of
electrons in the opposite direction.
• The recombination shows that the electrons move from the conduction band to
valence band and they emit electromagnetic energy in the form of photons. The
energy of photons is equal to the gap between the valence and the conduction
band.
Advantages of LED’s
Disadvantages of LED
• The LED consumes more power as compared to LCD, and their cost is high. Also,
it is not used for making the large display.
Advantages of an LCD’s:
12
UNIT 1: BASICS OF COMPUTER GRAPHICS
Disadvantages of an LCD’s:
13
UNIT 1: BASICS OF COMPUTER GRAPHICS
Touch Screen
• A touch screen is a computer display screen that is also an input device. The
screens are sensitive to pressure; a user interacts with the computer by touching
pictures or words on the screen.
• There are three types oftouch screen technology:
Resistive
Surface wave
Capacitive
Output primitives
• 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.
• Line, polygon , marker , text.
14
UNIT 1: BASICS OF COMPUTER GRAPHICS
Line Attributes
• A straight-line segment can be displayed with three basic attributes: color, width,
and style. Additionally, lines may be generated with other effects, such as pen
and brush strokes.
• To set line type attributes in a PHICS application program, a user invokes the
function :setLinetype (It)
15
UNIT 1: BASICS OF COMPUTER GRAPHICS
Marker Attributes
Text Attributes
The attributes that can be assigned to text are common knowledge nowadays: Font
(e.g. Courier, Arial, Times, Broadway, …), style (normal, bold, italic, underlined,
…), size, text direction, color, alignment (left, right, centered, justified) and so on.
Attributes of Polygons
16
UNIT 1: BASICS OF COMPUTER GRAPHICS
Graphics Functions
Putpixel function is to draw the pixel on the screen. Pixel is small dot on the screen.
Example: – putpixel(100,100,BLUE);
Rectangle function is used to draw the rectangle on the screen. X1,y1 are the lower
left co-ordinates of the rectangle and the x2,y2 are the upper right co- ordinates of
the rectangle.
rectangle(100,100,200,200);
Syntax: line(x1,y1,x2,y2);
Example:-line(100,100,200,100);
Syntax:– circle(x,y,radius);
Example:-circle(100,100,50);
Example:-ellipse(100,100,90,200,20,20);
17
UNIT 1: BASICS OF COMPUTER GRAPHICS
Virtual reality
1. Windows on World(WoW)
2. Immersive VR
3. Telepresence
18
UNIT 1: BASICS OF COMPUTER GRAPHICS
Architecture of VR System
Input Processor
– Control the devices used to input information to the computer. The
object is to get the coordinate data to the rest of the system with
minimal lagtime.
Simulation Processor
– Core of a VR system.
– Takes the user inputs along with any tasks programmed into the world
and determine the actions that will take place in thevirtual world.
Rendering Processor
– Create the sensations that are output to the user.
– Separate rendering processes are used for visual, auditory, haptic and
other sensory systems. Each renderer takes a description of the world
stat from the simulation process for each time step.
19
UNIT 1: BASICS OF COMPUTER GRAPHICS
– Store the objects that inhabit the world, scripts that describe actions of
those objects.
Applications
Entertainment
Medicine
Manufacturing
Education & Training
– Head-mounted display
– Tracking system
• Military:
• Medical:
20
UNIT 1: BASICS OF COMPUTER GRAPHICS
• Education:
• Gaming:
21
UNIT 1: BASICS OF COMPUTER GRAPHICS
22