1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 #ifndef INCLUDED_VCL_BITMAPFILTER_HXX
12 #define INCLUDED_VCL_BITMAPFILTER_HXX
14 #include <vcl/bitmapex.hxx>
21 // Generates strip ranges and run the input function with the start and
22 // end as parameters. The additional parameter bLast denotes if the
23 // iteration is the last one.
26 // first = 0, last = 100, STRIP_SIZE = 32
27 // this will generate:
28 // [0, 31, false], [32, 63, false], [64, 95, false], [96, 100, true]
29 template <int STRIP_SIZE
>
30 void generateStripRanges(
31 tools::Long nFirst
, tools::Long nLast
,
32 std::function
<void(tools::Long
const nStart
, tools::Long
const nEnd
, bool const bLast
)>
35 tools::Long nStart
= nFirst
;
36 for (; nStart
< nLast
- STRIP_SIZE
; nStart
+= STRIP_SIZE
)
38 tools::Long nEnd
= nStart
+ STRIP_SIZE
- 1;
39 aFunction(nStart
, nEnd
, false);
41 aFunction(nStart
, nLast
, true);
46 class VCL_DLLPUBLIC BitmapFilter
50 virtual ~BitmapFilter();
52 virtual BitmapEx
execute(BitmapEx
const& rBitmapEx
) const = 0;
54 static bool Filter(BitmapEx
& rBmpEx
, BitmapFilter
const& rFilter
);
55 static bool Filter(Animation
& rBmpEx
, BitmapFilter
const& rFilter
);
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */