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