niit, 5th sem common question answer on graphics and multimedia.pdf
TRANSCRIPT
-
7/27/2019 NIIT, 5th sem Common question answer on graphics and multimedia.pdf
1/3
C .. Explain the principle of DVST system. Ans. TheDirect View Storage Tube (DVST) behaves like a CRT
with highly persistent phosphor. Pictures drawn on this
4 0screen will be seen for several minutes ( -5 0 minutes)
before fading. It i s similar to a CRT as far as the electronic
gun and phosphor-coated mechanisms are concerned.
However, instead of the electron beam directly writing the
pictures on the p hosphor coated CRT s creen, the writi ng is
done with the help of a fine-mesh wire grid. The grid made
of very thin, high quality wire is located with a dielectric
and is mounted just before the screen on the path of the
electron beam from the gun. A pattern of positive charges
is deposited on the grid and this pattern is transferred to the
phosphor coated CRT by a continuous flood of electrons.
This flood of electrons is mounted by a "flood gun", which
is separate from the electron gun that produces the main
electron beam. . C .Compare the merits and demerits ofraster and random scanning system. Ans. In raster scan
display, the electron beam is swept across the screen, one
row at a time from top to bottom. Random scan monitors
draw a picture one line at a time and so they are also
referred to as vector displays.
Refreshing on raster scan
display is carried out 6 0 8 0at the rate of to -frames per
second. Refresh rate on a random scan system depends on
the number of lines to be displayed.
The picture
definition is stored in a memory area called refresh buffer
or frame buffer in case of a raster scan display. In case of
random scan display, picture definition is stored as a set of
line-drawing commands in an area of memory referred to
as the refresh display file. Refresh display file is also called
the display list, display program, or the refresh buffer
3C . Develop a C program to draw a structure of a fishand give animation. Ans.
#include #include
#include #include #include
void main() {
int gdriver=DETECT,gmode; int i;
initgraph(&gdriver,&gmode,"e:\\tc\\bgi"); int
2 0max_y=getmaxy()/ ; i= ; setcolor(BLUE); while(!kbhit())
{
0 3 0 , 0l ine( +i,max_y+ +i,max_y-3 0 ); /*triangle*/
0 3 0 , 3 0 0l ine( +i,max_y+ +i,max_y) ; l ine( +i,max_y-
3 0 , 3 0 9 0 0 , 3 6 0 , 6 0 , 3 5+i,max_y); ellipse( +i,max_y, );
1 2 0c ircle( +i,max_y-5 , 5 3 6 3 5 0) ; i=i+ ; if (i>= ) i= ; de la y1 0 0( );
cleardevice();
} getch(); closegraph();
} Inform the students that the path e:\\tc\\bgi should be
changed according to the machine settings. The code given
3 . 0here has been tested on Turbo C .
4C . What is multimedia? Ans. Multimedia can be definedas presentation of information with integration of multiple
media elements that can be used on and manipulated by
computer. This media includes graphic software, video,
audio, animation software, and computer hardware such as
CD players, scanners and cameras.
3C List the different graphics functions along withexample. Ans. C supports various graphics functions, such
as: 1 1 2 2line(int x , int y , int x , int y ): This draws a line
1 1 2 2from position (x , y ) to (x , y ) Example:
1 0 , 5 0 , 1 0 , 1 0 0line( ); 1 1 2 2bar(int x , int y , int x , int y ): This
1 1draws a filled rectangle with diagonal from (x , y ) to
2 2 1 0 , 2 5 , 1 0 0 , 7 5(x ,y ) bar( ) circle(int x, int y, int r): This
draws a circle with center at (x, y) and radius of r.
5 0 , 5 0 , 1 0Example : c ir cle( ) a rc (int x, int y , int star t, int
end, int r): This draws an arc of circle with the center at
(x,y), radius r and start and end specified in degrees to
mention the portion of the circle that forms the arc.
1 0 0 , 1 0 0 , 0 , 9 0 , 2 0Example: arc( ) draws the first quarter of
1 0 0 , 1 0 0 2 0the c ir cle, a rc with cente r ( ) and rad ius .
C4 . Explain the meaning of the following terms:Morphing, Rendering, Wrapping. Ans. Morphing: Itis the process of transformation of one image to another by
the transformation and distortion of corresponding points in
both the images. The best example will be Kaw asaki
advertisement where the motorbike changes into a cheetah.
Rendering: The process of converting your designed
objects with texturing and animation into an image or a
series of images is called rendering. Wrapping: It is the
process where certain part s of the image co uld be marked
for a change and made to change to different one for
example legs of cheetah to be morphed with the wheels and
head with head lights. Head can alone be marked and
wrapped.
C . Define pixel, resolution, and aspect ratio. Ans. Pixelcan be defined as the smallest size object or color spot that
can be displayed and addressed on a monitor.
Image
resolution refers to pixel spacing that is the distance from
one pixel to the next pixel.
The aspect ratio of theimage is the ratio of the number of X pixels to the number
of Y pixels. The standard aspec 4 : 3t ratio for PCs is and
5 : 4some use .
C . Explain the working of Light pen along with a
diagram. Ans. Light pen has a very simple working. Every
pixel on the screen that is a part of the picture em its light.
All that the light pen does is to make use of this light signal
to indicate the position. A small aperture is held against the
portion of the pi cture to be modi fied and the li ght from the
pixels falls on a photocell, after passing through the
aperture. This photocell converts the light signal received
from the screen to an electrical pulse to be sent as a signal
sent to the computer. Since the electrical signal is rather
weak, an amplifier amplifies it before being sent to the
computer.
A "tracking software" keeps track of the
position of the light pen alw ays. Through the us e of the
tracking software, a signal received by the light pen at any
point indicat es the portion of t he picture that needs to be
modified.
Note that, when the pen is being moved to itsposition, to the position w here the modificat ion is required,
it will encounter various other light sources on the way.
These light sources should not trigger the computer to
accept the signal. So the aperture of the light pen is
normally kept closed till the final position is reached, and
then it can be opened by a switch.
3C . Explain the use of getimage() and putimage() withexamples? Ans. The getimage() function captures the
image inside the rectangle whose diagonal is defined by
1 1 2 2 1 1 2 2(x , y ) , and (x ,y ) ,where x , y , x , and y a re the f ir st
four parameters of getimage(). The captured image isstored in an array, which is specified as the last parameter
of getimage().
For example, to capture a rectangle
1 0 5 0 5 0 1 2 5whose diagonal is defined by ( , ) and ( , ), you
can use the getimage() function as:
1 0 , 5 0 , 5 0 , 1 2 5int area = imagesize( );
unsigned char * buf = malloc(arear);
1 0 , 5 0 , 5 0 , 1 2 5getimage( , buf);
The putimage() function copies the image captured using
getimage(), starting at location (x, y), where x and y are
the first two parameters of this function. The image to be
captured is specified as the third parameter. The fourth
parameter of this funct ion specifies how the image has t o
be copied and takes any of the follow ing values:
0COPY_PUT or , which copies the image as it is
XOR_PUT o 1r , which performs an exclusive OR between
the background pixels and the image pi xels OR_PUT or2 , which performs an inclusive OR between the
background pixels and the image pi xels 3AND_PUT or ,
which performs an AND between the background pixels
and the image pixels 4NOT_PUT or , which invert s the
pixels of the i mage.
For e xample, animat e a rectangle
as it is you can use the COPY_PUT option in putimage:
1 0 , 5 0putimage( , buf, COPY _PUT);
4C . What is animation? Explain different types ofanimation techniques. Ans. Animation is the process in
which each frame of a film or movie is produced
individually and viewed in rapid succession to give an
illusion of continuous movement. On PCs the two maintypes of animation techniques are as follows: Object
animation: Is the moment of unchanged text and object
around the screen Cell animation/Frame animation: Is
made of different frames on screen where they are rapidly
displayed to simulate motion.
5C . What are editing Tools? Ans. Editing tools are usedto fine-tune or modify graphic elements. Photoshop
delivers high-powered image editing, photo retouching, and
composition tools. It also supports features, such as
Making Color Adjustments, Auto Color Command,
Adjustment Layers and Fill Layers, and Masking Layers to
help you get professional-quality results. 5C . What is FileFormat? Name the different image file formats? Ans.
The method by which the software organizes the data in the
saved file is called the file format. The file name extension
or suffixes indicate the format or usage of a file and a brief
description of that format. Several different types of file
format are used by various kind of software to save files.
For example, the GIF file format used for Web pageimages are standard formats that can be opened by any
program that support s it.
The various image fil e format
are as follows: Tagged-Image File Format (TIFF)
Graphics Interchange Format (GIF) Joint Photographic
Experts Group (JEPG) Encapsulated PostScript (EPS)
Portable Document Format (PDF) Portable Network
Graphics (PNG) TGA- Targa
-
7/27/2019 NIIT, 5th sem Common question answer on graphics and multimedia.pdf
2/3
5C . Give the steps to use rubber stamp tool. Ans. To usethe rubber stamp tool (Clone tool), perform the following
steps: 1 )Open the image that you want to clone. 2 )Select
rubber stamp tool. 3 )Select an appropriate brush size and
style from the Brush drop down in the options bar at the
top. Also set values for other options such as blending
mode, opacity, and flow. Determine how you want to align
the sampled pixels. If you select Aligned, you can release
the mouse button without losing the current sampling point.
As a result, the sampled pixels are applied continuously, no
matter how many times you stop and resume painting. If
you deselect Aligned, the sampled pixels are applied from
the initial sampling point each time you stop and resume
painting. Selec t Use All L ayers to sample dat a from all
visible layers; deselect Use All Layers to sample only from
the active layer. 4 )Press Alt and click the image that you
want to clone, to select the source point for cloning. 5 )Usethe brush to clone the image by dragging the mouse on
another area. The image will be cloned in that area.
. What is sampling? Sampling is like breaking a sound
into tiny piece and storing each piece as a small, digital
sample of sound. The rate at which a sound is Sampled
can affect its quality. The higher the sampling rate (the
more pieces of sound that are stored) the better the quality
of sound. Higher quality of sound will occupy a lot of
space in hard disk because of more samples.
C Explain the working of Light pen along with a
diagram. Ans. Light pen has a very simple working. Every
pixel on the screen that is a part of the picture emi ts light.
All that the light pen does is to make use of this light signal
to indicate the position. A small aperture is held against the
portion of the picture to be mo dified and the l ight from the
pixels falls on a photocell, aft er passing through t he
aperture. This photocell converts the light signal received
from the screen to an electrical pulse to be sent as a signal
sent to the computer. Since the electrical signal is rather
weak, an amplifier amplifies it before being sent to the
computer.
A "tracking software" keeps track of the
position of th e light pen alw ays. Through the use of the
tracking software, a signal received by the light pen at any
point indicat es the portion of the picture that needs to be
modified.
Note that, when the pen is being moved to its
position, t o the position where the modific ation is required,it will encounter various other light sources on the way.
These light sources should not trigger the computer to
accept the signal. So the aperture of the light pen is
normally kept closed till the final position is reached, and
then it can be opened by a switch.
C . Explain briefly the working principle of Shadow
mask CRT. Ans. The Shadow Mask CRT is based on the
principle of combi ning the basic colors - red, green and
blue. The shadow mask CRT, inst ead of using one el ectron
gun, uses three different guns placed adjacent to each other
to form a triangle or a "Delta". Each pixel point on the
screen is made up of three types of phosphors to produce
red, blue, and green colors. Just in front of the phosphor
screen, is a metal screen, called a "shadow mask". This
plate has holes pl aced strategically, so that the beam s from
the three electron guns are focused on particular color-
producing pixel onl y.
Now, unlike the beam
penetration CRTs, the acceleration of the electron beam
was being monitored, one can manipulate the intensity of
the three beams simultaneously. If the red beam is made
more intense, we get more of red color in the final
combination etc. Since fine-tuning of the beam intensitiesis comparatively simple, we can get much more
combination of colors than the beam penetration case.
6 . What are the different gra phical input interactivetechniques? Ans. Following are the various graphical input
interactive techniques: 1 )Positioning 2 )Constraints 3 )Grids
4 )Gravity Field 5 )Rubber band methods 6 )Dragging
3C . Write a C program to create Indian national flag.#include"graphics.h"
#include"conio.h"
void main(){int
gd=DETECT,gm,x,y;initgraph(&gd,&gm,"c:\\tc\\bgi");x=getmaxx();y=getmaxy();clearviewport();
setfillstyle(LINE_FILL,BLUE); 0 , 0 , 6 3 9 , 4 7 9bar( );
6setcolor( ); 5 0 , 5 0 , 3 0 0 , 2 0 0rectangle( );
6setfillstyle(SOLID_FILL, );
5 0 , 5 0 , 3 0 0 , 1 0 0bar( );setfillstyle(SO LID_FILL,WHITE);
5 0 , 1 0 0 , 3 0 0 , 1 5 0bar( );setfillstyle(SO LID_FILL,GREEN );
5 0 , 1 5 0 , 3 0 0 , 2 0 0bar( ); setcolor(BLUE);
4 5 , 4 5 , 5 0 , 3 0 0rectangle( ); 0 2 0setfillpattern( x ,MAGENTA);
4 5 , 4 5 , 5 0 , 4 0 0bar( ); setcolor(BLUE);
1 7 5 ,1 2 5 , 2 5 1 7 5 , 1 2 5 , 2 0 0 , 1 2 5circle( );line( );
1 7 5 , 1 2 5 , 1 7 5 , 1 5 0line( );
1 7 5 , 1 2 5 , 1 5 0 , 1 2 5line( );
1 7 5 , 1 2 5 , 1 7 5 , 1 0 0line( );
1 7 5 , 1 2 5 , 1 5 9 , 1 0 7line( );
1 7 5 , 1 2 5 , 1 9 3 , 1 4 3line( );
1 7 5 , 1 2 5 , 1 5 9 , 1 4 3line( );
1 7 5 , 1 2 5 , 1 9 3 , 1 0 7line( );
setcolor(YELLOW);
0 , 0 ,6 4 0 , 4 3rectangle( );
setfillstyle(SOLID_FILL,YELLOW);0 , 0 ,6 4 0 , 4 3bar( );
setcolor(BLACK);
settext 1 5style( ,HORIZ_DIR, );
1 5 0 , 0outtextxy( ,"INDIAN FLAG") ;
getch();
}
. What is the need for computer graphics?Computers
have become a powerful tool for the rapid and economical
production of pictu res. Computer Grap hics remains one of
the most exciting and rapidly growing fields. Old Chinese
saying One picture is worth of thousand words can bemodified in this computer era into One picture is worth of
many kilobytes of data. It is natural to expect that
graphical communication, which is an older and more
popular method of exchanging informati on than verbal
communication, will often be more convenient when
computers are utilized for this purpose. This is true because
one must represent objects in two-dimensional and three-
dimensional spaces. Computer Graphics has revolutionized
almost every computer-based application in science and
technology.
C .Define resolution.Ans:Image resolution refers as the
pixel spacing i .e. the distanc e from one pixel t o the next
pixel. A t ypical PC moni tor displays screen i mages with a
2 5 8 0resolution somewhere between pixels per inch and
pixels per inch. Pixel is the sm allest element of a displayed
image, and dots (red, green and blue) are the smallest
elements of a display surface (monitor screen). The dot
pitch is the m easure of screen resolutio n. The smaller t he
dot pitch, the higher the resolution, sharpness and detail ofthe image displayed.
4 . Why C language is popular for graphicsprogramming?
Turbo C++ is for C++ and C programmers. It is also
compatible with ANSI C standard and fully
supports Kernighan and Ritchie definitions. It includesC++ class libraries, mouse support, multiple overlapping
windows, Multi file editor, hypertext help, far objects and
error analysis. Turbo C++ comes with a complete set of
graphics functions to facilitate preparation of charts and
diagrams. It supports the same graphics adapters as turbo
7 0Pascal. The Graphics library consists of over graphics
functions ranging from high level support like facility to set
3view port, draw -D bar charts, draw polygons to
bitoriented functi ons like get i mage and put i mage. The
graphics library supports numerous objects, line styles and
provides several text fonts to enable o ne to justify and
orient text, horizontally and vertically. It may be noted that
graphics functions use far pointers and it is not supported in
the tiny memory model. 3C . How can you make an object
animate infinitely till you press the Enter key to exit?
Ans: You can make an object animate till you hit a key
using the kbhit() function. When this function is called it
returns true if an input character is available in the read
buffer for reading. If there i s nothing to be read, it returns
false. You can use this function as:
1int continue = ; while(continue) {
2 7if(kbhit()) { ch = getch(); if(ch == ) break;
} else { //animation code
}
}
-
7/27/2019 NIIT, 5th sem Common question answer on graphics and multimedia.pdf
3/3
9 . Give the steps to use the image printing utility of Photoshop? Ans. In Photoshop,you can print a complete image, selected area of an image, or even one or more layers.
To print a complete image, select File --> Print from the main menu (or press Ctrl
+ P).
Ensure that the All radio button is selected. You can also set the print
resolution by selecting it from the Print Quality drop-down. After making the desired
print settings click OK to p rint.
To print a selected area, make a select ion in the
image using the Rectangular Marquee tool and select File >Print. Select the Selection
option button in the Print dialog box and click OK.
Note that by default, Photoshop
prints all visi ble layers and channel s. If you want t o print just cert ain layers or
channels, make them the only ones that are visible and then print.
You can also
choose to print the filename, along with crop marks, registration marks and a caption
6along with the image. To set such options, select File >Page Setup in Photoshop .
You can select the checkboxes if you want to include the corresponding options inthe printed image: Caption: Selecting this checkbox will print a caption with the
image. This caption can be set in the File Info dialog box. To open the File Info dialog
box select File > File Info, a nd choose Caption from the Section drop-down list. Type a
caption in the Caption text area and click OK . Calibration Bars: Select this
checkbox to print the calibration and color bars for your image. A calibration bar is a
1 1 1 1row of gray squares of different values. A color bar is a row of colors. These bars
can be helpful when trying to calibrate to a specific printer. This option is available
only for a PostScript printer. Registration Marks: Select this checkbox to print a
registration mark such as bull's eyes around the image. These marks can be helpful for
aligning color separations. Corner Crop Marks: Select this checkbox to view
horizontal and vertical lines around the corners of the image, defining where the image
should be trimmed. Center Crop Marks: Select this checkbox to view the exact
center of the image defined by two crossed lines. Labels: Select this checkbox to
print the file name next to t he image. Yo u can also print t he name of the ap propriate
color channel if you are using color separations. Negative: Select this checkbox to
print an image that appears like a negative of the original image . With this option
selected, the colors are reversed. Emulsion Down: Select this checkbox to print the
image as a horizontal mirror image of the original image. Interpolation:
Interpolation refers to a printer's ability to resample an image as they print it to improve
its resolution. This option is useful in case of low-resolution images.
The buttonson the left side also present some useful options such as printing a border around the
image and printing a background with the image.