Commit Graph

5 Commits

Author SHA1 Message Date
AnotherTest
93f4388e45 LibGfx+PixelPaint: Fix distortions in convolutions with size != 4 or 5 2020-10-12 20:04:48 +02:00
Tom
95434d70ed LibGfx: Allow specifying a separate source bitmap for Filter::apply
By allowing to specify a separate source bitmap when calling Filter::apply
the same filter can be applied to multiple areas, and also doesn't need
to use a temporary bitmap. This also enables us to apply the filter to
multiple regions properly, even if they are (almost) adjacent.

If no separate source bitmap is supplied then a temporary bitmap is still
necessary.
2020-10-12 20:04:48 +02:00
Tom
da8d87c297 LibGfx: Make Filter::Parameters more light-weight
By moving the Bitmap and Rect out of Filter::Parameters we can re-use
the parameters more efficiently, allowing the filter to be applied
to many bitmaps without having to re-create the filter every time.
2020-10-12 20:04:48 +02:00
Tom
6188c6e8a3 LibGfx: Add GenericConvolutionFilter::ApplyCache
Add an overload of GenericConvolutionFilter::apply that can be used
with a GenericConvolutionFilter::ApplyCache instance to avoid having
to allocate a temporary bitmap every time the filter is being applied.
2020-10-12 20:04:48 +02:00
Tom
8af02fc8b3 LibGfx: Move filters from PixelPaint into LibGfx
This allows re-using the same filters outside of PixelPaint.
2020-10-12 20:04:48 +02:00