3 * (C) Copyright IBM Corp. 1998-2015 - All Rights Reserved
8 #include "MorphTables.h"
9 #include "SubtableProcessor.h"
10 #include "NonContextualGlyphSubst.h"
11 #include "NonContextualGlyphSubstProc.h"
12 #include "SingleTableProcessor.h"
13 #include "LEGlyphStorage.h"
18 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SingleTableProcessor
)
20 SingleTableProcessor::SingleTableProcessor()
24 SingleTableProcessor::SingleTableProcessor(const LEReferenceTo
<MorphSubtableHeader
> &morphSubtableHeader
, LEErrorCode
&success
)
25 : NonContextualGlyphSubstitutionProcessor(morphSubtableHeader
, success
)
27 LEReferenceTo
<NonContextualGlyphSubstitutionHeader
> header(morphSubtableHeader
, success
);
28 singleTableLookupTable
= LEReferenceTo
<SingleTableLookupTable
>(morphSubtableHeader
, success
, (const SingleTableLookupTable
*)&header
->table
);
31 SingleTableProcessor::~SingleTableProcessor()
35 void SingleTableProcessor::process(LEGlyphStorage
&glyphStorage
, LEErrorCode
&success
)
37 const LookupSingle
*entries
= singleTableLookupTable
->entries
;
39 le_int32 glyphCount
= glyphStorage
.getGlyphCount();
41 if (LE_FAILURE(success
)) return;
43 for (glyph
= 0; glyph
< glyphCount
; glyph
+= 1) {
44 const LookupSingle
*lookupSingle
= singleTableLookupTable
->lookupSingle(singleTableLookupTable
, entries
, glyphStorage
[glyph
], success
);
46 if (lookupSingle
!= NULL
) {
47 glyphStorage
[glyph
] = SWAPW(lookupSingle
->value
);