1
/*********************************************************
2
* Copyright (C) 1998 VMware, Inc. All rights reserved.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License as published
6
* by the Free Software Foundation version 2.1 and no later version.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
11
* License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
*********************************************************/
22
* Pixel conversion routines
25
#ifndef _RASTER_CONV_H_
26
#define _RASTER_CONV_H_
28
#define INCLUDE_ALLOW_USERLEVEL
29
#include "includeCheck.h"
32
* To minimize the amount of code needed to support the rarely-useful
33
* BGR111 and BGR222 modes, their masks are defined to match the
34
* appropriate number of high bits of the BGR233 masks.
37
#define REDMASK_BGR111 0x04
38
#define GREENMASK_BGR111 0x20
39
#define BLUEMASK_BGR111 0x80
41
#define REDMASK_RGB222 0x30
42
#define GREENMASK_RGB222 0x0c
43
#define BLUEMASK_RGB222 0x03
45
#define REDMASK_BGR222 0x03
46
#define GREENMASK_BGR222 0x0c
47
#define BLUEMASK_BGR222 0x30
49
#define REDMASK_BGR233 0x07
50
#define GREENMASK_BGR233 0x38
51
#define BLUEMASK_BGR233 0xc0
53
#define REDMASK_15 0x7c00
54
#define GREENMASK_15 0x03e0
55
#define BLUEMASK_15 0x001f
57
#define GREEN_HIBIT_15 0x0200
58
#define GREEN_HILOSHIFT_15 4
60
#define REDMASK_16 0xf800
61
#define GREENMASK_16 0x07e0
62
#define BLUEMASK_16 0x001f
64
#define REDMASK_24 0x00ff0000
65
#define GREENMASK_24 0x0000ff00
66
#define BLUEMASK_24 0x000000ff
68
#define REDMASK_32 0x00ff0000
69
#define GREENMASK_32 0x0000ff00
70
#define BLUEMASK_32 0x000000ff
72
Bool Raster_IsModeReasonable(uint32 depth, uint32 bpp, Bool pseudocolor);
74
int Raster_GetBPPDepth(uint32 depth, uint32 bpp);
76
void Raster_ConvertPixels(uint8 *tof, int32 line_increment, int bppdepth,
77
const uint8 *src, int32 src_increment, int src_bppdepth,
78
Bool pseudoColor, const uint32 *pixels,
79
uint32 src_x, uint32 src_y,
80
uint32 x, uint32 y, uint32 w, uint32 h);
82
uint32 Raster_ConvertOnePixel(uint32 pixel, int src_depth, int depth,
83
Bool pseudoColor, const uint32 *pixels);
85
Bool Raster_ConversionParameters(int depth, uint32 *redMask,
86
uint32 *greenMask, uint32 *blueMask);
88
#endif // _RASTER_CONV_H_