Вы находитесь на странице: 1из 25

Pixels and Framebuffer

Business of Generating Images


• Images are made up of pixels
RGB

RGB Color cube (what we use in


computer graphics)

Other color spaces include HSV, YUV, YCrCb, and


YIQ
The “goal” of computer graphics
• Solve the function
– Red @ a pixel is f(i,j)=…
– Green @ a pixel is f(i,j)=…
– Blue @ a pixel is f(i,j)=…
Two Dimensional Images
+Y
• Images (at least
the ones in this
class) are two
Y
dimensional
Axis
shapes.
• The two axes we
will label as X
(horizontal), and Y
(vertical). (0,0) X Axis +X
Hardware Pipeline

Input Computation Output

We want to draw a rectangle, how do we describe it to a computer?

Model (n) - object


description that a
computer understands.
Partition the space

(7,9) (14,9)

1. Define a set of points


(vertices) in 2D space.
2. Given a set of vertices,
draw lines between
consecutive vertices. (7,3) (14,3)

Vertex (pl. Vertices) - a point in 2 or 3 dimensional space.


Record every position

Bitmap - a rectangular array of bits mapped one-to-one with pixels.


Position relative

Vector display system - graphical output system that was based on strokes (as
opposed to pixels). Also known as: random, calligraphic, or stroke displays.
Representing Objects
• Most common method is the VERTEX method.
Define the object as a set of points with
connectivity information.
• Why is connectivity important?

Connectivity - information that defines which vertices


are connected to which other vertices via edges.
Edge - connects two vertices
How do we do this?
Input Devices
• Locator Devices
• Keyboard
• Scanner
– Images
– Laser
• Cameras (research)
Locator Devices

When queried, locator devices return a


position and/or orientation.

•Mouse (2D and 3D)


•Trackball
•Joystick (2D and 3D)
Locator Devices
When queried, locator
devices return a
position and/or
orientation.
• Tablet
• Virtual Reality Trackers
– Data Gloves
– Digitizers
Keyboard
• Text input
– List boxes, GUI
– CAD/CAM
– Modeling
• Hard coded
– Vertex locations are inserted into code
Scanners
• Image Scanners - Flatbed,
etc.
– What type of data is
returned? Bitmap
• Laser Scanners -
Deltasphere
– Emits a laser and does time of
flight. Returns 3D point
• Camera based - research
– Examine camera image(s) and
try to figure out vertices from
them.
Many others
• Light Pens
• Voice Systems
• Touch Panels
• Camera/Vision Based
• Which is best?
Common
Modeling
Approach
• Hybrid
• Animator jobs
Computation Stage

Input Computation Output

• Now that we have a model of what we


want to draw, what goes on inside the
computer to generate the output?
Computation

Transformations Rasterization
Computation Stage

Computation

Model Output

Transformations Rasterization

Transformed
Model
How do we store this?

We would like to allocate memory to hold the


results of the computation stage.
Framebuffer

Framebuffer - A block of memory, dedicated


to graphics output, that holds the contents
of what will be displayed.

Pixel - one element of the framebuffer


Framebuffer
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Questions:

How much
What isHow
the
Howmemory
big
largest
many
is the do
imageweyou
pixels need
framebuffer?
are cantodisplay?
there?allocate
for the framebuffer?
Framebuffer in Memory
• If we want a framebuffer of 640 pixels by 480
pixles, we should allocate:
framebuffer = 640*480 bits
• How many bit should we allocate?
Q: What do more bits get you?

A: More values to be stored at each pixel.


Why would you want to store something
other than a 1 or 0?
Framebuffer bit depth
• How many colors does 1 bit get you?
• How many colors do 8 bits get you?
– Monochrome systems use this (green/gray scale)
• What bit depth would you want for your
framebuffer?

bit depth - number of bits allocated per pixel in a buffer

Вам также может понравиться