lecture4 raster details in computer graphics(computer graphics tutorials)

35
CSC 406 Applied Computer Graphics LECTURE 4: LECTURE 4: Raster Displays - Raster Displays - details details

Upload: daroko-blogwwwprofessionalbloggertrickscom

Post on 06-May-2015

517 views

Category:

Software


1 download

DESCRIPTION

This presentation will introduce you to Raster details in computer graphics. --------------------------------------------------------------------------- Do Not just learn computer graphics an close your computer tab and go away.. APPLY them in real business, Visit Daroko blog for real IT skills applications,androind, Computer graphics,Networking,Programming,IT jobs Types, IT news and applications,blogging,Builing a website, IT companies and how you can form yours, Technology news and very many More IT related subject. -simply google:Daroko blog(professionalbloggertricks.com) • Daroko blog (www.professionalbloggertricks.com) • Presentation by Daroko blog, to see More tutorials more than this one here, Daroko blog has all tutorials related with IT course, simply visit the site by simply Entering the phrase Daroko blog (www.professionalbloggertricks.com) to search engines such as Google or yahoo!, learn some Blogging, affiliate marketing ,and ways of making Money with the computer graphic Applications(it is useless to learn all these tutorials when you can apply them as a student you know),also learn where you can apply all IT skills in a real Business Environment after learning Graphics another computer realate courses.ly • Be practically real, not just academic reader

TRANSCRIPT

Page 1: lecture4 raster details in computer graphics(Computer graphics tutorials)

CSC 406Applied Computer

Graphics

LECTURE 4:LECTURE 4:

Raster Displays - detailsRaster Displays - details

Page 2: lecture4 raster details in computer graphics(Computer graphics tutorials)

Daroko blog-

Do Not just learn computer graphics an close your computer tab and go away..

APPLY them in real business, Visit Daroko blog for real IT skills

applications,androind, Computer graphics,Networking,Programming,IT jobs Types, IT news and applications,blogging,Builing a website, IT companies and how you can form yours, Technology news and very many More IT related subject.

-simply google:Daroko blog(professionalbloggertricks.com)

Lecture4 CSC 406 - Computer Graphics 2

Page 3: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 3

Lecture 4:Lecture 4:

Scope: Raster memory. Attributes. Raster Ops.

Lecture Goals: To examine the memory concepts in raster

display. To understand the different attributes of raster

desplay.

Page 4: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 4

Page 5: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 5

Raster Memory:Raster Memory:

Pixmap: A pixmap is storage for a whole raster of pixel values. Usually a contiguous area of memory, comprising one row

(or column) of pixels after another.

Bitmap: Technically a bitmap is a pixmap with 1 bit per pixel, i.e.

boolean colour values, e.g. for use in a black-and-white display.

But 'bitmap' is often misused to mean any pixmap - please try to avoid this!

Page 6: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 6

Raster memory…

Pixrect: A pixrect is any 'rectangular area' within a pixmap.

A pixrect thus typically refers to a series of equal-sized fragments of the memory within a pixmap, one for each row (or column) of pixels.

Page 7: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 7

Frame Buffer:

Frame buffers are often special two-ported memory devices ('video memory') with one port for writing and another for concurrent reading.

Alternatively they can be part of the ordinary fast RAM of a computer, which allows them to be extensively reconfigured by software.

Page 8: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 8

Page 9: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 9

Frame buffer…

Defn: A frame buffer is a video output device that drives a video display from a memory buffer containing a complete frame of data.

The information in the buffer typically consists of color values for every pixel (point that can be displayed) on the screen.

Page 10: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 10

Frame buffer…

Color values are commonly stored in: 1-bit monochrome, 4-bit palettized, 8-bit palettized, 16-bit highcolor and 24-bit truecolor formats.

An additional alpha channel is sometimes used to retain information about pixel transparency.

Page 11: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 11

Frame buffer…

The total amount of the memory required to drive the frame buffer depends on the resolution of the output signal, and on the color depth and palette size.

Frame buffers differ significantly from the vector graphics displays that were common prior to the advent of the frame buffer.

Page 12: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 12

Frame buffer…

With a vector display, only the vertices of the graphics primitives are stored. The electron beam of the output display is then

commanded to move from vertex to vertex, tracing an analog line across the area between these points.

Page 13: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 13

Frame buffer…

With a framebuffer, the electron beam (if the display technology uses one) is commanded to trace a left-to-right, top-to-bottom path across the entire screen, the way a television renders a broadcast signal. At the same time, the color information for each

point on the screen is pulled from the frame buffer, creating a set of discrete picture elements (pixels).

Page 14: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 14

Option1: Frame buffer is anywherein system memory

System Bus

CPU Video Controller

System Memory

Monitor

Frame bufferCartesian

Coordinates

Page 15: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 15

Option2: Permanent place forframe buffer

System Bus

CPU Video Controller

System Memory Monitor

Frame bufferCartesian

Coordinates

FrameBuffer

•Direct connection tovideo controller

Page 16: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 16

Frame buffer…

With respect to color displays, there are two types of frame buffers: Direct color frame buffer Color lookup frame buffer

Page 17: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 17

Page 18: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 18

Page 19: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 19

Page 20: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 20

Page 21: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 21

Raster memory…

