LESSON 10. Graphic primitives, display file, frame buffer, display control, display processors, line generation, graphics software. Points and lines, polygons, filing of polygons, text primitive, windowing and clipping, view port

10.1.Introduction

A primitive is a low level object or  operation from which higher-level, more complex objects and operations can be constructed. In graphics, primitives are basic elements, such as lines, curves, and polygons, which can  be combined to create more complex graphical images. In programming, primitives are the basic operations supported by the programming language. To creative any drawing in the computer these primitives form a part of the software and the type of display to store these in the form of data is important.

10.2.Graphics Primitives

Graphics  Primitive is a basic object that is essential for the creation or construction of complex images. Graphics is constructed from three basic elements, as opposed to the great variety of graphics applications. The most basic of these elmental structures is the pixel, short for picture element.

10.2.1.Pixel

A pixel is a point of light. It is just one tiny dot on the raster displays. Though it has no structure, it is definitely a building block and hence it can be considered as the graphics primitive. The resolution of CRT is related to the dot size, the diameter of a single dot. A resolution of 100 dots lines/inch implies a dot size of 0.01 inch.   The ratio of the distance between the centres of two adjacent horizontal pixels to that of the vertical ones is called the  pixel ratio. Pixel ratio should be considered in line-generating algorithms.

10.2.2.Line

Line, especially straight lines, constitute the basic building block of Line graphs, bar and pie charts, two and three-dimensional graphs of mathematical functions, engineering drawings and architectural plans. In computer graphics, straight line is so basic in creating images that we call it a graphics primitive. Straight lines can be developed in two different ways. A structural method determines which pixels should be set before drawing the line; a conditional method tests certain conditions to find which pixel should be set next.

10.2.3.Polygon

A polygon is a closed area of image bounded by straight or curved lines and filled with one solid color. Since images are two dimensional, a polygon is a closed planar figure.A polygon, is an important graphics primitive. So often we want to handle polygon as a single entity, as images of objects from the real world consist in large, part of polygons.

10.3. Display file

A display file is a set of uncorrelated data, such as a histogram array or bivariate array. The arrays are filled event by event from a list data in order to create a display. The saved arrays usually take up far less disk space, but can the data can no longer be gated.

10.4.Frame buffer

The video output device  which drives a video display from the memory buffer containing a complete set of data is known as frame buffer. The image is stored in terms of pixel by pixel. The memory can be discs, Integrated circuits etc.,

10.5.Display control

This controls the view of the image so that the user can view the mage fromdesired angle and desired magnification.

10.6.Display Processor

The display processor read the data from the frame buffer and convert it into corresponding 1's and 0's according to there pixels and then put it on to a monitor screen.The display processor do this work 30 times per second to maintain a steady picture on the screen,and if we want to change the picture on the screen then we have to change the contents of frame buffer.

10.7.Line generation.

In mathematics and computer science an algorithm is a step by step procedure for making calculations. Algorithms are made for calculation, data processing and automated reasoning. In order to draw lines on a computer screen, the Bresenham line algorithm is used that determines which order to form a close approximation to a straight line between two given points. It uses only integer addition, subtraction and bit shifting where the digits are moved or shifted left or right, all of which are very cheap operations in standard computer architectures. It is one of the earliest algorithms developed in the field of computer graphics. A minor extension to the original algorithm also deals with drawing circles.

Another algorithm namely, Digital Differential Analyzer is a scan conversion line algorithm based on calculating either dy or dx. We sample the line at unit intervals in one coordinate & determine corresponding integer values nearest to the line path for the other coordinate. 
The algorithm accepts as input the two endpoint pixel positions. Horizontal & vertical differences between the endpoint positions are assigned to parameters dx & dy. The difference with the greater magnitude determines the increment of the parameter steps. Starting with the pixel position (xa , ya), we determine the offset needed at each step to generate the next pixel position along the line path.

10.8.Graphics software

Graphics software is a program or set of programs that enables us to manipulate the visual images on computer system. There two types of graphics namely, Raster graphics and Vector graphics. The Raster graphics or bitmap, is a dot matrix data structure representing a generally rectangular grid of pixels, or points of color, Vector Graphics is the use of geometrical primitives such as points, lines, curves, and shapes or polygon(s), which are all based on mathematical expressions, to represent images in computer graphics. It is easy to convert from vector graphics to raster graphics, but going the other way is harder. Some software attempts to do this.In addition to static graphics, there are animation and video editing software. Computer graphics also can be used by other editing software such as Adobe Photoshop, Pizap, Microsoft Publisher, Picasa and etc. Other software that can be used is animation software, video editor software such as Windows Movie Maker etc.

10.9. Points and lines

Points are used throughout graphics as building blocks for more complicated shapes (e.g. triangles created with three points). Another fundamental geometric object in 2D graphics is the line. A line is defined as containing all 2D points (x,y) which satisfy teh equation ax+by+d =0

10.10. Polygons

Polygons are used in computer graphics to compose images that are three-dimensional in appearance. Usually triangular, polygons arise when an object's surface is modeled, vertices are selected, and the object is rendered in a wire frame model. This is quicker to display than a shaded model; thus the polygons are a stage in computer animation. The polygon count refers to the number of polygons being rendered per frame.

10.11Filling of polygons

The polygon is filled to considered the entire area when it is rendered. If it is not filled, only the points on the perimeter of the polygon will be drawn. When a polygon is filled, the interior of the polygon is considered. All of the pixels within the boundaries of the polygon is set to the specified color or pattern. In order to determine which pixels are inside the polygon, the odd-parity rule determining which pixel lies within the polygon and which lies outside, is used within the scan-line polygon fill algorithm. 

10.12.Text primitive

With the Text graphics primitive, we can insert text at any position in two- or three-dimensional Mathematical graphics. The text will be given in the graphic's base style.

10.13.Windowing and clipping

In computer graphics any object that is larger than the computer screen cannot be seen through the monitor i.e., window. So we have to remove the unseen portions of the image or block out those portions. This process is known as clipping and making the object to be seen through the window by using algorithms is known as windowing.

10.14.View port

A viewport is a rectangular viewing region in computer graphics, or a term used for optical components. 

Last modified: Monday, 16 September 2013, 7:05 AM