VGA Color Registers How we can reprogram the Digital-to-Analog Converter’s 256 color-table registers.

Slides:



Advertisements
Similar presentations
VGA Text Mode An introduction to font selection and to reprogramming of the Character Generator ram.
Advertisements

CGA 115 Professor Mary A. Malinconico. Questions from Last Week ????????
Early PC Graphics Capabilities of the IBM Color Graphics Adapter (CGA) and Enhanced Graphics Adapter (EGA)
CS 686: Programming SuperVGA Graphics Devices Introduction: An exercise in working with graphics file formats.
Assembly Language for Intel-Based Computers Chapter 15: BIOS-Level Programming (c) Pearson Education, All rights reserved. You may modify and.
© red ©
The eyes have three different kinds of color receptors; One kind is most sensitive to short wavelengths, one to middle wavelengths, and one to long wavelengths.
Programming Super-VGA Graphics Devices Introduction to VESA graphics modes and to organization of the linear frame-buffer memory.
The CRT Controller How to modify CRTC registers to achieve a non-standard horizontal and vertical screen resolution.
Michener’s Algorithm An efficient scheme for drawing circles (and filling circular disks) on a raster graphics display.
Direct I/O Programming An introduction to the Pentium’s mechanism for programming peripheral hardware components.
Early PC Graphics Capabilities of the IBM Color Graphics Adapter (CGA) and Enhanced Graphics Adapter (EGA)
CS 686: Programming SuperVGA Graphics Devices Introduction: An exercise in working with graphics file formats.
SiS 315 An introductory exploration of features of the SVGA graphics processor used in our classroom’s workstations.
Lecture 121 Lecture 12: VGA Video ECE 412: Microcomputer Laboratory.
CSc 461/561 CSc 461/561 Multimedia Systems Part A: 2. Image.
Color of (digital image) Raed S. Rasheed Agenda Color. Color Image. Color Models – RGB color model. – CMYK color model. – HSV and HSL color model.
RAQUEL YANEZ 7 th grade Art a) Blue Blue b) Orange Orange c) Yellow Yellow d) Red Red.
SNC2D. Primary LIGHT colours are red, green, and blue SECONDARY light colours are created by combining only two of the three primary colours of light.
1 Internet Graphics. 2 Representing Images  Raster Image: Images consist of “dots” of color, not lines  Pixel: Picture element-tiny rectangle  Resolution:
Digital Images The digital representation of visual information.
Basics of a Computer Graphics System Introduction to Computer Graphics CSE 470/598 Arizona State University Dianne Hansford.
ROY G BIV The natural light that we see coming from the sun is generally perceived as white light. But we have all seen colored light in the form of a.
07: Color in Interactive Digital Media
Objective Understand concepts used to create digital graphics. Course Weight : 15% Part Three : Concepts of Digital Graphics.
ECE291 Computer Engineering II Lecture 9 Josh Potts University of Illinois at Urbana- Champaign.
Video Monitor Uses raster scanning to display images –Beam of electrons illuminates phosphorus dots on the screen called pixels. Starting at the top of.
Lab 8 Bit-Mapped Graphics Moving from text-based graphics to bit- mapped graphics. Easy to draw graphic points and lines using INT 10h, Function 0Ch (write.
Color and Resolution Introduction to Digital Imaging.
Using HiColor graphics
CSC Computing with Images
COLOR THEORYCOLOR THEORY. Pigment vs. Light pigments - "subtractive." Red, blue and yellow can create all the colors of the color wheel. (paint, pigments)
Which is the Pink Pen? Here is the Pink Pen (Example taken from
ECE291 Lecture 12 Mode 13h Graphics. ECE 291 Lecture 12Page 2 of 27 Lecture outline Color theory Video Hardware Mode 13h Graphics File Formats.
ECE291 Computer Engineering II Lecture 15 Josh Potts University of Illinois at Urbana- Champaign.
Ch 6 Color Image processing CS446 Instructor: Nada ALZaben.
COLOR THEORY Color is the eye’s response to the visual spectrum from red to violet. Different colors in the spectrum are created by different wavelengths.
DIGITAL IMAGE. Basic Image Concepts An image is a spatial representation of an object An image can be thought of as a function with resulting values of.
Digression on r/w ‘/proc’ files An application of kernel module programming to Super VGA graphics device control.
Color Mixing By: Whitney Buley.
Color & Light Benjamin Hammel image by refeia
Color Web Design Professor Frank. Color Displays Based on cathode ray tubes (CRTs) or back- lighted flat-screen Monitors transmit light - displays use.
Colors of Pigment The primary colors of pigment are magenta, cyan, and yellow. [
CS 101 – Sept. 14 Review Huffman code Image representation –B/W and color schemes –File size issues.
How to make a picture in black and white Mass Media Mr. Guzman 1st period.
22.3 Using Color pp Mr. Richter. Agenda  Warm-Up  Review HW  Notes:  How We See Objects  Mixing Pigments (The Subtractive Color Process)
Color.
Lecture 11 Text mode video
Direct-Access Color Graphics Chapter 11. Graphics modes C++ provides a different combination of graphics characteristics. These characteristics include.
 There are 3 primary colors of light RED, GREEN, & BLUE  When these colors of light are mixed… White Light is produced  This process is called color.
Flowchart of basic interrupt mechanism
The Colour of Light: Additive colour theory.
Images In Matlab.
COMS 161 Introduction to Computing
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Color Modes Photoshop.
An Introduction to Color
Colour Theories.
- orange white green - cyan - red - blue Example 1 24 bit RGB
Two ways to discuss color 1) Addition 2) Subtraction
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Science Olympiad Optics Color and Shadows.
Digital Image Processing
Hank Childs, University of Oregon
Basic Concepts of Digital Imaging
Visuals are analog signals...
Created for CVCA Physics by Dick Heckathorn 31 May 2K+4
Created for CVCA Physics by Dick Heckathorn 31 May 2K+4
- orange white green - cyan - red - blue Example 1 24 bit RGB
Section 3.4 The Colors of Light.
Presentation transcript:

VGA Color Registers How we can reprogram the Digital-to-Analog Converter’s 256 color-table registers

VGA’s color-innovation The VGA introduced display-mode 19 Allowed showing 256 simultaneous colors Used one byte of VRAM for every pixel Convenient addressing for programming Screen-resolution was only 320-by-200 But SVGA offers improved resolutions: –VESA mode 0x101: 640-by-480 –VESA mode 0x103: 800-by-600

‘digital’ versus ‘analog’ MDA and CGA used ‘digital’ cable-signals VGA introduced ‘analog’ cable-signals Special hardware needed: DAC controller Implements a table of 256 color-registers Supports primary colors: red, green, blue Supports 64 different intensities per color So each color-register implements 18-bits

Format of a color-register I/O port-addresses (for DAC programming): 0x03C8: index-register 0x03C9: data-register for writes 0x03C7: data-register for reads

Data-structure for colors typedef struct { char r, g, b; } rgb_t; rgb_t red = { 63, 0, 0 }; rgb_tgreen = { 0, 63, 0 }; rgb_tblue = { 0, 0, 63 }; rgb_twhite = { 63, 63, 63 };

Writing to a color-register rgb_tcolor = { 32, 48, 16 ); intindex = 15; // example: reprogramming a DAC register outb( index, 0x03C8 );// select register outb( color.r, 0x3C9 );// set r-component outb( color.g, 0x3C9 );// set g-component outb( color.b, 0x3C9 );// set b-component

Reading a color register rgb_tcolor; intindex = 14; // example: reading a DAC color-register outb( index, 0x3C8 );// select register color.r = inb( 0x3C7 );// get r-component color.g = inb( 0x3C7 );// get g-component color.b = inb( 0x03C7 );// get b-component

Demo: ‘studydac.cpp’ This is a ‘testbed’ for color experiments It uses VESA display-mode 0x4101 (i.e., 640-by-480, in 256 simultaneous colors) It draws a 16-by-16 grid of color-boxes Each box shows a color-register’s value Initially we see the ‘default’ color-values Then the 256 registers are reprogrammed’ But you can try out different color schemes

An array of color intensities Each color-component is a 6-bit number So there are 2 6 = 64 possible intensities (This applies to each color-component) So here’s how to build all the cyan-values: rgb_t table[ 64 ]; for (int i = 0; i < 64; i++) { table[i].b = i; table[i].g = i; table[i].r = 0; }

Why do we need to do this? We will soon study lighting and shadows, in order to create ‘photorealistic’ images It requires showing varied color-intensity We’ll want to be sure our hardware can display all intensities a given image needs We’ll want to arrange needed colors in an array, for conveniently accessing a given color-intensity in terms of its array-index

In-class exercise #1 Modify the ‘studydac.cpp’ demo-program so that it will simultaneously display: –32 intensities of blue –32 intensities of cyan –32 intensities of green –32 intensities of magenta –32 intensities of red –32 intensities of yellow –64 intensities of white

In-class exercise #2 Modify the ‘studydac.cpp’ demo-program so it will simultaneously display intensity- arrays for several ‘pastel’ colors. You can build these colors by “mixing” a pure color with the color white For example: pink = ½ red + ½ white