Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS-321 Dr. Mark L. Hornick 1 Graphics Displays Video graphics adapter Monitor.

Similar presentations


Presentation on theme: "CS-321 Dr. Mark L. Hornick 1 Graphics Displays Video graphics adapter Monitor."— Presentation transcript:

1 CS-321 Dr. Mark L. Hornick 1 Graphics Displays Video graphics adapter Monitor

2 CS-321 Dr. Mark L. Hornick 2 CRT Raster Scanning No e-beam in LCD’s. However, the logical sequence of setting discrete pixel colors is similar.

3 CS-321 Dr. Mark L. Hornick 3

4 4 Early graphics adapters Bus CPU System Memory Scan Converter video, vga Frame buffer Pixel construction CPU constructs “virtual image” in Frame Buffer in System Memory Scan converter reads virtual image and converts to video or vga signals

5 CS-321 Dr. Mark L. Hornick 5 Memory Mapping Example 00 01 02 03 04 05 06 07 08 09 0a 0b … Video RAM Display

6 CS-321 Dr. Mark L. Hornick 6 Video Display Timing Example 1280 1024 1024 * 1280 = nn pixels Refresh rate = 85 Hz, n lines/s, x s/line. 1280 pixels Pixel time = y s, z MHz clock

7 CS-321 Dr. Mark L. Hornick 7 Later graphics adapters Bus CPU System Memory Scan Converter vga Video RAM Multiple Frame buffers GPU Graphics primitives

8 CS-321 Dr. Mark L. Hornick 8 Today’s graphics adapters Bus CPU System Memory Scan Converter svga Multiple Frame buffers GPU DP Gr. Display cmds. Xform engine, shader, spline gen, …

9 CS-321 Dr. Mark L. Hornick 9 Pixel Addressing Integer coordinates Horizontal Left to right Vertical Top to bottom or bottom to top? Usually top to bottom (Windows) Memory bits map to pixels x y

10 CS-321 Dr. Mark L. Hornick 10 Line Drawing Algorithms (x 0, y 0 ) (x 1, y 1 ) Which pixels should be set to represent the line?

11 CS-321 Dr. Mark L. Hornick 11 Line Equations (x 0, y 0 ) (x 1, y 1 ) Equations implemented in lab1 sample code.

12 CS-321 Dr. Mark L. Hornick 12 Setting a Pixel // SetPixel - write (x,y) pixel value into the fb #define PIX_PER_LINE 24 #define PIX_PER_WORD 4 #define BITS_PER_PIX 8 #define FBSIZE 256// size of frame buffer #define FBADDR 0xffff// presumed hw addr of frame buffer int *vmem = FBADDR;// set a pointer to the frame buffer //int fb[FBSIZE]; // simulated frame buffer //int* vmem = fb; // ptr to simulated frame buffer void setPixel (int x, int y, int val) { int pix = y * PIX_PER_LINE + x; // linear pixel addr int addr = pix / PIX_PER_WORD; // base fb addr int ofst = pix % PIX_PER_WORD; // offset in fb word vmem[addr] = vmem[addr] | (val << (ofst * BITS_PER_PIX)); }


Download ppt "CS-321 Dr. Mark L. Hornick 1 Graphics Displays Video graphics adapter Monitor."

Similar presentations


Ads by Google