Pixel Grouping
Pixel Grouping is how an animation pre-calculates which pixels will be changed on each iteration of the animation. This allows these calculations to be done before the animation starts, reducing lag during the animation.
How it Works
Pixels are grouped based on a characteristic, which is determined by which function you use. The lists of grouped pixels are returned as a PixelModificationLists
instance.
PixelModificationLists
A PixelModificationLists
instance contains a list of PixelsToModify
instances, one per iteration of the animation.
PixelsToModify
A PixelsToModify
instance contains five lists that tell the animation what pixels to set and revert during this iteration:
allSetPixels
- All pixels that should be set during this iterationallRevertPixels
- All pixels that should be reverted during this iterationpairedSetRevertPixels
- A list of paired up pixels from the set and revert lists (used by animations like Runway lights so pixels are set and reverted at nearly the exact same time instead of setting all and then reverting all)unpairedSetPixels
- A list with any remaining pixels that should be set that are not included inpairedSetRevertPixels
(caused byallRevertPixels
being smaller thanallSetPixels
)unpairedRevertPixels
- A list with any remaining pixels that should be reverted that are not included inpairedSetRevertPixels
(caused byallSetPixels
being smaller thanallRevertPixels
)
Functions
There are currently four pixel grouping functions: