OUTPUT PRIMITIVES A.Aruna/Faculty of Information technology/SNSCE13/19/2016
PICTURE DESCRIPTIONS Raster Completely specified by the set of intensities for the pixels positions in the display. Shapes and colors are described with pixel arrays. Scene displayed by loading pixels array into the frame buffer. Vector Set of complex objects positioned at specified coordinates locations within the scene. Shapes and colors are described with sets of basic geometric structures. Scene is displayed by scan converting the geometric-structure specifications into pixel patterns. 3/19/20162 A.Aruna/Faculty of Information technology/SNSCE
3 OUTPUT PRIMITIVES Graphics programming packages provide functions to describe a scene in terms of basic geometric structures referred to as output primitives. Points, Straight lines, Circles, Splines curves and surfaces, Polygon color areas, Character string Output Primitives is specified input coordinate data other information about the way that object is to be displayed. Construct the vector picture. A.Aruna/Faculty of Information technology/SNSCE3/19/2016
IMPLEMENTING APPLICATION PROGRAMS Description of objects in terms of primitives and attributes and converts them to the pixels on the screen. what Primitives – what is to be generated how Attributes – how primitives are to be generated A.Aruna/Faculty of Information technology/SNSCE43/19/2016
INTRODUCTION In digital representation: Display screen is divided into scan lines and columns. Pixels positions are referenced according to scan line number and column number (columns across scan lines). Scan lines start from 0 at screen bottom, and columns start from 0 at the screen left side. Screen locations (or pixels) are referenced with integer values. The frame buffer stores the intensities temporarily. Video controller reads from the frame buffer and plots the screen pixels. 3/19/20165 A.Aruna/Faculty of Information technology/SNSCE
6 Points The electron beam is turned on to illuminate the phosphor at the selected location (x, y) where 0 ≤ x ≤ maxx 0 ≤ y ≤ maxy setpixel(x, y, intensity) – loads an intensity value into the frame-buffer at (x, y). getpixel(x, y) – retrieves the current frame-buffer intensity setting at position (x, y). (0,0) (maxx,maxy) CRT
7 Lines Analog devises, such as a random-scan display or a vector plotter, display a straight line smoothly from one endpoint to another. Linearly varying horizontal and vertical deflection voltages are generated that are proportional to the required changes in the x and y directions to produce the smooth line.
8 Digital devices display a straight line by plotting discrete coordinate points along the line path which are calculated from the equation of the line. Screen locations are referenced with integer values, so plotted positions may only approximate actual line positions between two specific endpoints. A computed line position of (10.48, 20.51) will be converted to pixel position (10, 21). This rounding of coordinate values to integers causes lines to be displayed with a stairstep appearance (the “jaggies”). Particularly noticeable on systems with low resolution. To smooth raster lines, pixel intensities along the line paths must be adjusted.
9 Line Drawing Algorithms Cartesian equation: y = mx + c where m – slope c – y-intercept x1x1 y1y1 x2x2 y2y2 Value of y at the point where the line crosses the y axis
10 Slope if |m| = 1 = 45° 45° +ve-ve °° °° °° °° if |m| 1 -45° < < 45° if |m| 1 45° < < 90° or -90° < < -45°
y = x m = 1 c = 0 y x xy |m| = 1
y = ½ x + 1 m = ½ c = 1 y x xyround(y) |m| 1
13 |m| y = 3x - 2 m = 3 c = -2 y x xyround(y) outside
LINE CONCLUSION For Line m=1 ∆x = ∆y, Horizontal and Vertical deflection Voltage is Equal. Smooth line with slope m is generated between two end points A.Aruna/Faculty of Information technology/SNSCE143/19/2016