Graphics Output Primitives Pixel Addressing and Fill Area Dr. M. Al-Mulhem Feb. 1, 2008.

Slides:



Advertisements
Similar presentations
Graphics Primitives Part II: Bresenhams line and circle.
Advertisements

Computer Graphics- SCC 342
Computer Graphics 4: Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling By:Kanwarjeet Singh.
CS 450: COMPUTER GRAPHICS REVIEW: DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE.
+ CPCS 391 Computer Graphics 1 Instructor: Dr. Sahar Shabanah Lecture 3.
Line Drawing Algorithms. Rasterization-Process of determining which pixels give the best approximation to a desired line on the screen. Scan Conversion-Digitizing.
30/9/2008Lecture 21 Computer Graphics Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD3107 University of Palestine.
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
In the name of God Computer Graphics Bastanfard.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
© 2001 By Default! A Free sample background from Slide 1 Attributes of Output Primitives Definition Parameter that affects.
CPCS 391 Computer Graphics 1 Lecture 5: Polygon Filling
Raster conversion algorithms for line and circle
CMPE 466 COMPUTER GRAPHICS
CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 CS5500 Computer Graphics May 3, 2007.
Chapter 4 Digital Multimedia, 2nd edition Vector Graphics.
CS 4731: Computer Graphics Lecture 22: Raster Graphics Part 3 Emmanuel Agu.
Circle Drawing algo..
IT- 601: Computer Graphics Lecture-04 Scan Conversion Jesmin Akhter Lecturer,IIT Jahangirnagar University, Savar, Dhaka,Bangladesh 9/3/2015.
Tools of Geometry Chapter 1 Vocabulary Mrs. Robinson.
March Shape Drawing Algorithms Shmuel Wimer Bar Ilan Univ., Engineering Faculty.
CGMB 314 Intro to Computer Graphics Fill Area Primitives.
CGMB214: Introduction to Computer Graphics
Equation A statement that two mathematical expressions are equal.
Copyright - Planchard 2012 History of Engineering Graphics Stephen H. Simmons TDR 200.
Dr. S.M. Malaek Assistant: M. Younesi
Jehee Lee Seoul National University
WHERE TO DRAW A LINE?? Line drawing is accomplished by calculating intermediate positions along the line path between specified end points. Precise definition.
Scan Conversion Line and Circle
CS 450: Computer Graphics PIXEL AdDRESSING AND OBJECT GEOMETRY
UNIT THREE REVIEW Geometry 217. True/False  A translation is an arrangement of shapes that covers a plane completely without gaps or overlaps.  False,
Graphics Graphics Korea University cgvr.korea.ac.kr Raster Graphics 고려대학교 컴퓨터 그래픽스 연구실.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
Introduction to Computer Graphics PPT2: Graphics Output Primitives
Acute angle An angle with a measure less than 90 degrees.
Graphics Output Primitives
CGMB214: Introduction to Computer Graphics
Math9 project-ABC Book by: Jeffrey May Teacher: Mrs. burton.
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
UNIT THREE REVIEW Geometry 217. True/False  A translation is an arrangement of shapes that covers a plane completely without gaps or overlaps.
G.CO.1 Know precise definitions of angle, circle, perpendicular lines, parallel lines, and line segment, based on the undefined notions of point, line,
Vector Graphics Digital Multimedia Chap 이병희
10/15/02 (c) 2002 University of Wisconsin, CS559 Who Am I? Prof Stephen Chenney These notes will be online after the lecture – in fact they’re online already.
COMP135/COMP535 Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 4 Lecture 4 - Vector Graphics.
In the name of God Computer Graphics. Today Introduction Sampling Graphic Output Primitives 1.Line 2.Circle 3.Curve 4.polygon.
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
Lecture 15: Raster Graphics and Scan Conversion
Lecture 13: Raster Graphics and Scan Conversion
Acute angle: An angle with a measure less than 90º.
OUTPUT PRIMITIVES A.Aruna/Faculty of Information technology/SNSCE13/19/2016.
Mathematical Vocabulary
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
Write Bresenham’s algorithm for generation of line also indicate which raster locations would be chosen by Bresenham’s algorithm when scan converting.
Chun-Yuan Lin Coordinate Reference Frames 2016/6/22 1 CG.
10/10/2006TCSS458A Isabelle Bichindaritz1 Line and Circle Drawing Algorithms.
Computer Graphics Lecture 06 Circle Drawing Techniques Taqdees A. Siddiqi
Objectives Understand Bresenhams line drawing algorithm. Apply the algorithm to plot a line with the end points specified.
Primitive graphic objects
Drawing Geometric Objects
Lecture 5 Basic geometric objects
Bitmap Image Vectorization using Potrace Algorithm
Inserting and Working with Images
Lecture 05: Mid-point Ellipse algorithm Dr. Manal Helal – Fall 2014
Chapter Three Part I Output Primitives CS 380.
Chapter 3 Graphics Output Primitives
Primitive Drawing Algorithm
4/28/2019 Drawing in AutoCAD.
Primitive Drawing Algorithm
Presentation transcript:

