You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So we reduced the index color initialization code. Static initialization of pixelIndexes[][] works best instead of std::vectorstd::vector>. Also using ColorIndex enum to ensure that array bounds are safe. But the enum is tricky. We tried to put the drawFrame(Frame&) in the base class, but had to repeat it in each subclass to handle the subclass's particular enum.
We tried several approaches: templates. helper classes, helper functions. We want to keep the enum as index type safety, but the drawFrame lookups can be the underlying uint. The main problem seems to be with the colorMap which is std::map<ColorIndex,uint32_t>, where ColorIndex is peculiar to the subclass. We also don't want to have too much boilerplate in the derived classes.
The text was updated successfully, but these errors were encountered:
So we reduced the index color initialization code. Static initialization of pixelIndexes[][] works best instead of std::vectorstd::vector>. Also using ColorIndex enum to ensure that array bounds are safe. But the enum is tricky. We tried to put the drawFrame(Frame&) in the base class, but had to repeat it in each subclass to handle the subclass's particular enum.
We tried several approaches: templates. helper classes, helper functions. We want to keep the enum as index type safety, but the drawFrame lookups can be the underlying uint. The main problem seems to be with the colorMap which is std::map<ColorIndex,uint32_t>, where ColorIndex is peculiar to the subclass. We also don't want to have too much boilerplate in the derived classes.
The text was updated successfully, but these errors were encountered: