Kuvempu University

Assignments for B.Sc.(IT) & M.Sc.(IT) Courses Subject: Graphics & Multimedia Subject Code: BSIT – 51 Prepared By: Rajiv Phukan (ৰ জ ৱ ফকন) Assignment: TA (Compulsory) 1.W h a t i s t h e m e a n i n g o f i n t e r a c t i ve co m p u t e r g r a p h i c s ? L i s t t h e v a r i o u s a p p lic a t i o n s o f t h e co m p u t e r g r a p h ic s. The term “interactive graphics” refers to devices and systems that facilitate the manmachine graphic communication, in a way, which is more convenient than the writing convention. For example, to draw a straight line between two points, one has to input the coordinates of the two end points. In interactive graphics with the help of graphical input technique by indicating two end points on the display screen draws the line. Va r i o u s a p p l ic a t i o n s o f t h e co m p u t e r g r a p h i c s a r e li s t e d bel o w :i). Building Design and Construction ii). Electronics Design iii). Mechanical Design iv). Entertainment and Animation v). Aerospace Industry vi). Medical Technology vii). Cartography viii). Art and Commerce. 2. E x p l a i n i n d e t a i l t h e H a r d w a r e r e q u i r e d f o r e f f ec t i ve g r a p h i c s o n t h e co m p u t e r s y s t e m . The hardware components required to generate interactive graphics are the input device, the outputdevice (usually display) and the computer system. The human operator is also an integral part of theinteractive system. The text and graphics displayed act as an input to the human vision system and, therefore, the reaction of the human being will depend on how quickly one can see and appreciate thegraphics present on the display. 3. Co m p a re R a s ter scan s ys te m w i t h r a ndo m scan s y s te m. In raster scan display, the electron beam is swept across the screen, one row at a time from top to bottom. The picture definition is stored in a memory area called refresh buffer Pathsala (প ঠশ ল )

or frame buffer. In random scan display unit, a CRT has the electron beam directed only to the parts of the screen where a picture is to be drawn. It draws a picture one line at a time and so it is referred to as vector displays. R as ter scan The Most common type of graphics monitor employing a CRT is the raster-scan Display, based on television technology. In a raster- scan system; the electron beam is swept across the screen, one row at a time from top to bottom. The picture definition is stored in a memory area called the refresh buffer or frame buffer. Each point on the screen is called pixel. On a black and system with one bit per pixel, the frame buffer is called bitmap. For systems with multiple bits per pixel, the frame buffer is referred to as a pix map. Refreshing on raster scan display is carried out at the rate of 6 0 to 8 0 frames per second. Some displays use interlaced refresh procedure. First, all points on the even numbered scan lines are displayed then all the points along odd numbered lines are displayed. This is an effective technique for avoiding flickering. R a n d o m s c a n di s p l a y When operated as a random-scan display unit, a CRT has the electron beam directed only to the parts of the screen where a picture is to be drawn. Random scan monitors draw a picture one line at a time and for this reason they are also referred as vector displays (or stroke-writing or calligraphic displays). The component lines of a picture can be drawn and refreshed by a random-scan system in any specified order. A pen plotter operates in a similar way and is an example of a random-scan, hard-copy device. Refresh rate on a random-scan system depends on the number of lines to be displayed. Picture definition is now stored as a set of line- drawing commands in an area of memory referred to as the refresh display file. Sometimes the refresh display file is called the display list, display program, or simply the refresh buffer. 4. Ho w m a n y colo r s a r e p o s s i bl e i f a . 24 bi t s / p i xel i s u s e d b. 8 bi t s / p i xel i s u s e d J u s t i f y y o u r a n s w e r

a). 24 bit color provides 16.7 million colors per pixels, That 24 bits are divided into 3 bytes; one each for the read, green, and blue components of a pixel.

