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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
/*
* translate.c - translate between different pixel formats
*/
/*
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software 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
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
//#include "stdhdrs.h"
#include "translate.h"
#include <stdio.h>
#include "rfb.h"
#include <vdr/plugin.h>
#define CONCAT2(a,b) a##b
#define CONCAT2E(a,b) CONCAT2(a,b)
#define CONCAT4(a,b,c,d) a##b##c##d
#define CONCAT4E(a,b,c,d) CONCAT4(a,b,c,d)
#define OUTBPP 8
#include "tableinittctemplate.c"
#include "tableinitcmtemplate.c"
#define INBPP 8
#include "tabletranstemplate.c"
#undef INBPP
#define INBPP 16
#include "tabletranstemplate.c"
#undef INBPP
#define INBPP 32
#include "tabletranstemplate.c"
#undef INBPP
#undef OUTBPP
#define OUTBPP 16
#include "tableinittctemplate.c"
#include "tableinitcmtemplate.c"
#define INBPP 8
#include "tabletranstemplate.c"
#undef INBPP
#define INBPP 16
#include "tabletranstemplate.c"
#undef INBPP
#define INBPP 32
#include "tabletranstemplate.c"
#undef INBPP
#undef OUTBPP
#define OUTBPP 32
#include "tableinittctemplate.c"
#include "tableinitcmtemplate.c"
#define INBPP 8
#include "tabletranstemplate.c"
#undef INBPP
#define INBPP 16
#include "tabletranstemplate.c"
#undef INBPP
#define INBPP 32
#include "tabletranstemplate.c"
#undef INBPP
#undef OUTBPP
rfbInitTableFnType rfbInitTrueColourSingleTableFns[3] = {
rfbInitTrueColourSingleTable8,
rfbInitTrueColourSingleTable16,
rfbInitTrueColourSingleTable32
};
rfbInitTableFnType rfbInitColourMapSingleTableFns[3] = {
rfbInitColourMapSingleTable8,
rfbInitColourMapSingleTable16,
rfbInitColourMapSingleTable32
};
rfbInitTableFnType rfbInitTrueColourRGBTablesFns[3] = {
rfbInitTrueColourRGBTables8,
rfbInitTrueColourRGBTables16,
rfbInitTrueColourRGBTables32
};
rfbTranslateFnType rfbTranslateWithSingleTableFns[3][3] = {
{ rfbTranslateWithSingleTable8to8,
rfbTranslateWithSingleTable8to16,
rfbTranslateWithSingleTable8to32 },
{ rfbTranslateWithSingleTable16to8,
rfbTranslateWithSingleTable16to16,
rfbTranslateWithSingleTable16to32 },
{ rfbTranslateWithSingleTable32to8,
rfbTranslateWithSingleTable32to16,
rfbTranslateWithSingleTable32to32 }
};
rfbTranslateFnType rfbTranslateWithRGBTablesFns[3][3] = {
{ rfbTranslateWithRGBTables8to8,
rfbTranslateWithRGBTables8to16,
rfbTranslateWithRGBTables8to32 },
{ rfbTranslateWithRGBTables16to8,
rfbTranslateWithRGBTables16to16,
rfbTranslateWithRGBTables16to32 },
{ rfbTranslateWithRGBTables32to8,
rfbTranslateWithRGBTables32to16,
rfbTranslateWithRGBTables32to32 }
};
// rfbTranslateNone is used when no translation is required.
void
rfbTranslateNone(char *table, rfbPixelFormat *in, rfbPixelFormat *out,
char *iptr, char *optr, int bytesBetweenInputLines,
int width, int height)
{
int bytesPerOutputLine = width * (out->bitsPerPixel / 8);
while (height > 0) {
memcpy(optr, iptr, bytesPerOutputLine);
iptr += bytesBetweenInputLines;
optr += bytesPerOutputLine;
height--;
}
}
|