include/vcl/bitmap/BitmapFilter.hxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
New commits: commit 3b4793b366982d84b07fefe26470d0d12bf49733 Author: Christopher Sherlock <chris.sherloc...@gmail.com> AuthorDate: Tue Jan 28 18:58:14 2025 +1100 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Fri Feb 14 12:38:15 2025 +0100 vcl: document BitmapFilter Change-Id: I68cbb0a6b9050c89050afd1906d6fd948f9bff45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180822 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/include/vcl/bitmap/BitmapFilter.hxx b/include/vcl/bitmap/BitmapFilter.hxx index f6a57cd46646..496d562bee19 100644 --- a/include/vcl/bitmap/BitmapFilter.hxx +++ b/include/vcl/bitmap/BitmapFilter.hxx @@ -42,6 +42,28 @@ void generateStripRanges( } // end vcl::bitmap +/** BitmapFilter transforms (or "filters") a given bitmap based on a provided filter. + It is based on the command pattern, which allows for additional filters without + needing to modify existing client code. + + The BitmapFilter class is the base class, to implement a new filter you derive + your new filter from this and implement the filtering functionality in the execute() + function. + + The execute function takes the bitmapex that you want to apply the filter to, and + returns a brand new, filtered, BitmapEx instance. + + The actual filters parameterisation is expected to be done in the constructor. So, to + take a simple example, if you want to make every fourth pixel a different color you + would accept a BitmapColor parameter that specifies the color, and stores this as a + member variable that the Bitmap4thColorReplaceFilter would then use in it's execute() + statement. + + The BitmapFilter class has a static convenience Filter function that takes a BitmapEx + and the desired filter, which filters the BitmapEx parameter, then overwrite this BitmapEx + instance. If the filter fails (BitmapEx is empty) then it returns false. +*/ + class VCL_DLLPUBLIC BitmapFilter { public: