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.

Slides:



Advertisements
Similar presentations
Lecture 2 Concepts, Terms and Definitions. Display Devices They are divided into a lot of small squares called pixels (“PICture ELements”). Each pixel.
Advertisements

RAPTOR Syntax and Semantics By Lt Col Schorsch
DOS and BIOS Interrupts DOS and BIOS interrupts are used to perform some very useful functions, such as displaying data to the monitor, reading data from.
1 Graphic adapters and monitors – the summary. 2 Outline The summary of principles of displaying the information – adapters and monitors. Black and white.
Assembly Language for Intel-Based Computers Chapter 15: BIOS-Level Programming (c) Pearson Education, All rights reserved. You may modify and.
Binary Representation
Graphics File Formats. 2 Graphics Data n Vector data –Lines –Polygons –Curves n Bitmap data –Array of pixels –Numerical values corresponding to gray-
Lecture 121 Lecture 12: VGA Video ECE 412: Microcomputer Laboratory.
Web siteWeb site ExamplesExamples Irvine, Kip R. Assembly Language for Intel-Based Computers, Stack Operations Runtime Stack PUSH Operation POP.
CS110: Computers and the Internet Color and Image Representation.
1 Internet Graphics. 2 Representing Images  Raster Image: Images consist of “dots” of color, not lines  Pixel: Picture element-tiny rectangle  Resolution:
PC Maintenance: Preparing for A+ Certification Chapter 15: Video Cards.
Visual Representation of Information
Video Monitor Uses raster scanning to display images
ORG ; FOUR INT 21H and INT 10H Programming and Macros Dec Hex Bin
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
Objective Understand concepts used to create digital graphics. Course Weight : 15% Part Three : Concepts of Digital Graphics.
Digital Terminology. Bitmap A representation consisting of rows and columns of dots of a graphic image stored in computer memory. To display a bitmap.
Colours and Computer Jimmy Lam The Hong Kong Polytechnic University.
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.
ECE 448: Lab 6 VGA Display (mini chess game). Video Graphic Array (VGA) Resolution: 640x480 Display: 16 colors (4 bits), 256 colors (8 bits) Refresh Rate:
Computer Graphics Raster Devices Transformations Areg Sarkissian.
Text-mode Video Dr. Dimitrios S. Nikolopoulos CSL/UIUC
© 1999 Rochester Institute of Technology Introduction to Digital Imaging.
Nov 061 Size Control How is a component’s size determined during layout and during resize operations? Three factors determine component sizes: The component’s.
Introduction to Experiment 5 VGA Signal Generator ECE 448 Spring 2009.
Computer Science 112 Fundamentals of Programming II Graphics Programming.
Agenda Last class: Memory, Digitizing Numbers Today: Digitizing: Text
INT 840E Computer graphics Introduction & Graphic’s Architecture.
Image Representation. Digital Cameras Scanned Film & Photographs Digitized TV Signals Computer Graphics Radar & Sonar Medical Imaging Devices (X-Ray,
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.
Video systems. Lesson plan Review the code for the previous exercise Video systems Review for midterm exam.
Lecture 7: Intro to Computer Graphics. Remember…… DIGITAL - Digital means discrete. DIGITAL - Digital means discrete. Digital representation is comprised.
Ch 6 Color Image processing CS446 Instructor: Nada ALZaben.
ECE 448: Lab 4 VGA Display. Bouncing Ball.. Organization and Grading.
CS1372: HELPING TO PUT THE COMPUTING IN ECE CS1372 Some Basics.
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.
Digital Imaging Fundamentals Ms. Hema C.R. School of Mechatronic Engineering.
Why a bitmap (.bmp), not a.jpg? If you cannot save a.bmp, make it an uncompressed.tif. Compression (of this 8-bit 397,000 pixel image): none (397kb memory)medium.
Color Web Design Professor Frank. Color Displays Based on cathode ray tubes (CRTs) or back- lighted flat-screen Monitors transmit light - displays use.
COMPUTER GRAPHICS. Can refer to the number of pixels in a bitmapped image Can refer to the number of pixels in a bitmapped image The amount of space it.
ECE 448: Lab 5 VGA Display. Breaking-Bricks..
String Instructions String instructions were designed to operate on large data structures. The SI and DI registers are used as pointers to the data structures.
4. Kernel and VGA ENGI 3655 Lab Sessions. Richard Khoury2 Textbook Readings  None.
Fundamentals of Digital Images & Photography. Pixels & Colors The pixel (a word invented from "picture element") is the basic unit of programmable color.
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
Week 9 Monitors and output to the screen. Monitors, also known as Visual display units (V.D.Us) Desktop computers contain a Cathode Ray Tube (C.R.T.)
Assembly 09. Outline Strings in x86 esi, edi, ecx, eax stosb, stosw, stosd cld, std rep loop 1.
Arrays. Outline 1.(Introduction) Arrays An array is a contiguous block of list of data in memory. Each element of the list must be the same type and use.
CSC 221 Computer Organization and Assembly Language Lecture 15: STACK Related Instructions.
Graphics and Image Data Representations 1. Q1 How images are represented in a computer system? 2.
Lecture 11 Text mode video
Direct-Access Color Graphics Chapter 11. Graphics modes C++ provides a different combination of graphics characteristics. These characteristics include.
Information in Computers. Remember Computers Execute algorithms Need to be told what to do And to whom to do it.
Lesson 13 – Color and Typography. 2 Objectives Understand basic color theory. Understand the color wheel. Understand how color is presented on a computer.
ECE291 Computer Engineering II Lecture 12 Josh Potts University of Illinois at Urbana- Champaign.
Chapter 8 String Operations. 8.1 Using String Instructions.
Computer Graphics Lecture 04 Point Taqdees A. Siddiqi
Images Data Representation.
Data Representation Images.
Binary Representation in Audio and Images
Understanding the Geometric Shape Code
9/17/2018 Kiến Trúc Máy Tính.
Microprocessor and Assembly Language
Computer Graphics Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion.
Assembly Language for Intel-Based Computers, 5th Edition
COMS 161 Introduction to Computing
Visuals are analog signals...
Presentation transcript:

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 pixel) Have to put the video adapter in one of the standard graphics modes (INT 10h, Function 00h).

Graphics Mode- Will use modes 12h (VGA – 16-color), 0Dh (16 color), 04h (4-color), and 13h (256 color)

Lab 8A – VGA Modes Determine the current video mode and save. Set new video mode. Divide the number of rows by the number of colors in the chosen mode. Write the correct number of rows of pixels so that horizontal bands of each color with an equal number of rows are present. Bandsize = Maxrow/maxpix where maxpix is number of colors in mode. The variable bandcount is used to track how many rows have been written. Each row is written and then the bandsize is checked to see if bandsize = bandcount.

Lab Question #1 Modify the program so that the colors and displayed in vertical stripes instead of horizontal stripes.

Lab 8B – Color Representation A pixel color is composed of three components (Red(R), Green(G), Blue(B)) The video DAC converts a digital value that represents a color to the analog voltage needed by the RGB monitor. 24-bit color means that 8-bits are used for each of the R,G,B color components. (Each pixel requires 3 bytes) Number of bytes needed for one screen is 640x480x3 = 921,600 Bytes

Lab 8B – Color Representation Rather than use the DAC to convert every digital signal that comes from the PC into a voltage range (2 24 different values), some subset could be stored in memory with the correct voltages. This could drastically reduce the amount of memory on the video card. A palette is a LUT on the Video DAC. There is a default palette or one can create their own palette. Note that color 0 of the palette is the border color.

Examples of RGB values for colors Bright Red (255, 0, 0) Bright Blue (0, 0, 255) Bright Green (0, 255, 0) Yellow (255, 255, 0) Magenta(255, 0, 255) Teal (0, 255, 255) Gray (63, 63, 63) Black (0,0,0) 2 24 different shades

Lab8-C 2D Animation Remember the palettes are stored sequentially in memory. To determine how big the palette is, you must know how many colors are used, and how many bytes are used for each color. Lab 8 Palette is 16 colors, 3 bytes per color (on for red, one for green, one for blue)  16 x 3 = 48 bytes for the palette

Palette Stored in Memory

Palette Rotation We want to rotate the colors to make it look like animation – the colors are moving across the screen. To move from Left to Right –Save the three bytes associated with color 15. –Use string primitives (movsb) to move the data from locations 3-44 to locations –Locations 0-2 are to remain unchanged as they are the border color. –Put the saved bytes into locations 3-5

MOVSB Instruction Move string Data: Copy an integer from one memory location to another. Note that by itself, a string primitive only processes a single memory value. If you add a repeat prefix, the instruction repeats, using ECX as the counter. You can process an entire array using only one instruction.

Direction Flag The direction flag determines if the movement increments the memory addresses or decrements.

Example of Moving Strings Cld ;clear direction flag Movesi, OFFSET string1 ;ESI points to string1 Mov edi, OFFSET string2 ;EDI points to string2 Mov ecx, 10 ;set counter to 10 Repmovsb ;move 10 bytes ESI and EDI are automatically incremented each time MOVSB repeats. The move only occurs if CX >0.

Another way to rotate the palette Store the three bytes associated with color 15 in memory. Make loop using direct offset addressing –Move color 14 into 15 –Move color 13 into 14 –… –Move color 1 into 2 –Move color 15 into 1