MGL_bitBltFxFlagsType

Declaration

typedef enum {
MGL_BLT_WRITE_MODE_ENABLE = 0x00000001,
MGL_BLT_STRETCH_NEAREST = 0x00000002,
MGL_BLT_STRETCH_XINTERP = 0x00000004,
MGL_BLT_STRETCH_YINTERP = 0x00000008,
MGL_BLT_COLOR_KEY_SRC_SINGLE = 0x00000010,
MGL_BLT_COLOR_KEY_SRC_RANGE = 0x00000020,
MGL_BLT_COLOR_KEY_DST_SINGLE = 0x00000040,
MGL_BLT_COLOR_KEY_DST_RANGE = 0x00000080,
MGL_BLT_FLIPX = 0x00000100,
MGL_BLT_FLIPY = 0x00000200,
MGL_BLT_BLEND = 0x00000400,
MGL_BLT_DITHER = 0x00002000,
MGL_BLT_ANY_STRETCH = MGL_BLT_STRETCH_NEAREST | MGL_BLT_STRETCH_XINTERP | MGL_BLT_STRETCH_YINTERP,
MGL_BLT_ANY_SINGLE_COLOR_KEY = MGL_BLT_COLOR_KEY_SRC_SINGLE | MGL_BLT_COLOR_KEY_DST_SINGLE,
MGL_BLT_ANY_RANGE_COLOR_KEY = MGL_BLT_COLOR_KEY_SRC_RANGE | MGL_BLT_COLOR_KEY_DST_RANGE,
MGL_BLT_ANY_COLOR_KEY = MGL_BLT_ANY_SINGLE_COLOR_KEY | MGL_BLT_ANY_RANGE_COLOR_KEY
} MGL_bitBltFxFlagsType

Prototype In

mgraph.h

Description

Flags for hardware blitting with special effects, passed to the BltBltFx family of functions. This family of functions exposes a wide variety of special effects blitting if the hardware is capable of these functions.

The MGL_BLT_WRITE_MODE_ENABLE flag enables logical write modes for extended BitBlt functions.

The MGL_BLT_STRETCH_NEAREST flag enables stretching with nearest pixel filtering.

The MGL_BLT_STRETCH_XINTERP flag enables stretching with linearly interpolated filtering in the X direction.

The MGL_BLT_STRETCH_XINTERP flag enables stretching with linearly interpolated filtering in the Y direction.

The MGL_BLT_COLOR_KEY_SRC_SINGLE flag enables source transparent color keying with single color key. When source color keying is enabled, any pixel data in the incoming bitmap that matches the color key value in colorKeyLo value will be ignored and not drawn to the destination surface. This essentially makes those source pixels transparent.

The MGL_BLT_COLOR_KEY_SRC_RANGE flag enables source transparent color keying with a range of color keys values. This is the same as single source color keying, but the color key values may be allows to fall within a range of available colors defined in colorKeyLo and colorKeyHi. This is useful if the data has been filtered causing the colors to shift slightly.

The MGL_BLT_COLOR_KEY_DST_SINGLE flag enables destination transparent color keying with single color key. When destination color keying is enabled (sometimes called blue-screening), any destination pixels in the framebuffer that match the color key value in colorKeyLo, will cause the source input pixels to be ignored.

The MGL_BLT_COLOR_KEY_DST_RANGE flag enables destination transparent color keying with a range of color keys values. This is the same as single destination color keying, but the color key values may be allows to fall within a range of available colors defined in colorKeyLo and colorKeyHi.

The MGL_BLT_FLIPX flag enables bitmap flipping in the X axis. This is useful for 2D sprite based games and animation where the same sprite data can be reused for characters going left or right on the screen by flipping the data during the blit operation.

The MGL_BLT_FLIPY flag enables bitmap flipping in the Y axis. This is useful for 2D sprite based games and animation where the same sprite data can be reused for characters going up or down on the screen by flipping the data during the blit operation.

The MGL_BLT_BLEND flag enables alpha blending. When you enable alpha blending the values in srcBlendfunc and dstBlendFunc members of bltfx_t are used to determine the blending operation to apply to the pixels.

The MGL_BLT_DITHER flag enables dithering when color converting an RGB bitmap to a color depth of a lower pixel depth. This will occur when converting any RGB bitmap (ie: 15, 16, 24 or 32-bit) to a color index pixel format, or when converting 24 or 32-bit bitmaps to 15 or 16-bit bitmaps. If dithering is not enabled, the clostes color to the source pixel will be found and drawn into the framebuffer. Dithering slows things down somewhat when dithering to 15/16-bit destination bitmaps, but produces better quality. Dithering down to 8-bit bitmaps looks best if a halftone palette is used, and in fact is a lot faster than using the closest color method (which has to search the color palette for every pixel drawn). Dithering to 8-bit bitmaps will however map to any palette, but the quality is best if a halftone palette is used.

Note: For the most part any feature can be combined with any other feature with the MGL_bitBltFx family of functions. However some features are mutually exclusive, such as blending a logical write modes. Also blending is only available if the destination pixel format is not a color index pixel format.

Members

MGL_BLT_WRITE_MODE_ENABLE | Write mode enabled
MGL_BLT_STRETCH_NEAREST | Enable stretching, nearest pixel
MGL_BLT_STRETCH_XINTERP | Enable X axis filtering for stretch blit
MGL_BLT_STRETCH_YINTERP | Enable Y axis filtering for stretch blit
MGL_BLT_COLOR_KEY_SRC_SINGLE | Source color keying enabled, single color
MGL_BLT_COLOR_KEY_SRC_RANGE | Source color keying enabled, range of colors
MGL_BLT_COLOR_KEY_DST_SINGLE | Destination color keying enabled, single color
MGL_BLT_COLOR_KEY_DST_RANGE | Destination color keying enabled, range of colors
MGL_BLT_FLIPX | Enable flip in X axis
MGL_BLT_FLIPY | Enable flip in Y axis
MGL_BLT_BLEND | Enable alpha blending
MGL_BLT_DITHER | Dither if an 8/15/16bpp destination
MGL_BLT_ANY_STRETCH | Flags that any stretching is enabled
MGL_BLT_ANY_SINGLE_COLOR_KEY | Flags that any single color key is enabled
MGL_BLT_ANY_RANGE_COLOR_KEY | Flags that any range color key is enabled
MGL_BLT_ANY_COLOR_KEY | Flags that any color key is enabled

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com