2
* @(#)TrimmedArrayProcessor.cpp 1.6 00/03/15
4
* (C) Copyright IBM Corp. 1998, 1999, 2000, 2001 - All Rights Reserved
9
#include "MorphTables.h"
10
#include "SubtableProcessor.h"
11
#include "NonContextualGlyphSubst.h"
12
#include "NonContextualGlyphSubstProc.h"
13
#include "TrimmedArrayProcessor.h"
18
TrimmedArrayProcessor::TrimmedArrayProcessor()
22
TrimmedArrayProcessor::TrimmedArrayProcessor(const MorphSubtableHeader *morphSubtableHeader)
23
: NonContextualGlyphSubstitutionProcessor(morphSubtableHeader)
25
const NonContextualGlyphSubstitutionHeader *header = (const NonContextualGlyphSubstitutionHeader *) morphSubtableHeader;
27
trimmedArrayLookupTable = (const TrimmedArrayLookupTable *) &header->table;
28
firstGlyph = SWAPW(trimmedArrayLookupTable->firstGlyph);
29
lastGlyph = firstGlyph + SWAPW(trimmedArrayLookupTable->glyphCount);
32
TrimmedArrayProcessor::~TrimmedArrayProcessor()
36
void TrimmedArrayProcessor::process(LEGlyphID *glyphs, le_int32 *charIndices, le_int32 glyphCount)
40
for (glyph = 0; glyph < glyphCount; glyph += 1) {
41
if ((glyphs[glyph] > firstGlyph) && (glyphs[glyph] < lastGlyph)) {
42
le_int16 newGlyph = trimmedArrayLookupTable->valueArray[glyphs[glyph] - firstGlyph];
44
glyphs[glyph] = SWAPW(newGlyph);