]> git.saurik.com Git - apple/icu.git/blob - icuSources/layout/SingleTableProcessor.cpp
ICU-3.13.tar.gz
[apple/icu.git] / icuSources / layout / SingleTableProcessor.cpp
1 /*
2 * @(#)SingleTableProcessor.cpp 1.6 00/03/15
3 *
4 * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved
5 *
6 */
7
8 #include "LETypes.h"
9 #include "MorphTables.h"
10 #include "SubtableProcessor.h"
11 #include "NonContextualGlyphSubst.h"
12 #include "NonContextualGlyphSubstProc.h"
13 #include "SingleTableProcessor.h"
14 #include "LESwaps.h"
15
16 U_NAMESPACE_BEGIN
17
18 const char SingleTableProcessor::fgClassID=0;
19
20 SingleTableProcessor::SingleTableProcessor()
21 {
22 }
23
24 SingleTableProcessor::SingleTableProcessor(const MorphSubtableHeader *moprhSubtableHeader)
25 : NonContextualGlyphSubstitutionProcessor(moprhSubtableHeader)
26 {
27 const NonContextualGlyphSubstitutionHeader *header = (const NonContextualGlyphSubstitutionHeader *) moprhSubtableHeader;
28
29 singleTableLookupTable = (const SingleTableLookupTable *) &header->table;
30 }
31
32 SingleTableProcessor::~SingleTableProcessor()
33 {
34 }
35
36 void SingleTableProcessor::process(LEGlyphID *glyphs, le_int32 * /*charIndices*/, le_int32 glyphCount)
37 {
38 const LookupSingle *entries = singleTableLookupTable->entries;
39 le_int32 glyph;
40
41 for (glyph = 0; glyph < glyphCount; glyph += 1) {
42 const LookupSingle *lookupSingle = singleTableLookupTable->lookupSingle(entries, glyphs[glyph]);
43
44 if (lookupSingle != NULL) {
45 glyphs[glyph] = SWAPW(lookupSingle->value);
46 }
47 }
48 }
49
50 U_NAMESPACE_END