b). 256, 8 bits per pixel = 2^8 colours.
Widely accepted industry standard uses 3 bytes, or 24 bits, per pixel, with one byte for each primary color results in 25 6 different intensity levels for each primary color. Thus a pixel can take on a color from 25 6 X 25 6 X 25 6 or 16 .7 million possible choices. In Bilevel image representation one bit per pixel is used to represent black-and white images. In gray level image 8 bits per pixel to allow a total of 25 6 intensity or gray levels. Image representation using lookup table can be viewed as a compromise between our desire to have a lower storage requirement and our need to support a reasonably sufficient number of simultaneous colors. 5. L i s t a n d exp l ai n di f f e r e n t t ex t m o d e b u i l t-i n f u n c t i o n s o f C P r o g r a m m i n g l a n g u a g e. The different text mode built-in functions of C Programming language are listed below :i ) . t ex t m o d e ( i n t m o d e ); This function sets the number of rows and columns of the screen, mode variable can take the values 0, 1, 1, or 3 . 0: represents 40 column black and white 1: represents 40 column color 2: represents 8 0 column black and white 3 : represents 8 0 column color Example: textmode(2); // sets the screen to 8 0 column black and white ii ) . cl r s c r ( ) ; This function clears the entire screen and locates the cursor on the top left corner(1,1) Example clrscr(); // clears the screen iii ). go t ox y ( i n t x, i n t y ) ; This function positions the cursor to the location specified by x and y. x represents the row number and y represents the column number. Example: gotoxy(10,20) // cursor is placed in 20th column of 10th row i v ) . t ex t b a c k g r o u n d ( i n t colo r ) ; This function changes the background color of the text mode. Valid colors for the CGA are from 0 to 6 namely BLACK, BLUE, GREEN, CYAN, RED, MAGENTA and BROWN. Example: textbackground(2); Or //changes background color to blue textbackground(BLUE); v ) . t ex t colo r ( i n t colo r ) ; This function sets the subsequent text color numbered between 0 to 15 and 128 for

blinking. Example : textcolor(3 ); // set the next text color to Green v i ) . d elli n e ( ) ; It is possible to delete a line of text and after the deletion all the subsequent lines will be pushed up by one line Example : /* deletes the 5 th line*/ gotoxy (5 ,4); delline ( ); v i i ). i n s l i n e ( ) Inserts a blank line at the current cursor position Example: /* inserts line at the 3 rd row */ gotoxy (3 ,5 ); insline ( ); 6. W r i t e a C p r o g r a m t o c r e a t e I n d i a n n a t i o n a l f l a g. #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); bar(0,0,6 3 9,479); setcolor(6 ); rectangle(5 0,5 0,3 00,200); setfillstyle(SOLID_FILL,6 ); bar(5 0,5 0,3 00,100); setfillstyle(SOLID_FILL,WHITE); bar(5 0,100,3 00,15 0); setfillstyle(SOLID_FILL,GREEN); bar(5 0,15 0,3 00,200); setcolor(BLUE); rectangle(45 ,45 ,5 0,3 00); setfillpattern(0x20,MAGENTA); bar(45 ,45 ,5 0,400); setcolor(BLUE); circle(175 ,125 ,25 ); line(175 ,125 ,200,125 );

line(175 ,125 ,175 ,15 0); line(175 ,125 ,15 0,125 ); line(175 ,125 ,175 ,100); line(175 ,125 ,15 9,107); line(175 ,125 ,193 ,143 ); line(175 ,125 ,15 9,143 ); line(175 ,125 ,193 ,107); setcolor(YELLOW); rectangle(0,0,6 40,43 ); setfillstyle(SOLID_FILL,YELLOW); bar(0,0,6 40,43 ); setcolor(BLACK); settextstyle(1,HORIZ_DIR,5 ); outtextxy(15 0,0,"INDIAN FLAG"); getch(); }

