 Bitmap: A bitmap is a rectangular array of 0s and 1s that serves as a drawing mask for a corresponding rectangular portion of the window.  Applications:

Slides:



Advertisements
Similar presentations
Vertex Buffer Objects, Vertex Array Objects, Pixel Buffer Objects.
Advertisements

©Zachary Wartell, UNCC9/28/ :30 AM 1 Overview of OpenGL Revision: 1.2 Copyright Professor Zachary Wartell, University of North Carolina All Rights.
Basic Raster Graphics Algorithms for Drawing 2D Primitives
Computer Graphics Tz-Huan Huang National Taiwan University (Slides are based on Prof. Chen’s)
Graphics Pipeline.
Computer Graphics(Fall 2003) COMS 4160, Lecture 7: OpenGL 3 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
OPENGL Return of the Survival Guide. Buffers (0,0) OpenGL holds the buffers in a coordinate system such that the origin is the lower left corner.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
Informationsteknologi Monday, November 12, 2007Computer Graphics - Class 71 Today’s class Viewing transformation Menus Mandelbrot set and pixel drawing.
Buffers Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Buffers Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Raster Displays Images are composed of arrays of pixels displayed on a raster device. Two main ways to create images: –Scan and digitize an existing image.
Computer Graphics Ben-Gurion University of the Negev Fall 2012.
Introduction to OpenGL. What is OpenGL OpenGL is a low-level software interface to graphics hardware No commands for performing windowing tasks or obtaining.
Introduction to OpenGL (Part 3) Ref: OpenGL Programming Guide (The Red Book)
CS 4731: Computer Graphics Lecture 21: Raster Graphics Part 2 Emmanuel Agu.
CS 4731: Computer Graphics Lecture 17: Texturing Emmanuel Agu.
How Images are Represented Bitmap images (Dots used to draw the image) Monochrome images 8 bit grey scale images 24 bit colour Colour lookup tables Vector.
OpenGL Pixel Operations, Bitmaps, Fonts and Images The Current Raster Position Current raster position: A position in window coordinates where the next.
Picking. What is picking? Selecting an object on the screen What does this require? –Get Mouse Location –Compute what objects are rendered at the position.
Computer Graphics Texture Mapping Eriq Muhammad Adams
Tools for Raster Displays CVGLab Goals of the Chapter To describe pixmaps and useful operations on them. To develop tools for copying, scaling, and rotating.
Raster-scan system In addition to the central processing unit a special purpose processor called the video controller or display controller is used to.
Chapter 2 Getting Started: Drawing Figures. The Framebuffer Lecture 2 Fri, Aug 29, 2003.
Objectives Differentiate between raster scan display and random scan display.
Speeding Up Rendering After Deciding What to Draw.
Korea University Korea University Computer Graphics Laboratory Computer Graphics Laboratory Jung Lee, Chapter 13.
Imaging and Raster Primitives Vicki Shreiner. 2 Jobs Andrew Giles Andrew Giles Chuck Fultz Chuck Fultz SIGGraph - SIGGraph.
2002 by Jim X. Chen: 1 So far, we only concerned with the rendering of geometric data. Two other important classes of data:
CSE 470: Computer Graphics. 10/15/ Defining a Vertex A 2D vertex: glVertex2f(GLfloat x, GLfloat y); 2D vertexfloating pointopenGL parameter type.
Graphics Systems and OpenGL. Business of Generating Images Images are made up of pixels.
Lecture 4 Pixels, Images and Image Files 1. In this Lecture, you will learn the following concepts: Image files (in particular, the BMP file format) How.
Pixels, Images and Image Files 1 By Dr. HANY ELSALAMONY.
Character Generation.
INT 840E Computer graphics Introduction & Graphic’s Architecture.
Discrete Techniques Chapter 7 Begun February 22, 2005 Finished April 26, 2005.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Multimedia def. Many forms. Multimedia Text Hyperlinks Images Audio Animation Video Text Hyperlinks Images Audio Animation Video.
Review of OpenGL Basics
111/17/ :24 UML Solution Involves Selection of Discrete Representation Values.
2 COEN Computer Graphics I Evening’s Goals n Discuss displaying and reading image primitives n Describe texture mapping n Discuss OpenGL modes and.
1 3D API OPENGL ES v1.0 Owned by Silicon Graphics (SGL) Control was then transferred to Khronos Group Introduction.
OpenGL Architecture Display List Polynomial Evaluator Per Vertex Operations & Primitive Assembly Rasterization Per Fragment Operations Frame Buffer Texture.
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
OpenGL Viewing and Modeling Transformation Geb Thomas Adapted from the OpenGL Programming Guidethe OpenGL Programming Guide.
Viewing and Transformation. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture.
Fall UI Design and Implementation1 Lecture 6: Output.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
Computer Graphics Bing-Yu Chen National Taiwan University.
Buffers Computer Graphics I, Fall 2010.
Details of Texture Mapping Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, December 1, 2003.
Buffers. 2 Objectives Introduce additional OpenGL buffers Learn to read and write buffers Learn to use blending.
Adobe Photoshop CS4 – Illustrated Unit A: Getting Started with Photoshop CS4.
The Framebuffer Hyun-Chul Cho. HyunChul Cho - KUCG -2 Buffer Goal of a graphics program Draw pictures on the screen Screen Rectangular array.
Tan-Chi Ho, CGGM Lab., CSIE of NCTU Pixel Operations and Buffers.
CS425 © 2003 Ray S. Babcock Pixels and Bitmaps ● OpenGL allows us to work directly with bits and groups of bits, or pixels, which flow down a parallel.
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
Texture Mapping CEng 477 Introduction to Computer Graphics.
CSC Graphics Programming Budditha Hettige Department of Statistics and Computer Science.
Chapter 8. Drawing Pixels, Bitmaps, Fonts, and Images Computer Graphics (spring, 2009) School of Computer Science University of Seoul.
Buffers Ed Angel Professor Emeritus of Computer Science
Discrete Techniques.
Introduction to Computer Graphics with WebGL
Geb Thomas Adapted from the OpenGL Programming Guide
Computer Graphics, Lee Byung-Gook, Dongseo Univ.
Class 26 more textures environmental textures Color ramps
Computer Graphics, Lee Byung-Gook, Dongseo Univ.
Computer Graphics Buffers
Buffers Ed Angel Professor Emeritus of Computer Science
Class 27 more textures environmental textures Color ramps
Presentation transcript:

 Bitmap: A bitmap is a rectangular array of 0s and 1s that serves as a drawing mask for a corresponding rectangular portion of the window.  Applications: The most application of bitmaps in OpenGL is to display Fonts on the screen.  Raster Position: Points to a location on the screen where the bitmap is drawn(Lower Left Corner). Note: Raster Position is affected by MODEL_VIEW matrix  Use glRasterPos to set Raster Position

 Drawing Bitmaps: ◦ First setup the position that you want to draw using glRasterPos2i(x, y). ◦ Then use glBitmap as follow to draw the bitmap: glBitmap(width, height, xbo, ybo, xbi, ybi, const GLubyte *bitmap)

 Display lists are very useful when used with fonts.  A new list can be generated for each character and be called correspondingly when needed.  By using display lists, you can define a function that takes a text as input and prints out the input on screen.

 Reading, Writing, and Copying Pixel: ◦ Use three basic commands that manipulate image data  glReadPixels() - Reads a rectangular array of pixels from the framebuffer and stores the data in processor memory.  glDrawPixels() - Writes a rectangular array of pixels from data kept in processor memory into the framebuffer at the current raster position specified by glRasterPos*().  glCopyPixels() - Copies a rectangular array of pixels from one part of the framebuffer to another. This command behaves similarly to a call to glReadPixels() followed by a call to glDrawPixels(), but the data is never written into processor memory.

 glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels) Reads pixel data from the framebuffer rectangle whose lower-left corner is at (x, y) and whose dimensions are width and height and stores it in the array pointed to by pixels. Note: If you are using double-buffer, you have to specify which buffer are you using front buffer or back buffer.

 void glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) Draws a rectangle of pixel data with dimensions width and height. The pixel rectangle is drawn with its lower-left corner at the current raster position. format and type have the same meaning as with glReadPixels(). Note: If the current raster position is invalid, nothing is drawn, and the raster position remains invalid.

 Packing and unpacking refer to the way that pixel data is written to and read from processor memory.  During Packing and Unpacking, we are enable to manipulate the data read.  Such modifications consist of: ◦ Controlling Pixel-Storage Modes ◦ Pixel-Transfer Operations ◦ Pixel Mapping

 Packing and unpacking refer to the way that pixel data is written to and read from processor memory.  Sometimes you may be dealing with packing/unpacking a sub-image instead of the whole image.  In such conditions, controlling byte alignment may be very useful: ◦ Different machines have different byte orders ◦ Some machines have special hardware that works only if data is aligned in 2, 4 or 8 byte boundaries in processor memory. ◦ In such cases, we use glPixelStore to align the data

 Before the data is written to frame-buffer or processor memory, OpenGL can perform several operations on it.  The range of a component can be changed, e.g. you may want to change the range of red component to be other than [0,1]  Or, could be that the data you are using comes from a different graphic system which stores the RGB components in a different range rather than [0,1]  In these situations use glPixelTransfer function in order to transform the data as you need.

QUESTIONS?