Discrete Techniques Discrete Techniques Chapter 7 Chapter 7 Begun February 22, 2005 Begun February 22, 2005 Finished April 26, 2005 Finished April 26, 2005
Discrete TechniquesDiscrete Techniques
Chapter 7Chapter 7
Begun February 22, 2005Begun February 22, 2005
Finished April 26, 2005 Finished April 26, 2005
BuffersBuffers
Frame buffer consists of Frame buffer consists of Front color bufferFront color buffer Back color bufferBack color buffer Depth bufferDepth buffer
Each buffer has the dimensions (Each buffer has the dimensions (nn x x mm) of the ) of the display window.display window.
The depth (The depth (kk) of each buffer can vary. For RGB, ) of each buffer can vary. For RGB, it would be the number of bits per color X 3 it would be the number of bits per color X 3 colors. colors.
Bitplane refers to any of the Bitplane refers to any of the k nk n x x mm planes. planes.
Digital ImagesDigital Images
Glubyte myColorImage [512][512]Glubyte myColorImage [512][512][3];[3];
Glubyte myGrayImage [512][512];Glubyte myGrayImage [512][512]; Glubyte myLUTImage [512][512], Glubyte myLUTImage [512][512], red[256], green[256], red[256], green[256], blue[256];blue[256];
Creating Digital ImagesCreating Digital Images
With an algorithm.With an algorithm. From data.From data. From standard image formats.From standard image formats.
GIFGIF TIFFTIFF PSPS EPSEPS JPEGJPEG OpenGL does not support image formats.OpenGL does not support image formats.
From graphics system.From graphics system.
Writing Into BuffersWriting Into Buffers
Bitblt write operationBitblt write operation Write_block(Write_block(
source /* buffer */,source /* buffer */, n /* nrows */, n /* nrows */, m /* ncols */, m /* ncols */, x /* lower left x pos */,x /* lower left x pos */, y /* lower left y pos */,y /* lower left y pos */, destination /* buffer */, destination /* buffer */, u /* destination pos x */, u /* destination pos x */, v /* destination pos y */);v /* destination pos y */);
Writing ModesWriting Modes
Define writeDefine write Simple assignmentSimple assignment
x1 = x2x1 = x2
Replacement functionReplacement function d = f(d, s)d = f(d, s)
Writing With XORWriting With XOR
Most interesting functionMost interesting function Painting ApplicationPainting Application
S S S xor M S xor M M M S xor M S xor M S S S xor M S xor M
Bit and Pixel Operations in Bit and Pixel Operations in OpenGLOpenGL
Defines an internal cursorDefines an internal cursor glRasterPos3f(x, y, z);glRasterPos3f(x, y, z); glBitmap(width, /* # bits wide */glBitmap(width, /* # bits wide */
height, /* # bits high */height, /* # bits high */x0, /*offset from current x0, /*offset from current
raster position */raster position */y0, /* offset from current y0, /* offset from current
rster position */rster position */xi, /* x increment */xi, /* x increment */
Xy, /* y increment */Xy, /* y increment */
Raster FontsRaster Fonts
Pixels and ImagesPixels and Images
Lookup TablesLookup Tables
Buffers for PickingBuffers for Picking
Mapping MethodsMapping Methods
Texture MappingTexture Mapping
2D Texture Mapping2D Texture Mapping
Texture Mapping in OpenGLTexture Mapping in OpenGL
Texture Objects and Texture Objects and MultitexturingMultitexturing
Texture GenerationTexture Generation
Environmental MapsEnvironmental Maps
Bump MapsBump Maps
Compositing TechniquesCompositing Techniques
Opacity and BlendingOpacity and Blending
Image CompositingImage Compositing
Blending and Compositing in Blending and Compositing in OpenGLOpenGL
AntialiasingAntialiasing
Back-to-front and Front-to-Back-to-front and Front-to-back Renderingback Rendering
Depth Cue and FogDepth Cue and Fog
Multirendering and the Multirendering and the Accumulation BufferAccumulation Buffer
Scene AntialiasingScene Antialiasing
Bump Mapping and Bump Mapping and EmbossingEmbossing
Image ProcessingImage Processing
Image ExtensionsImage Extensions
Other Multipass MethodsOther Multipass Methods
Sampling and AntialiasingSampling and Antialiasing
Sampling TheorySampling Theory
ReconstructionReconstruction
QuantizationQuantization
Each sample must be quantized into k Each sample must be quantized into k discrete levels.discrete levels. Analog Scale - whole number of lbsAnalog Scale - whole number of lbs Image - pixel colorImage - pixel color
Binary image - two colors, b/wBinary image - two colors, b/w
Program 4Program 4
Due March 3, 2005Due March 3, 2005 Documentation 10%Documentation 10% Style 10%Style 10% Compiles 30%Compiles 30% Graphic Output 10%Graphic Output 10%