Unit 1 Basics of Computer Graphics
Unit 1 Basics of Computer Graphics
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
Text mode
• 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.H header file. 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.
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.
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.
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.
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 top to bottom as in raster scan. It is also called vector
display, stroke-writing display, or calligraphic display.
Picture definition is stored as a set of line-drawing commands in an
area of memory referred to as the refresh display file.
To display a specified picture, the system cycles through the set of
commands in the display file, drawing each component line in turn.
After all the line-drawing commands are processed, the system cycles
back to the first line command in the list.
Random-scan displays are designed to draw all the component lines of
a picture 30 to 60 times each second.
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
nonemissive displays.
The emissive displays are devices that displays, and light-emitting
diodes are examples of emissive displays.
Nonemissive displays use optical effects to convert sunlight or light
from some other source into graphics patterns.
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:
Disadvantages of an LCD’s:
Touch Screen
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.
Line Attributes
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
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.
Syntax:– rectangle(x1,,y1,x2,y2);
Example:– 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);
Virtual reality
1. Windows on World(WoW)
2. Immersive VR
3. Telepresence
Architecture of VR System
Input Processor
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 the virtual
world.
Rendering Processor
– 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:
• Education:
• Gaming: