|
DrawPaletteMappedByte | |
DrawPaletteMappedByte Xpos, Ypos, ThisByte, Shift, Mask, Length | |
Parameters: Xpos = The output X coordinate of this group of pixels Ypos = The output Y coordinate of this group of pixels ThisByte = The byte to process and drawn Shift = The shift to perform between bits. Mask = Mask to apply to the colour index before reading the palette. Length = Number of pixels in this byte |
|
Returns: NONE | |
DrawPaletteMappedByte reads either indivual bits or groups of bits within a byte and uses these groups as colour indexes to the user defined colour palette (SetPalette). So it grabs the bit(s) looks in the palette array for a RGB colour, then draws this colour to the current surface. Using this command we can simulate a classic 8bit (256 colour) screen mode, and effects like raster bars, mirrors and glez vectors to name a few. FACTS: * The DrawPaletteMappedByte is just like the FastDot/FastPoint commands and doesn't include surface locking/clipping internally. So it expects the current output surface has been seeded and the coordinates you give it are legal. If not, you should expect it to crash. * DrawPaletteMappedByte is useful for displaying image data from retro computer systems and image formats. Example: This following example creates simplified mock up of the Commodore 64 screen, or C64 for short. The C64 was an 8bit home computer system that was popular in 1980's, it's still popular today actually. The display hardware of the C64 might seem simple by todays standards, but it's not that easy re-create such display on modern RGB displays.Modern systems generally use byte/word/integer per pixel RGB displays, where retro hardware tends to use groups of bits within a byte to represent a group of 8 colours. Bellow we're creating a simplified 2bit C64 styled display. In these modes the graphics hardware in the C64 would interpret each of those 8bits as individual pixels. So a set bit would be drawn in one colour and clear bit was drawn in another. We could do this manually, but it's a lot of work for PlayBASIC runtime to perform, so we added the DrawPaletteMappedByte to do the job for you. |
|
Example Source: Download This Example
|
Related Info: | ARGB | DrawPaletteMappedStrip16 | DrawPaletteMappedStrip8 | IndexToRGB | RGBtoINDEX | SetPalette : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |