]>
Commit | Line | Data |
---|---|---|
b75a7d8f | 1 | /* |
b75a7d8f | 2 | * |
57a6839d | 3 | * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved |
b75a7d8f A |
4 | * |
5 | */ | |
6 | ||
7 | #ifndef __LOOKUPTABLES_H | |
8 | #define __LOOKUPTABLES_H | |
9 | ||
10 | /** | |
11 | * \file | |
12 | * \internal | |
13 | */ | |
14 | ||
15 | #include "LETypes.h" | |
16 | #include "LayoutTables.h" | |
57a6839d | 17 | #include "LETableReference.h" |
b75a7d8f A |
18 | |
19 | U_NAMESPACE_BEGIN | |
20 | ||
21 | enum LookupTableFormat | |
22 | { | |
23 | ltfSimpleArray = 0, | |
24 | ltfSegmentSingle = 2, | |
25 | ltfSegmentArray = 4, | |
26 | ltfSingleTable = 6, | |
27 | ltfTrimmedArray = 8 | |
28 | }; | |
29 | ||
30 | typedef le_int16 LookupValue; | |
31 | ||
32 | struct LookupTable | |
33 | { | |
34 | le_int16 format; | |
35 | }; | |
36 | ||
37 | struct LookupSegment | |
38 | { | |
39 | TTGlyphID lastGlyph; | |
40 | TTGlyphID firstGlyph; | |
41 | LookupValue value; | |
42 | }; | |
43 | ||
44 | struct LookupSingle | |
45 | { | |
46 | TTGlyphID glyph; | |
47 | LookupValue value; | |
48 | }; | |
49 | ||
50 | struct BinarySearchLookupTable : LookupTable | |
51 | { | |
52 | le_int16 unitSize; | |
53 | le_int16 nUnits; | |
54 | le_int16 searchRange; | |
55 | le_int16 entrySelector; | |
56 | le_int16 rangeShift; | |
57 | ||
57a6839d | 58 | const LookupSegment *lookupSegment(const LETableReference &base, const LookupSegment *segments, LEGlyphID glyph, LEErrorCode &success) const; |
b75a7d8f | 59 | |
57a6839d | 60 | const LookupSingle *lookupSingle(const LETableReference &base, const LookupSingle *entries, LEGlyphID glyph, LEErrorCode &success) const; |
b75a7d8f A |
61 | }; |
62 | ||
63 | struct SimpleArrayLookupTable : LookupTable | |
64 | { | |
65 | LookupValue valueArray[ANY_NUMBER]; | |
66 | }; | |
57a6839d | 67 | LE_VAR_ARRAY(SimpleArrayLookupTable, valueArray) |
b75a7d8f A |
68 | |
69 | struct SegmentSingleLookupTable : BinarySearchLookupTable | |
70 | { | |
71 | LookupSegment segments[ANY_NUMBER]; | |
72 | }; | |
57a6839d | 73 | LE_VAR_ARRAY(SegmentSingleLookupTable, segments) |
b75a7d8f A |
74 | |
75 | struct SegmentArrayLookupTable : BinarySearchLookupTable | |
76 | { | |
77 | LookupSegment segments[ANY_NUMBER]; | |
78 | }; | |
57a6839d | 79 | LE_VAR_ARRAY(SegmentArrayLookupTable, segments) |
b75a7d8f A |
80 | |
81 | struct SingleTableLookupTable : BinarySearchLookupTable | |
82 | { | |
83 | LookupSingle entries[ANY_NUMBER]; | |
84 | }; | |
57a6839d | 85 | LE_VAR_ARRAY(SingleTableLookupTable, entries) |
b75a7d8f A |
86 | |
87 | struct TrimmedArrayLookupTable : LookupTable | |
88 | { | |
89 | TTGlyphID firstGlyph; | |
90 | TTGlyphID glyphCount; | |
91 | LookupValue valueArray[ANY_NUMBER]; | |
92 | }; | |
57a6839d | 93 | LE_VAR_ARRAY(TrimmedArrayLookupTable, valueArray) |
b75a7d8f A |
94 | |
95 | U_NAMESPACE_END | |
96 | #endif |