Basic Raster Graphics Algorithms for Drawing 2D Primitives Prof Lizhuang Ma Shanghai Jiao Tong University
Basic Raster Graphics Algorithms for Drawing 2D Primitives Prof. Lizhuang Ma Shanghai Jiao Tong University
Contents Architecture of a Raster Display Scan Converting lines Filling Rectangles Filling Polygons Clipping lines Clipping Polygons Antialiasing
Contents • Architecture of a Raster Display • Scan Converting Lines • Filling Rectangles • Filling Polygons • Clipping Lines • Clipping Polygons • Antialiasing
Architecture of a Raster display Video Interface with host computer (Display commands)(Interaction data) Display controller Keyboard (DC) Mouse 0000000000000000000111000 000000000000000011100000 000o00000000000001100000 000000000000000000011000 000000000001110000000000 0000ooo011111111111000000 00111111111111111111111 Video controller 0001111111000000011111110 0001111111111111111111110 001111111110001111111110 001111111110001111111110 001111111110001111111110 001111111110001111111110 0001111111111111111111110 Refresh buffer
Architecture of a Raster Display Video
Definitions Pixel: a screen consists ofn x m pixels Bilevel=monochrome, 1 bit/pixel · Color:RGB/ CYK/LU∨ Bitmap / pixmap Frame buffer: an array of data in memory mapped to screen
Definitions • Pixel: a screen consists of N x M pixels • Bilevel = monochrome, 1 bit / pixel • Color: RGB/CYK/LUV… • Bitmap / pixmap • Frame buffer: an array of data in memory mapped to screen
Scan Converting line A scan-converted line showing intensified pixels as black circles
Scan Converting Line • A scan-converted line showing intensified pixels as black circles