o عَلَّمَهُ الْبَيَانَ

Slides:



Advertisements
Similar presentations
© 2010 Delmar, Cengage Learning Chapter 7: Importing and Modifying Graphics.
Advertisements

Section 3-1 to 3-2, 3-5 Drawing Lines Some of the material in these slides may have been adapted from university of Virginia, MIT, and Åbo Akademi University.
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.
OUTPUT PRIMITIVES Screen vs. World coordinate systems ● Objects positions are specified in a Cartesian coordinate system called World Coordinate.
In the name of God Computer Graphics Bastanfard.
© 2001 By Default! A Free sample background from Slide 1 Attributes of Output Primitives Definition Parameter that affects.
CMPE 466 COMPUTER GRAPHICS Chapter 5 Attributes of Graphics Primitives Instructor: D. Arifler Material based on - Computer Graphics with OpenGL ®, Fourth.
Output Primitives Computer Graphics.
Chapter Day 5. © 2007 Pearson Addison-Wesley. All rights reserved2-2 Agenda Day 5 Questions from last Class?? Problem set 1 Posted  Introduction on developing.
Chapter 4 Digital Multimedia, 2nd edition Vector Graphics.
Graphics Output Primitives Pixel Addressing and Fill Area Dr. M. Al-Mulhem Feb. 1, 2008.
Introduction to Computer Graphics
Vector vs. Bitmap SciVis V
V Obtained from a summer workshop in Guildford County July, 2014
Vector Graphics Making custom images. Raster vs. Vector Graphics In computer graphics, a raster graphics image, or bitmap, is a dot matrix data structure.
CGMB214: Introduction to Computer Graphics
Dr. S.M. Malaek Assistant: M. Younesi
Graphics Graphics Korea University cgvr.korea.ac.kr Raster Graphics 고려대학교 컴퓨터 그래픽스 연구실.
Tools for Raster Displays CVGLab Goals of the Chapter To describe pixmaps and useful operations on them. To develop tools for copying, scaling, and rotating.
Objectives Differentiate between raster scan display and random scan display.
1Computer Graphics Implementation III Lecture 17 John Shearer Culture Lab – space 2
1 Introduction Line attribute Color and gray scale Area filled attribute Anti-aliasing.
Graphics Output Primitives
CGMB214: Introduction to Computer Graphics
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
Vector Graphics Digital Multimedia Chap 이병희
Attributes of Graphics Primitives Hearn & Baker Chapter 4 Some slides are taken from Robert Thomsons notes.
COMP135/COMP535 Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 4 Lecture 4 - Vector Graphics.
GEOMETRY AND LINE GENERATION Geometry and Line Generation Chapter 2.
In the name of God Computer Graphics. Today Introduction Sampling Graphic Output Primitives 1.Line 2.Circle 3.Curve 4.polygon.
CISC 110 Day 3 Introduction to Computer Graphics.
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
OUTPUT PRIMITIVES A.Aruna/Faculty of Information technology/SNSCE13/19/2016.
Lecture 2: 19/4/1435 Graphical algorithms Lecturer/ Kawther Abas CS- 375 Graphics and Human Computer Interaction.
Computer Graphics Lecture 08 Taqdees A. Siddiqi Computer Graphics Filled Area Primitives I Lecture 08 Taqdees A. Siddiqi
Digital Image Processing CCS331 Relationships of Pixel 1.
Mohammed AM Dwikat CIS Department Digital Image.
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
IS502:M ULTIMEDIA D ESIGN FOR I NFORMATION S YSTEM D IGITAL S TILL I MAGES Presenter Name: Mahmood A.Moneim Supervised By: Prof. Hesham A.Hefny Winter.
ATTRIBUTE OF OUTPUT PRIMITIVES. Attribute of Output Primitives 30/9/2008 A.Aruna/Assistant professor/IT/SNSCE 2 Definition Line Attribute Curve Attribute.
10/10/2006TCSS458A Isabelle Bichindaritz1 Line and Circle Drawing Algorithms.
Rasterization CENG 477 Introduction to Computer Graphics Slides from Steve Marschner, CS4620, 2008 Cornell University.
OUTPUT PRIMITIVES CEng 477 Computer Graphics METU, 2004.
Vector vs. Bitmap. Vector Images Vector images (also called outline images) are images made with lines, text, and shapes. Test type is considered to be.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
CSCE 441 Lecture 2: Scan Conversion of Lines
Attributes of Graphics Primitives Hearn & Baker Chapter 4
Lecture 9 Line Drawing Algorithms (Bresenham’s Line Algorithm)
(c) 2002 University of Wisconsin, CS559
Vector vs. Bitmap.
Adobe Flash Professional CS5 – Illustrated
Lecture 8 Shear and Line Drawing Algorithms
Chapter Three Part I Output Primitives CS 380.
Computer Programming I
The Graphics Rendering Pipeline
Methods Anti-Aliasing Super Sampling
© 2008, Fayyaz A. Afsar, DCIS, PIEAS.
Introduction to Computer Graphics
Chapter Lessons Use the Macromedia Flash drawing tools
Introduction to Computer Graphics
Introduction to 2D and 3D Computer Graphics
Lecture 13 Clipping & Scan Conversion
عَلَّمَهُ الْبَيَانَ He has taught him speech (and intelligence).
Chapter 3 Graphics Output Primitives
Primitive Drawing Algorithm
Anti-aliased and accelerated ray tracing
Sweep Fill Details For row = min to row=max
Primitive Drawing Algorithm
Lecture 4 - Introduction to Computer Graphics
Presentation transcript:

o عَلَّمَهُ الْبَيَانَ Allah says o عَلَّمَهُ الْبَيَانَ He has taught him speech (and intelligence). Al-Qur'an, 055.004 (Ar-Rahman)

Majed Bouchahma boumaged@gmail.com Lecture-3 Attributes of Graphics Primitives : Attributes of Line Primitives Majed Bouchahma boumaged@gmail.com

Introduction In general, a parameter that affects the way a primitive is to be displayed is referred to as an attribute parameter i.e: size, color,… OpenGL assign attributes setting using separate functions that update a system attribute list. A graphic system that maintain a list for the current values of attributes is referred to as a state system. Attributes of output primitives are referred to as state variables.

OpenGL color functions glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB) 1st parameter: Frame Buffer 2nd parameter: Color mode In RGB mode we select the current color components using the function: glColor*(Colorcomponents) i.e:glColor3i(0,255,255)

Line Attributes Line Colour Line Type Solid Lines Dashed Lines Set by changing the pixel colour while drawing Line Type Different types of lines can be drawn by setting the length and spacing of displayed solid sections along the line path Solid Lines Dashed Lines Inter-dash spacing equal to the solid section Dotted Lines Inter-dash spacing greater than the solid section

Line Attributes… Line Type… (See Book P.185) Use of pixel masks Pixel counts along the line path for the solid and inter-line spacing can be specified by using pixel masks Bit strings containing ones and zeros 1111000 Draw 4 pixels and then give spacing of 3 pixels

Line Attributes… Line Width ( See book P:183) Thicker lines can be displayed as positive integer multiples of the standard line by plotting additional pixels along adjacent line paths

Brush and Pen Options The pen or the brush is the name of the tool used for drawing a line Its shape changes the way a line is drawn Brush Options

Brush and Pen Options… A brush can be represented by a pixel mask in the form of a matrix which stores the pixel values to be set at each pixel location along the path of the line 1 1

Curve Attributes Can be set in a similar ways as line attributes

Anti-aliasing in Line Drawing Displayed primitives generated by the raster algorithms contain jaggies The sampling process digitizes coordinates points on an object to discrete integer pixel positions This distortion of information due to under-sampling is called aliasing Can be removed through anti-aliasing algorithms There are no samples (pixels) available between the two steps which leads to under-sampling and as a result jaggies are produced

Anti-Aliasing through Super-Sampling Divide each pixel into a number of sub pixels and count the number of sub pixels that are along the line path Set the intensity level of each pixel in proportion to the sub pixel count

Anti-Aliasing through Super-Sampling Example Each pixel broken into 9 (3x3) sub pixels Bresenham algorithm now selects which of the sub-pixels will be turned on during line drawing Maximum number of pixels that can be turned on by the line drawing algorithm is 3 Therefore the number of color levels for each pixel is 3 The pixel colors are set proportional to the number of sub pixels turned on Pixel level for a pixel with all 3 pixels on = line color Pixel level for a pixel with no pixels on = background color

Anti-Aliasing through Super-Sampling Example Each pixel broken into 9 (3x3) sub pixels Bresenham algorithm now selects which of the sub-pixels will be turned on during line drawing Maximum number of pixels that can be turned on by the line drawing algorithm is 3 Therefore the number of color levels for each pixel is 3 The pixel colors are set proportional to the number of sub pixels turned on Pixel level for a pixel with all 3 pixels on = line color Pixel level for a pixel with no pixels on = background color Line intensity is spread out over a greater number of pixels and the stairstep effect is smoothed by displaying a blurred line path in the vicinity of the stair step

End of Lecture-3 Work expands so as to fill the time available for its completion. Cyril Northcote Parkinson (1909–1993) British political scientist, historian, and writer. Parkinson's Law (1958).