]> www.fi.muni.cz Git - evince.git/blob - pdf/xpdf/SFont.cc
Synched with Xpdf 1.01
[evince.git] / pdf / xpdf / SFont.cc
1 //========================================================================
2 //
3 // SFont.cc
4 //
5 // Copyright 2001-2002 Glyph & Cog, LLC
6 //
7 //========================================================================
8
9 #ifdef __GNUC__
10 #pragma implementation
11 #endif
12
13 #include <aconf.h>
14 #include "SFont.h"
15
16 //------------------------------------------------------------------------
17
18 SFontEngine::SFontEngine(Display *displayA, Visual *visualA, int depthA,
19                          Colormap colormapA) {
20   display = displayA;
21   visual = visualA;
22   depth = depthA;
23   colormap = colormapA;
24 }
25
26 SFontEngine::~SFontEngine() {
27 }
28
29 void SFontEngine::useTrueColor(int rMaxA, int rShiftA, int gMaxA, int gShiftA,
30                                int bMaxA, int bShiftA) {
31   trueColor = gTrue;
32   rMax = rMaxA;
33   rShift = rShiftA;
34   gMax = gMaxA;
35   gShift = gShiftA;
36   bMax = bMaxA;
37   bShift = bShiftA;
38 }
39
40 void SFontEngine::useColorCube(Gulong *colorsA, int nRGBA) {
41   trueColor = gFalse;
42   colors = colorsA;
43   nRGB = nRGBA;
44   rMax = gMax = bMax = nRGB - 1;
45 }
46
47 Gulong SFontEngine::findColor(int r, int g, int b) {
48   int r1, g1, b1;
49   Gulong pix;
50
51   r1 = ((r & 0xffff) * rMax) / 0xffff;
52   g1 = ((g & 0xffff) * gMax) / 0xffff;
53   b1 = ((b & 0xffff) * bMax) / 0xffff;
54   if (trueColor) {
55     pix = (r1 << rShift) + (g1 << gShift) + (b1 << bShift);
56   } else {
57     pix = colors[(r1 * nRGB + g1) * nRGB + b1];
58   }
59   return pix;
60 }
61
62 //------------------------------------------------------------------------
63
64 SFontFile::SFontFile() {
65 }
66
67 SFontFile::~SFontFile() {
68 }
69
70 //------------------------------------------------------------------------
71
72 SFont::SFont() {
73 }
74
75 SFont::~SFont() {
76 }
77
78 GBool SFont::getCharPath(CharCode c, Unicode u, GfxState *state) {
79   return gFalse;
80 }