File: rasterConv.h

package info (click to toggle)
open-vm-tools 1%3A8.4.2-261024-1%2Bbuild1
  • links: PTS, VCS
  • area: contrib
  • in suites: squeeze-lts
  • size: 20,376 kB
  • ctags: 30,043
  • sloc: ansic: 164,785; sh: 10,713; cpp: 6,525; makefile: 3,386
file content (88 lines) | stat: -rw-r--r-- 2,648 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*********************************************************
 * Copyright (C) 1998 VMware, Inc. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation version 2.1 and no later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the Lesser GNU General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA.
 *
 *********************************************************/

/*
 * rasterConv.h --
 *
 *	Pixel conversion routines
 */

#ifndef _RASTER_CONV_H_
#define _RASTER_CONV_H_

#define INCLUDE_ALLOW_USERLEVEL
#include "includeCheck.h"

/*
 * To minimize the amount of code needed to support the rarely-useful
 * BGR111 and BGR222 modes, their masks are defined to match the
 * appropriate number of high bits of the BGR233 masks.
 */

#define REDMASK_BGR111		0x04
#define	GREENMASK_BGR111	0x20
#define	BLUEMASK_BGR111		0x80

#define REDMASK_RGB222		0x30
#define	GREENMASK_RGB222	0x0c
#define	BLUEMASK_RGB222		0x03 

#define REDMASK_BGR222		0x03
#define	GREENMASK_BGR222	0x0c
#define	BLUEMASK_BGR222		0x30

#define REDMASK_BGR233		0x07
#define	GREENMASK_BGR233	0x38
#define	BLUEMASK_BGR233		0xc0

#define REDMASK_15		0x7c00
#define	GREENMASK_15		0x03e0
#define	BLUEMASK_15		0x001f

#define	GREEN_HIBIT_15		0x0200
#define GREEN_HILOSHIFT_15	4

#define REDMASK_16		0xf800
#define	GREENMASK_16		0x07e0
#define	BLUEMASK_16		0x001f

#define REDMASK_24		0x00ff0000
#define	GREENMASK_24		0x0000ff00
#define	BLUEMASK_24		0x000000ff

#define REDMASK_32		0x00ff0000
#define	GREENMASK_32		0x0000ff00
#define	BLUEMASK_32		0x000000ff

Bool Raster_IsModeReasonable(uint32 depth, uint32 bpp, Bool pseudocolor);

int Raster_GetBPPDepth(uint32 depth, uint32 bpp);

void Raster_ConvertPixels(uint8 *tof, int32 line_increment, int bppdepth,
			  uint8 *src, int32 src_increment, int src_bppdepth,
			  Bool pseudoColor, uint32 *pixels,
			  uint32 src_x, uint32 src_y,
			  uint32 x, uint32 y, uint32 w, uint32 h);

uint32 Raster_ConvertOnePixel(uint32 pixel, int src_depth, int depth,
			      Bool pseudoColor, uint32 *pixels);

Bool Raster_ConversionParameters(int depth, uint32 *redMask,
				 uint32 *greenMask, uint32 *blueMask);

#endif // _RASTER_CONV_H_