In a bit-mapped display, the display processor refreshes the screen 25 or more times per second, a line at a time, from a pixmap termed its frame buffer.

In each refresh cycle, each pixel's colour value is 'copied' from the frame buffer to the screen.

Additional raster memory may exist 'alongside' that for colour values. For example there may be an 'alpha channel'

(transparency values) a z-buffer (depth values for hidden object removal), or an a-buffer (combining both ideas).

Page 22: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 22

Key Attributes of Raster Key Attributes of Raster Displays:Displays:

Major attributes that vary between different raster displays include the following:

'Colour': bi-level, greyscale, pseudo-colour, true colour: Refer to 'pixel values' in lecture3

Size: usually measured on the diagonal: inches or degrees;

Aspect ratio: now usually 5:4 or 4:3 (625-line TV: 4:3; HDTV: 5:3);

Page 23: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 23

Attributes…

Resolution: e.g. 1024×1280 (pixels). Multiplying these numbers together we can say e.g. 'a 1.25

Mega-pixel display'. Avoid terms such as low/medium/high resolution which may

change over time. Pixel shape:

now usually square; other rectangular shapes have been used.

Brightness, sharpness, contrast: possibly varying significantly with respect to view angle.

Page 24: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 24

Attributes…

Speed, interlacing: now usually 50 Hz or more and flicker-free to

most humans; Computational features, as discussed

next...

Page 25: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 25

Computational features:Computational features:

Since the 1970s, raster display systems have evolved to offer increasingly powerful facilities, often packaged in optional graphics accelerator boards or chips.

These facilities have typically consisted of hardware implementation or acceleration of computations which would otherwise be coded in software, such as:

Page 26: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 26

Computational features…

Raster-ops: fast 2D raster-combining operations explained next;

2D scan conversion, i.e. creating raster images required by 2D drawing primitives such as: 2D lines, e.g. straight/circular/elliptical lines, maybe spline

curves (based on several points); 2D coloured areas, e.g. polygons or just triangles, possibly

with colour interpolation; Text (often copied from rasterised fonts using raster-ops);

Page 27: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 27

Computational features…

3D graphics acceleration - now often including 3D scan conversion.

It is useful for graphics software developers to be aware of such features and how they can be accessed, and to have insight into their cost in terms of time taken as a function of length or area.

Page 28: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 28

Raster Ops:Raster Ops:

'Raster Ops' are logical operations affecting multiple pixels in a pixmap (or raster frame buffer).

Raster graphics terminals typically have special hardware which executes Raster Ops very quickly.

A raster-op assigns to a destination pixrect D a logical function of the initial state D and an equal-sized source pixrect S. This logical function is the same for each pixel of D and

each corresponding pixel of S.

Page 29: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 29

Raster Ops…

All bits in a destination pixel are processed in parallel. So each bit in a destination pixrect D is assigned the

specified logical function of its initial value and the value of the corresponding bit in a congruent source pixrect S.

Or S may be a bitmap; then the same source bit is applied with each bit of a destination pixel.

There are 16 possible 'logical functions' (boolean operators) which may be used, See truth table on next slide:

Page 30: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 30

Raster Ops…Source 001 1Destination 01 01

0 0 (clear) 00001 and 00012 S and not D 00103 S (copy) 00114 D and not S 01005 D (no op) 01016 xor 01107 or 01118 nor 10009 equiv 1001a not D (invert) 1010b S or not D 1011c not S 1100d D or not S 1101e nand 1110f 1 (set) 1111

Page 31: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 31

Raster Ops…

The functions commonly used are 0 (clear), 3 (copy), 6 (xor), a (invert) and f (set), especially copy. Scrolling is generally done by repeated use of the copy

function such that the source and destination pixrects are overlapping regions of the frame buffer.

Another frequent use of the copy function is to save a copy of part of a background image before drawing a moving object over it, then copying back the saved image and repeating this process for further positions and states of the moving object.

Page 32: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 32

Raster Ops…

The basic raster-op scheme is often extended as follows: By the use of a clip mask to distinguish between

destination pixels the raster-op affects and destination pixels which are unaffected.

The clip mask is usually just a bitmap. Some raster-op hardware allows a clip mask bitmap to

be used in with independent source and destination pixrects.

In some cases a clip mask and a colour may be used as an alternative to a source pixrect.

Page 33: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 33

Raster Ops…

By the use of a plane mask to limit the planes of a frame buffer that will be affected. A plane mask is a pixel value in which (usually)

1's specify affected planes and 0's specify unaffected planes.

Thus pixmaps with n-bit pixel values can be treated as having n different 'bit-planes'. For example an 8-bit-pixel pixmap can be used to hold

two 4-bit-pixel images or four 2-bit-pixel images.

Page 34: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 34

Raster Ops…summary

Among other things, raster-ops enabled draggable icons, sprites (animated icons) and a whole generation of computer games using 2D graphics operations to achieve cheap-and-cheerful pseudo-3D effects.

Multiple window user interfaces make extensive use of raster-ops. The X window system has long done this with particular

efficiency, both in using raster-ops in conjunction with advanced repainting algorithms and in making raster-op functionality accessible to applications programmers.

Page 35: lecture4 raster details in computer graphics(Computer graphics tutorials)

Lecture4 CSC 406 - Computer Graphics 35

Next Lecture…

Scan conversion. Device independence/ normalization.