30
Computer Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion

Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Embed Size (px)

Citation preview

Page 1: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Computer GraphicsRaster Scan Display System, Rasterization,

Refresh Rate, Video Basics and Scan Conversion

Page 2: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 2

Page 3: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Refresh and Raster Scan Display System

• Used in Television Screens.

• Refresh CRT is point plotting device.

• It use refresh buffer to store display primitives(line, characters, shaded, patterned areas).

• Refresh buffer store the primitives in terms of points and pixels components.

• Display screen is a matrix of pixels. And each pixel brightness can be controlled.

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 3

Page 4: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Refresh and Raster Scan Display System

• Each point is an addressable point in screen and memory.

• Line can not be drawn directly from one point to another.

• This causes the effect of aliasing , jagging , staircase effect.

• Refresh buffer is also called bit – plane.

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 4

Page 5: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Rasterization

• General Line

• Special Line

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 5

D B

A C

B

A

(a) General Line (b) Special Line

Page 6: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

• Raster is stored as a matrix of pixels representing the entire screen area.

• Entire screen is scanned out sequentially by the video controller (One raster line at a time)

• Raster lines are scanned from top to bottom and then back to the top.

• The intensity of the beam decide the brightness of the pixel.

• At least on memory – bit for each pixel is required.(bit - plane).

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 6

Page 7: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Basic Video Controller Refresh Operations

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 7

Raster-Scan Generator

Y Register

Memory Address

Pixel Register

Frame Buffer

INTENSITY

Horizontal and Vertical Deflection

Voltages

X Register

Page 8: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Architecture of Raster Display

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 8

Page 9: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Raster Scan

• With outline primitives

• With filled primitives

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 9

B

Page 10: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Refresh Rate

• A Typical Example

– If one uses a 512 X 512 element raster display, then 218 bits are required in a single bit plane.

– Memory size required – 32 KB

– A DAC is used to convert the bit values (0,1) to analog signals for refreshing the screen.

– Memory size required for N- bit gray level frame buffers:

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 10

N Size in KB

3 96

8 256

24 768

Page 11: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Refresh Rate

• Refresh Rate to avoid flickering – 60 Hz

• If one uses a 1024 X 1024 high resolution CRT:

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 11

N Display Color Memory Size

1 Black & White 128KB

8 256 color 1MB

24 16 million color 3MB

32 16 million color 4MB

Page 12: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Refresh Rate• Refresh Rate of CRT is the number of times the image is drawn on the screen

per second.

• Reducing refresh rate increases flicker.

• Horizontal Scan Rate is the number of scan lines the circuit drives a CRT display per second.

HSR= Refresh Rate X number of scan lines

• Resolution of screen is depend on spot size.

• CRT resolution is not a function of bitmap resolution.

• For large spot size, resolution decreases.

• Horizontal Resolution depends on spot size and beam switching (ON/OFF) speed.

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 12

Page 13: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 13

Resolution

• Resolution is the number of pointes per inch or centimeter that can be plotted horizontally & vertically.

• The smaller the spot size, the higher the resolution.• The higher the resolution, the better is the graphics system• High quality resolution is 1280x1024

• The intensity distribution of spots on the screen have Gaussian shape.

• Adjacent points will appear distinct as long as their separation is greater than the diameter at which each spot has intensity of about 60% of that at the center of the spot.

Intensity distribution

Page 14: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 14

Persistence• How long small spots continue to emit light after

the beam is moved. How long it takes to the emitted light from the screen to decay to one-tenth of its original intensity.

– Lower persistence requires high refresh rate & it is good for animation

– High persistence is useful for displaying highly complex static picture.

– Graphics monitors are usually constructed with 10 to 60 microseconds.

Page 15: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Bandwidth Of Display

• The rate at which the beam can be turned ON to OFF and vice-versa.

• For N pixel per scan line, it is necessary to turn the electron gun at maximum rate of N/2 times ON and N/2 times OFF.

• This will create alternative black and white lines on the screen.

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 15

Page 16: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 16

1-Bit Memory, Monochrome Display (Bitmap Display)

Electron

Gun

1 bit

2 levels

Page 17: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 17

3-Bit Color Display

3

red

green

blue

COLOR: black red green blue yellow cyan magenta white

R

G

B

0

0

0

1

0

0

0

1

0

0

0

1

1

1

0

0

1

1

1

0

1

1

1

1

Page 18: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 18

True Color Display

Green

Red

Blue

8

8

8

24 bitplanes, 8 bits per color gun.

224 = 16,777,216

Page 19: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

• Horizontal Retrace : As the electron bean reached at right edge of the screen, it is made invisible and rapidly return to left edge.

• Time taken for horizontal retrace is 17% of allotted to scan horizontal line.