Graphics Output Primitives Pixel Addressing and Fill Area Dr. M. Al-Mulhem Feb. 1, 2008

Pixel Addressing and Object Geometry To preserve the specified geometry of world objects, we need to compensate for the mapping of mathematical input points to finite pixel area, we use one of the two ways: 1.Adjust the dimensions of displayed objects to account for the amount of overlap of pixel areas with the object boundaries. 2.Map world coordinates onto screen positions between pixels, so that we align objects boundaries with pixel boundaries instead of pixel centers (Grid coordinates).

Pixel Addressing and Object Geometry Grid Coordinates: The Figure shows grid lines marking pixel boundaries, one unit apart. A screen position is given as the pair of integer values identifying a grid intersection position between two pixels.

Pixel Addressing and Object Geometry The address for any pixel is now at its lower-left corner, as illustrated in the Figure.

Pixel Addressing and Object Geometry Using screen grid coordinates, we now identify the area occupied by a pixel with screen coordinates (x, y) as the unit square with diagonally opposite corners at (x, y) and (x + 1, y + 1).

Pixel Addressing and Object Geometry A straight line path is now envisioned as between grid intersections For example, the mathematical line path for a polyline with screen endpoints (0, 0), (5, 2), and (1,4) is shown beside.

Pixel Addressing and Object Geometry Notes: 1.The previous algorithms for drawing line, circle, …etc are still valid when applied to input positions expressed as screen grid coordinates. 2.The decision parameter P k is a measure of screen grid separation differences rather than separation differences from pixel centers.

Maintaining Geometric Properties of Displayed Objects Conversion of geometric descriptions of objects into pixel representations means transforming mathematical points and lines into finite screen areas. To maintain the original geometric measurements specified by the input coordinates for an object, we need to account for the finite size of pixels when we transform the object definition to screen display.

Maintaining Geometric Properties of Displayed Objects The following example shows the line plotted in the Bresenham line algorithm example. Interpreting the line endpoints ( 20, 10) and ( 30, 18) as precise grid crossing positions, we see that the line should not extend past screen grid position (30,18). If we were to plot the pixel with screen coordinates (30, 18), we plot 11 horizontal units and 9 vertical units, where Δx= 10, and Δy = 8.

Maintaining Geometric Properties of Displayed Objects With screen coordinates as addressing pixel boundaries (Grid coordinates), we plot a line using only those pixels that are interior to the line path, i.e. only those pixels that are between line endpoints (20, 10) & (29, 17) For an enclosed area input geometric properties are maintained by displaying the area only with these pixels that are interior to the object boundaries

Maintaining Geometric Properties of Displayed Objects

The rectangle defined with the screen coordinate vertices for border shown in the next slide, for example, is larger when we display it filled with pixels up to and including the border pixel lines joining the specified vertices. As defined, the area of the rectangle is 12 units, but as displayed it has an area of 20 units in figure (b), it has an area of 12 units in figure (c)

Maintaining Geometric Properties of Displayed Objects

The original rectangle measurements are maintained by displaying only internal pixels. The right boundary of the input rectangle is at x = 4. To maintain this boundary in the display, we set the rightmost pixel grid coordinate at x=3. Similarly the mathematical top boundary of the rectangle is at y = 3, so we set the top pixel row for the displayed rectangle at y = 2.

Maintaining Geometric Properties of Displayed Objects These compensations for finite pixel width along object boundaries can be applied to other polygons and to curved figures so that the raster display maintains the input object specifications. A circle of radius 5 and center position (10, 10), for instance, would be displayed as shown in Figure 3-38 by the midpoint circle algorithm using pixel centers as screen coordinate positions. But the plotted circle has a diameter of 11. To plot the circle with the defined diameter of 10, we can modify the circle algorithm to shorten each pixel scan line and each pixel column, as shown in the Figure 3-39.

Maintaining Geometric Properties of Displayed Objects Figure 3-38

Maintaining Geometric Properties of Displayed Objects Figure 3-39