[var] Add VarStoreInstancer

This commit is contained in:
Behdad Esfahbod 2022-12-12 10:17:20 -07:00
parent c64661b2f8
commit a3a3d37b95
1 changed files with 17 additions and 0 deletions

View File

@ -219,6 +219,23 @@ struct DeltaSetIndexMap
DEFINE_SIZE_UNION (1, format);
};
struct VarStoreInstancer
{
VarStoreInstancer (const VariationStore &varStore,
const DeltaSetIndexMap &varIdxMap,
hb_array_t<int> coords) :
varStore (varStore), varIdxMap (varIdxMap), coords (coords) {}
float operator() (uint32_t varIdx) const
{ return varStore.get_delta (varIdxMap.map (varIdx), coords); }
const VariationStore &varStore;
const DeltaSetIndexMap &varIdxMap;
hb_array_t<int> coords;
};
} /* namespace OT */