5th sem solved Assignment for Graphics and Multimedia kuvempu university



There is document - 5th sem solved Assignment for Graphics and Multimedia kuvempu university available here for reading and downloading. Use the download button below or simple online reader.
The file extension - PDF and ranks to the Documents category.


286

views

on

Extension: PDF

Category:

Documents

Pages: 1

Download: 62



Sharing files


Tags
Related

Comments
Log in to leave a message!

Description
Download 5th sem solved Assignment for Graphics and Multimedia kuvempu university
Transcripts
K u v e m p u U n i v e r s i t y Assignments for BSc(IT) & MSc(IT) Courses Subject: Graphics & Multimedia Subject Code: BSIT – 51 Prepared By: Rajiv Phukan (ৰ�জ�ৱ ফকন) Pathsala (প�ঠশ�ল�) Assignment: TA (Compulsory) 1W h a t i s t h e m e a n i n g of in te r a c t i ve co m p u t e r g r ap h ic s ? L i s t t h e v a r io u s a p p lic a t io n s of 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 man- machine 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 io u s a p plic a t io n s of t h e co m p u t e r g r ap h ic s a r e li s ted belo 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 ai n in de t a i l t h e Ha r d w a r e r e q u i r ed f o r e f f ec t i ve g r ap h ic 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 C o m p a r e R a s t e r sc a n s y s t e m w i t h r a n do m sc a n s y s t e 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 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 a s t e r sc a n 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 60 to 80 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 do m sc a n di s pl 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 po s si ble i f a 24 bi t s / pixel i s u s ed b 8 bi t s / pixel i s u s ed J u s t i f y yo u r a n s w e r a) 24 bit color provides 167 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 256 different intensity levels for each primary color Thus a pixel can take on a color from 256 X 256 X 256 or 167 million possible choices In Bi- level 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 256 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 expl ai n di f f e re n t t ex t m o de b u il t-in f u n c t io n s of C P r og r a m m i n g la n g u a ge The different text mode built-in functions of C Programming language are listed below :- i ) t ex t m o de ( in t m o de ); 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 80 column black and white 3 : represents 80 column color Example: textmode(2); // sets the screen to 80 column black and white ii ) cl r sc 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 tox y ( i n t x, in 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 iv ) t ex t b ac 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 tcolo 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 ) dellin 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 5th line*/ gotoxy (5,4); delline ( ); v ii ) in s l i ne ( ) 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 te a C p r og r a m t o c re a t e Indi a n n a t io n al f l a g #include"graphicsh" #include"conioh" 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,63 9,479); setcolor(6); rectangle(50,50,3 00,200); setfillstyle(SOLID_FILL,6); bar(50,50,3 00,100); setfillstyle(SOLID_FILL,WHITE); bar(50,100,3 00,150); setfillstyle(SOLID_FILL,GREEN); bar(50,150,3 00,200); setcolor(BLUE); rectangle(45,45,50,3 00); setfillpattern(0x20,MAGENTA); bar(45,45,50,400); setcolor(BLUE); circle(175,125,25); line(175,125,200,125); line(175,125,175,150); line(175,125,150,125); line(175,125,175,100); line(175,125,159,107); line(175,125,193 ,143 ); line(175,125,159,143 ); line(175,125,193 ,107); setcolor(YELLOW); rectangle(0,0,640,43 ); setfillstyle(SOLID_FILL,YELLOW); bar(0,0,640,43 ); setcolor(BLACK); settextstyle(1,HORIZ_DIR,5); outtextxy(150,0,"INDIAN FLAG"); getch(); } Assignment: TB (Compulsory) 1 W h a t i s t h e n eed f o r co m p u t e r g r ap h ic 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 ic s p r oces so r ? W h y i t i s n eeded ? 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 82786 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 pixel ? P i xel ( p ic 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 po p u l a r f o r g r a p h ic s p r og 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 De f i ne r e sol u t io n R e sol u t io n: Image resolution refers as the pixel spacing ie 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 80 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 De f i n e a s pec t r a t i o A s p ec t r a t io: 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 re s h i n g i s r eq u i red in 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 po si t io ni n g de vice s The devices discussed so far, t h e m o u s e , t h e t a ble t , t h e j oy s t ic 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 poi n t i n g de vice s ? A pointing device is an input interface (specifically a human interface device) that allows a user to input spatial (ie, 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 di 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 ca 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 li 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 ? Mor p hi 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 de r i n g ? R e n de 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 pi 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 sc 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 in 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 ool s ? W h y i t i s n eeded ? 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 of edi ti n g t ool s a r e:- i ) E r a se r t ool: 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 ge t ool: 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 le 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 ৰ�জ�ৱ ফ� কন