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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <vcl/bitmapex.hxx>
23 #include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
25 namespace drawinglayer
27 // Helper that just creates the AlphaMask for a given Seq of Primitives.
28 // If only the mask is needed this can be significantly faster then
29 // creating content & mask in a BitmapEx (since the creation uses
30 // e.g. a unified color for gradients instead of having to fully paint
32 // New mode: bUseLuminance allows simple creation of alpha channels
33 // for any content (e.g. gradients)
34 AlphaMask DRAWINGLAYER_DLLPUBLIC
createAlphaMask(
35 drawinglayer::primitive2d::Primitive2DContainer
&& rSeq
,
36 const geometry::ViewInformation2D
& rViewInformation2D
, sal_uInt32 nDiscreteWidth
,
37 sal_uInt32 nDiscreteHeight
, sal_uInt32 nMaxSquarePixels
, bool bUseLuminance
= false);
39 // Helper for convertPrimitive2DContainerToBitmapEx below, but can be also used
41 BitmapEx DRAWINGLAYER_DLLPUBLIC
convertToBitmapEx(
42 drawinglayer::primitive2d::Primitive2DContainer
&& rSeq
,
43 const geometry::ViewInformation2D
& rViewInformation2D
, sal_uInt32 nDiscreteWidth
,
44 sal_uInt32 nDiscreteHeight
, sal_uInt32 nMaxSquarePixels
, bool bForceAlphaMaskCreation
= false);
46 // helper to convert any Primitive2DSequence to a good quality BitmapEx,
47 // using default parameters
48 BitmapEx DRAWINGLAYER_DLLPUBLIC
convertPrimitive2DContainerToBitmapEx(
49 drawinglayer::primitive2d::Primitive2DContainer
&& rSeq
, const basegfx::B2DRange
& rTargetRange
,
50 const sal_uInt32 nMaximumQuadraticPixels
= 500000,
51 const o3tl::Length eTargetUnit
= o3tl::Length::mm100
,
52 const std::optional
<Size
>& rTargetDPI
= std::nullopt
);
54 } // end of namespace drawinglayer
56 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */