use insert function instead of for loop
[LibreOffice.git] / include / drawinglayer / processor2d / processor2dtools.hxx
blob70df042498586f93976817f3b89ada69e790bd16
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_PROCESSOR2DTOOLS_HXX
20 #define INCLUDED_DRAWINGLAYER_PROCESSOR2D_PROCESSOR2DTOOLS_HXX
22 #include <drawinglayer/drawinglayerdllapi.h>
23 #include <vcl/bitmapex.hxx>
24 #include <memory>
26 namespace drawinglayer::geometry { class ViewInformation2D; }
27 namespace drawinglayer::processor2d { class BaseProcessor2D; }
29 class OutputDevice;
31 namespace drawinglayer::processor2d
33 /** create the best available pixel based BaseProcessor2D
34 (which may be system-dependent) for a given pixel size
35 and format
37 @param rViewInformation2D
38 The ViewInformation to use
40 @param nPixelWidth, nPixelHeight
41 The dimensions in Pixels
43 @param bUseRGBA
44 Define RGBA (true) or RGB (false)
46 @return
47 the created BaseProcessor2D OR empty (ownership change)
49 DRAWINGLAYER_DLLPUBLIC std::unique_ptr<BaseProcessor2D> createPixelProcessor2DFromScratch(
50 const drawinglayer::geometry::ViewInformation2D& rViewInformation2D,
51 sal_uInt32 nPixelWidth,
52 sal_uInt32 nPixelHeight,
53 bool bUseRGBA);
55 /** create the best available pixel based BaseProcessor2D
56 (which may be system-dependent)
58 @param rTargetOutDev
59 The target OutputDevice
61 @param rViewInformation2D
62 The ViewInformation to use
64 @return
65 the created BaseProcessor2D (ownership change)
67 DRAWINGLAYER_DLLPUBLIC std::unique_ptr<BaseProcessor2D> createPixelProcessor2DFromOutputDevice(
68 OutputDevice& rTargetOutDev,
69 const drawinglayer::geometry::ViewInformation2D& rViewInformation2D);
71 /** create a BaseProcessor2D dependent on some states of the
72 given OutputDevice. If metafile is recorded, the needed
73 VclMetafileProcessor2D will be created. If a pixel renderer
74 is requested, the best one is incarnated
76 @param rTargetOutDev
77 The target OutputDevice
79 @param rViewInformation2D
80 The ViewInformation to use
82 @return
83 the created BaseProcessor2D (ownership change)
85 DRAWINGLAYER_DLLPUBLIC std::unique_ptr<BaseProcessor2D> createProcessor2DFromOutputDevice(
86 OutputDevice& rTargetOutDev,
87 const drawinglayer::geometry::ViewInformation2D& rViewInformation2D);
89 /** extract the pixel data from a given BaseProcessor2D to
90 a BitmapEx. This may fail due to maybe system-dependent
92 @param rProcessor
93 A unique_ptr to a BaseProcessor2D from which to extract
95 @return
96 a BitmapEx, may be empty, so check result
98 DRAWINGLAYER_DLLPUBLIC BitmapEx extractBitmapExFromBaseProcessor2D(const std::unique_ptr<BaseProcessor2D>& rProcessor);
101 } // end of namespace drawinglayer::processor2d
103 #endif //INCLUDED_DRAWINGLAYER_PROCESSOR2D_PROCESSOR2DTOOLS_HXX
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */