]> git.saurik.com Git - apple/icu.git/blame - icuSources/layout/LookupTables.h
ICU-531.30.tar.gz
[apple/icu.git] / icuSources / layout / LookupTables.h
CommitLineData
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
19U_NAMESPACE_BEGIN
20
21enum LookupTableFormat
22{
23 ltfSimpleArray = 0,
24 ltfSegmentSingle = 2,
25 ltfSegmentArray = 4,
26 ltfSingleTable = 6,
27 ltfTrimmedArray = 8
28};
29
30typedef le_int16 LookupValue;
31
32struct LookupTable
33{
34 le_int16 format;
35};
36
37struct LookupSegment
38{
39 TTGlyphID lastGlyph;
40 TTGlyphID firstGlyph;
41 LookupValue value;
42};
43
44struct LookupSingle
45{
46 TTGlyphID glyph;
47 LookupValue value;
48};
49
50struct 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
63struct SimpleArrayLookupTable : LookupTable
64{
65 LookupValue valueArray[ANY_NUMBER];
66};
57a6839d 67LE_VAR_ARRAY(SimpleArrayLookupTable, valueArray)
b75a7d8f
A
68
69struct SegmentSingleLookupTable : BinarySearchLookupTable
70{
71 LookupSegment segments[ANY_NUMBER];
72};
57a6839d 73LE_VAR_ARRAY(SegmentSingleLookupTable, segments)
b75a7d8f
A
74
75struct SegmentArrayLookupTable : BinarySearchLookupTable
76{
77 LookupSegment segments[ANY_NUMBER];
78};
57a6839d 79LE_VAR_ARRAY(SegmentArrayLookupTable, segments)
b75a7d8f
A
80
81struct SingleTableLookupTable : BinarySearchLookupTable
82{
83 LookupSingle entries[ANY_NUMBER];
84};
57a6839d 85LE_VAR_ARRAY(SingleTableLookupTable, entries)
b75a7d8f
A
86
87struct TrimmedArrayLookupTable : LookupTable
88{
89 TTGlyphID firstGlyph;
90 TTGlyphID glyphCount;
91 LookupValue valueArray[ANY_NUMBER];
92};
57a6839d 93LE_VAR_ARRAY(TrimmedArrayLookupTable, valueArray)
b75a7d8f
A
94
95U_NAMESPACE_END
96#endif