• Vertical Retrace: Return the beam from bottom left edge to top right edge.

– Odd field Vertical Retrace

– Even field Vertical Retrace1/13/2011

Gaurav Raj, Lovely Professional University, Punjab

19

Page 20: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Raster Scan

1/13/2011Gaurav Raj, Lovely Professional University,

Punjab 20

Vertical Retrace

Horizontal Retrace

Scan Line

Page 21: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Video Basic Standards • NTFS: (Amarican Standerd Video) has 525 horizontal lines

with a frame rate of 30 fps.

• Viewing aspect ratio 4:3

• Each frame has two fields, each containing half the picture.

• Fields are interlaced or interwoven.

• Fields are presented alternatively every other 1/60th of second.

• One field contain odd scan line(1,3,5,…).

• Other field contain even scan line (0,2,4,6,….).1/13/2011

Gaurav Raj, Lovely Professional University, Punjab

21

Page 22: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

BLACKNo light is reflected All the light is absorbed

WHITEAll the light is reflectedNo light is absorbed

YELLOWYellow light is reflectedThe rest of light is absorbed

Conclusion:If the model is based on reflection, then black is 0 (RGB).If the model is based on absorption, then black is 1 (CMY).

… let’s try to we think this way:

Computer colour system

1/13/2011 22Gaurav Raj, Lovely Professional University,

Punjab

Page 23: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

RGB

R BG

RGB (Red, Green, Blue)

Red (255,0,0)Green (0,255,0)Blue (0,0,255)

Each colour has a range from 0 to 255, i.e. 256 levels

(255,255,0)

There are 256 x 256 x 256 = 16,777,216 possible colors.

(215,185,229)

1/13/2011 23Gaurav Raj, Lovely Professional University,

Punjab

Page 24: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

(255,255,255)(#FFFFFF)

(0,0,0)(#000000)

The colors may also be written as range of:• binary numbers from 00000000 to 11111111• hexadecimal from 00 to FF

(255,255,0)(#FFFF00)

(56,108,98)(#386C62)

CMYsystem

1/13/2011 24Gaurav Raj, Lovely Professional University,

Punjab

Page 25: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

How colours and pigments combine

RGB describes colours:

• R – red• G – green• B – blue

CMYK describes pigments:

• Y – yellow• M – magenta (pink)• C – cyano (aqua)

• K – black (key colour)

1/13/2011 25Gaurav Raj, Lovely Professional University,

Punjab

Page 26: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Hue, Saturation, and Brightness/Lightness = HSL/HSB

RGB (255,255,0)HSL (42,255,128)

HSL (x,x,255)= full light

HSL (x,x,0)= no light

HSL (42,155,255)

HSL (42,114,255)

HSL (42,0,255)

HSL (42,255,226)

HSL (42,255,114)

Brightness change

Saturation change

HSL scheme is an alternative to RGB to express colours

1/13/2011 26Gaurav Raj, Lovely Professional University,

Punjab

Page 27: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Colour depth

• 1 pixel = 1 bit, i.e. it can be 0 or 1 to express only black or white colors

• The image consisting of 1-bit pixels is called:

– 1-bit image or bi level image or black-and-white image

– If we have a two-megapixel image (1,920,000 pixels), then such an image will have 1,920,000 bits, i.e. 240,000 bytes (240 KB)

1/13/2011 27Gaurav Raj, Lovely Professional University,

Punjab

Page 28: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Colour depth

• 1 pixel = 8 bits (= 1 byte), i.e. we can express a palette of 256 different colors

– Then the above two-megapixel image will have 1.92 MB

• 1 pixel = 24 bits (= 3 bytes), i.e. each byte can express 256 colors, i.e. altogether 16,777,216 possible colors

– Then the above two-megapixel image will have 5.76 MB

1/13/2011 28Gaurav Raj, Lovely Professional University,

Punjab

Page 29: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

Colour depth

1-bit 4-bit 8-bit 12-bit

24-bit

The color depth says in how deep the pixel is, i.e. it informs about the numberof possible colors.

1/13/2011 29Gaurav Raj, Lovely Professional University,

Punjab

Page 30: Computer Graphics - WordPress.com Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion 1/13/2011 Gaurav Raj, Lovely Professional University,

However, if the color is special…

• If the R, G, and B components have equal values, e.g. (57,57,57) … then the pixel will be grey

• Such an image will not have 16 million colors, but only 256 shades of grey

• As we need only one byte to express this, the image will be three times smaller than the full (true) color image

• The image in shades of grey is a color image, we should not talk about it as about black-and-white image (as we do in the field of non-color photographs)

1/13/2011 30Gaurav Raj, Lovely Professional University,

Punjab