LibreOffice Module drawinglayer (master) 1
converters.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <vcl/bitmapex.hxx>
24
25namespace drawinglayer
26{
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
31// these)
32// New mode: bUseLuminance allows simple creation of alpha channels
33// for any content (e.g. gradients)
36 const geometry::ViewInformation2D& rViewInformation2D, sal_uInt32 nDiscreteWidth,
37 sal_uInt32 nDiscreteHeight, sal_uInt32 nMaxSquarePixels, bool bUseLuminance = false);
38
39// Helper for convertPrimitive2DContainerToBitmapEx below, but can be also used
40// directly
43 const geometry::ViewInformation2D& rViewInformation2D, sal_uInt32 nDiscreteWidth,
44 sal_uInt32 nDiscreteHeight, sal_uInt32 nMaxSquarePixels);
45
46// helper to convert any Primitive2DSequence to a good quality BitmapEx,
47// using default parameters
50 const sal_uInt32 nMaximumQuadraticPixels = 500000,
51 const o3tl::Length eTargetUnit = o3tl::Length::mm100,
52 const std::optional<Size>& rTargetDPI = std::nullopt);
53
54} // end of namespace drawinglayer
55
56/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define DRAWINGLAYER_DLLPUBLIC
BitmapEx convertPrimitive2DContainerToBitmapEx(primitive2d::Primitive2DContainer &&rSequence, const basegfx::B2DRange &rTargetRange, sal_uInt32 nMaximumQuadraticPixels, const o3tl::Length eTargetUnit, const std::optional< Size > &rTargetDPI)
Definition: converters.cxx:279
AlphaMask createAlphaMask(drawinglayer::primitive2d::Primitive2DContainer &&rSeq, const geometry::ViewInformation2D &rViewInformation2D, sal_uInt32 nDiscreteWidth, sal_uInt32 nDiscreteHeight, sal_uInt32 nMaxSquarePixels, bool bUseLuminance)
Definition: converters.cxx:139
BitmapEx convertToBitmapEx(drawinglayer::primitive2d::Primitive2DContainer &&rSeq, const geometry::ViewInformation2D &rViewInformation2D, sal_uInt32 nDiscreteWidth, sal_uInt32 nDiscreteHeight, sal_uInt32 nMaxSquarePixels)
Definition: converters.cxx:156