Computer Graphics Lecture 13 Graphics Systems Taqdees A Computer Graphics Lecture 13 Graphics Systems Taqdees A. Siddiqi taqdees@vu.edu.pk
Video Display Devices Refresh Cathode-Ray Tubes Raster-Scan Displays Random-Scan Displays Color CRT Monitors Direct-View Storage Tubes Flat-Panel Displays Three-Dimensional Viewing Devices
Refresh Cathode-Ray Tubes
Refresh Cathode-Ray Tubes
Refresh Cathode-Ray Tubes
Refresh Cathode-Ray Tubes Cont..
Refresh Cathode-Ray Tubes Refresh CRT Control Grid Focusing System Focusing in High Precision System Construction of Cathode-Ray Tubes Persistence Resolution Aspect Ratio
Refresh Cathode-Ray Tubes
Area Filling Scan_line Fill Boundary Fill Flood Fill
Video Controller Basic Video Controller Refresh Operations Horizontal and Vertical Deflection Voltages Raster Scan Generator Register X Register Y Memory Addresses Pixel Register Intensity Frame Buffer Basic Video Controller Refresh Operations
Graphics Card or Display Adaptors A number of display Adaptors are available with varying capabilities specially Intel systems support following Adaptors: Monochrome Adaptor (MA) Hercules Adaptor (HA) Color Graphics Adaptor (CGA) Enhanced Graphics Adaptor (EGA) Multicolor Graphics Adaptor (MCGA) Video Graphics Adaptor (VGA) Super Video Graphics Adaptor (SVGA) Extended Graphics Adaptor (XGA)
Raster Scan Display Processor Frame Buffer Video Controller Display Processor Memory Monitor Display Processor CPU System Memory System Bus I/O Devices Architecture of a raster graphics systems with a display processor
Random-Scan Systems Architecture of a simple random scan system
Graphics Card or Display Adaptors A number of display Adaptors are available with varying capabilities specially Intel systems support following Adaptors: Monochrome Adaptor (MA) Hercules Adaptor (HA) Color Graphics Adaptor (CGA) Enhanced Graphics Adaptor (EGA) Multicolor Graphics Adaptor (MCGA) Video Graphics Adaptor (VGA) Super Video Graphics Adaptor (SVGA) Extended Graphics Adaptor (XGA)
Graphics Card or Display Adaptors A video card is typically an adaptor, a removable expansion card in the PC. Thus, it can be replaced! A video display Adaptor which is the special printed circuit board that plugs into one of the several expansion slots present on the mother board of the computer. A video display Adaptor is referred to as a video card as well. The video card can also be an integral part of the system board; this is the case in certain brands of PCs and is always the case in laptops and clear preference for the replaceable video card in some PCs.
Source Code Code in assembly language that can set graphics mode 19 (13h) MOV AH,0 MOV AL,13h ;mode number from 0-19 INT 10h
Source Code Cont.. You can use this for assembler or you can embed this code in C language using ‘asm’ keyword asm { MOV AH,0 MOV AL,13h;;mode number from 0-19 INT 10h }
Source Code Code in assembly language that can set graphics mode 19 (13h) MOV AH,0 MOV AL,13h ;mode number from 0-19 INT 10h
Source Code for Writing Pixel Code to write pixel using video BIOS interrupt 10h and service number 0ch. MOV AH,0Ch MOV AL,COLOR_NUM MOV BH,0 MOV CX,ROW_NUM MOV DX,COLUMN_NUM INT 10h
Incremental Line Algorithm This algorithm exploits simple line equation y = m x + b where m = dy / dx and b = y – m x
DDA Algorithm DDA abbreviated for digital differential analyzer has a very simple technique. Find difference, dx and dy as: dy = y2 – y1 dx = x2 – x1
if |dx| > |dy| then step = |dx| else step = |dy| Now very simple to say that step is the total number of pixels required for a line.
Next step is to find xIncrement and yIncrement: xIncrement = dx/step yIncrement = dy/step
Circle Drawing Using Cartesian Coordinates This technique uses the equation for a circle with radius r centered at (0,0): x2 + y2 = r2, an obvious choice is to plot y = ± r2 - x2 against different values of x.
Polar Coordinates Algorithm Circle2 (xcenter, ycenter, radius) for = 0 to 2 step 1/r x = xc + r * cos y = yc + r * sin drawPixel (x, y)
Eight Octants Symmetry
Midpoint Circle Algorithm k X2+Y2-R2=0 k Xk+1 k
Rotation Y X 1 2 3 4 5 6 7 8 9 10
Scaling Y X 1 2 3 4 5 6 7 8 9 10
Basic Transformations Rotation Scaling
Video Controller Architecture of a raster system with a fixed portion of system memory reserved for the frame buffer.
Color CRT Monitors Beam Penetration Method Shadow Mask Method
Translation tx = 2 ty = 3 Y X 1 2 3 4 5 6 7 8 9 10
Color CRT Monitors Beam Penetration Method Shadow Mask Method