Assignment: TB (Compulsory) 1. W h a t i s t h e n e ed f o r co m p u t e r g r a p h i c s ? Computers have become a powerful tool for the rapid and economical production of pictures. Computer Graphics remains one of the most exciting and rapidly growing fields. Old Chinese saying “ One picture is worth of thousand words” can be modified 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 information 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. 2. W h a t i s g r a p h i c s p r o ce s s o r ? W h y i t i s n eed e d ? To provide visual interface, additional processing capability is to be provided to the existing CPU. The solution is to provide dedicated graphic processor. This helps in managing the screen faster with an equivalent software algorithm executed on the CPU and certain amount of parallelism can

be achieved for completing the graphic command. Several manufacturers of personal computers use a proprietary graphic processor. For example, Intel 8 278 6 is essentially a line drawing processor; Texas Instruments 43 010 is a high performance general-purpose processor. 3 . W h a t i s a p i xel ? P i xel ( p i c t u r e ele m e n t ) : Pixel may be defined as the smallest size object or color spot that can be displayed and addressed on a monitor. Any image that is displayed on the monitor is made up of thousands of such small pixels. The closely spaced pixels divide the image area into a compact and uniform two-dimensional grid of pixel lines and columns. 4. W h y C l a n g u a ge i s p o p u l a r f o r g r a p h i c s p r o g r a m m i n g ? Turbo C++ is for C++ and C programmers. It is also compatible with ANSI C standard and fully supports Kernighan and Ritchie definitions. It includes C++ 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 Pascal. The Graphics library consists of over 70 graphics functions ranging from high level support like facility to set view port, draw 3 -D bar charts, draw polygons to bitoriented functions like get image and put image. The graphics library supports numerous objects, line styles and provides several text fonts to enable one 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. 5. D e f i n e r e s o l u t i o n. R e s o l u t i o n: Image resolution refers as the pixel spacing i.e. the distance from one pixel to the next pixel. A typical PC monitor displays screen images with a resolution somewhere between 25 pixels per inch and 8 0 pixels per inch. Pixel is the smallest 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 measure of screen resolution. The smaller the dot pitch, the higher the resolution, sharpness and detail of the image displayed. 6. D e f i n e a s p ec t r a t i o. A s p e c t r a t i o: The aspect ratio of the image is the ratio of the number of X pixels to the

number of Y pixels. The standard aspect ratio PCs is 4:3 , and some use 5 :4. Monitors are calibrated to this standard so that when you draw a circle it appears to be a circle and not an ellipse. 7. W h y r e f r e s h i n g i s r e q u i r e d i n C R T ? When the electron beam strikes a dot of phosphor material, it glows for a fraction of a second and then fades. As brightness of the dots begins to reduce, the screen-image becomes unstable and gradually fades out. In order to maintain a stable image, the electron beam must sweep the entire surface of the screen and then return to redraw it number of times per second. This process is called refreshing the screen. If the electron beam takes too long to return and redraw a pixel, the pixel begins to fade results in flicker in the image. In order to avoid flicker the screen image must be redrawn sufficiently quickly that the eye cannot tell that refresh is going on. The refresh rate is the number of times per second that the screen is refreshed. Some monitor uses a technique called interlacing for refreshing every line of the screen. In the first pass, odd-numbered lines are refreshed, and in the second pass, even –numbered lines are refreshed. This allows the refresh rate to be doubled because only half the screen is redrawn at a time. 8 . N a m e t h e di f f e r e n t p o s i ti o n i n g d e v i ce s. The devices discussed so far, t h e m o u s e , t h e t a bl e t , t h e j oy s t i c k are called “positioning devices”. They are able to position the curser at any point on the screen. (We can operate at that point or the chain of points) Often, one needs devices that can “point” to a given position on the screen. This becomes essential when a diagram is already there on the screen, but some changes are to be made. So, instead of trying to know its coordinates, it is advisable to simply “point” to that portion of the picture and asks for changes. The simplest of such devices is the “light pen”. Its principle is extremely simple. 9. W h a t a r e p o i n t i n g d e v i ce s ? A pointing device is an input interface (specifically a human interface device) that allows a user to input spatial (i.e., continuous and multi-dimensional) data to a computer. CAD systems and graphical user interfaces (GUI) allow the user to control and provide data to the computer using physical gestures — point, click, and drag — for example, by moving a hand-held mouse across the surface of the physical desktop and activating switches on the mouse. Movements of the pointing device are echoed on the screen by movements of the pointer (or cursor) and other visual changes. 10. W h a t i s m u l t i m e d i a ?

The word ‘Multimedia’ seems to be everywhere nowadays. The word multimedia is a compound of the Latin prefix ‘multi’ meaning many, and the Latin-derived work ‘media’, which is the plural of the world medium. So multimedia simply means ‘using more than one kind of medium’. Multimedia is the mixture of two or more media effects-Hypertext, Still Images, sound, Animation and Video to be interacted on a computer terminal. 11. W h a t a r e s o u n d c a r d s ? S o u n d c a r d s: The first sound blaster was an 8 -bit card with 22 KHz sampling, besides being equipped with a number of drives and utilities. This became a king of model for the other sound cards. Next came the Sound Blaster Pro, again 8 -bit sound but with a higher sampling rate of 44 KHz, which supports a wider frequency range. Then there was Yamaha OPL3 chipset with more voices. Another development was built-in CD ROM interface through which huge files could be played directly via the sound card. 12. W h a t i s s a m p l i n g ? 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. 13 . W h a t i s m o r p h i n g ? Mo r p h i n g: The best example would be the Kawasaki advertisement, where the motorbike changes into a cheetah, the muscle of MRF to a real muscle etc.. Morphing is making an image change into another by identifying key points so that the key point’s displacement, etc. are taken into consideration for the change. 14. W h a t i s r e n d e r i n g ? R e n d e r i n g: The process of converting your designed objects with texturing and animation into an image or a series of images is called rendering. Here various parameters are available like resolution, colors type of render, etc. 15. W h a t i s w a r p i n g ?

Wa r p i n g: Certain parts of the image could be marked for a change and made to change to different one. For examples, the eyes of the owl had to morph into the eyes of cat, the eyes can alone be marked and warped. 16 . W h y w e u s e s c a n n e r ? Photographs, illustrations, and paintings continue to be made the old fashioned way, even by visual artists who are otherwise immersed in digital imaging technology. Traditional photographs, illustrations, and paintings are easily imported into computers through the use of a device called a scanner. A Scanner “scans’” over an image such as photo, drawing, logo, etc, converting it into an image and it can be seen on the screen. Using a good paint programme, Image Editor we can do adding, removing colors, filtering, Masking color etc. 17. W h a t i s g a n u t i n P h o t o s h o p ? Write yourself...

18 . W h a t i s a l a ye r ? The concept of layering is similar to that of compositing as we make the different layers by keying out the uniform color and making it transparent so that layer beneath becomes visible. In case of future modifications we will be able to work with individual layers and need not work with the image as a whole.

19. W h a t a r e edi ti n g t o o l s ? W h y i t i s n ee de d ? You can use the editing tools to draw on a layer, and you can copy and paste selections to a layer. Ma ny t y p e s o f edi ti n g t o o l s a r e:i ). E r a s e r t o o l: The eraser tool changes pixels in the image as you drag through them. You can choose to change the color and transparency of the affected pixels, or to revert the affected area to its previously saved version. ii ). S m u d g e t o o l: The smudge tool simulates the actions of dragging a finger through

wet paint. The tool picks up color from where the stroke begins and pushes it in the direction in which you drag.

20. W h a t i s f i le f o r m a t ? F i l e F o r m a t : When you create an image-either through scanning into your computer or drawing it from scratch on your monitor or captured through a camera, recorded voice or music from the two-in-one or recorded connecting a music instrument it must be saved to your disk. Otherwise it would become an ethereal artifact that could never again be seen or listened. Once the computer’s power is turned off, it’s gone forever unless it is saved. The method by which the software organizes the data in the saved file is called the file format.

by ৰ জ ৱ ফকন

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.