| 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 |
#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_PROCESSOR2DTOOLS_HXX |
| 20 |
#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_PROCESSOR2DTOOLS_HXX |
| 21 |
|
| 22 |
#include <drawinglayer/drawinglayerdllapi.h> |
| 23 |
#include <vcl/bitmap.hxx> |
| 24 |
#include <memory> |
| 25 |
|
| 26 |
namespace drawinglayer::geometry { class ViewInformation2D; } |
| 27 |
namespace drawinglayer::processor2d { class BaseProcessor2D; } |
| 28 |
|
| 29 |
class OutputDevice; |
| 30 |
|
| 31 |
namespace drawinglayer::processor2d |
| 32 |
{ |
| 33 |
/** create the best available pixel based BaseProcessor2D |
| 34 |
(which may be system-dependent) for a given pixel size |
| 35 |
and format |
| 36 |
|
| 37 |
@param rViewInformation2D |
| 38 |
The ViewInformation to use |
| 39 |
|
| 40 |
@param nPixelWidth, nPixelHeight |
| 41 |
The dimensions in Pixels |
| 42 |
|
| 43 |
@param bUseRGBA |
| 44 |
Define RGBA (true) or RGB (false) |
| 45 |
|
| 46 |
@return |
| 47 |
the created BaseProcessor2D OR empty (ownership change) |
| 48 |
*/ |
| 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); |
| 54 |
|
| 55 |
/** create the best available pixel based BaseProcessor2D |
| 56 |
(which may be system-dependent) |
| 57 |
|
| 58 |
@param rTargetOutDev |
| 59 |
The target OutputDevice |
| 60 |
|
| 61 |
@param rViewInformation2D |
| 62 |
The ViewInformation to use |
| 63 |
|
| 64 |
@return |
| 65 |
the created BaseProcessor2D (ownership change) |
| 66 |
*/ |
| 67 |
DRAWINGLAYER_DLLPUBLIC std::unique_ptr<BaseProcessor2D> createPixelProcessor2DFromOutputDevice( |
| 68 |
OutputDevice& rTargetOutDev, |
| 69 |
const drawinglayer::geometry::ViewInformation2D& rViewInformation2D); |
| 70 |
|
| 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 |
| 75 |
|
| 76 |
@param rTargetOutDev |
| 77 |
The target OutputDevice |
| 78 |
|
| 79 |
@param rViewInformation2D |
| 80 |
The ViewInformation to use |
| 81 |
|
| 82 |
@return |
| 83 |
the created BaseProcessor2D (ownership change) |
| 84 |
*/ |
| 85 |
DRAWINGLAYER_DLLPUBLIC std::unique_ptr<BaseProcessor2D> createProcessor2DFromOutputDevice( |
| 86 |
OutputDevice& rTargetOutDev, |
| 87 |
const drawinglayer::geometry::ViewInformation2D& rViewInformation2D); |
| 88 |
|
| 89 |
/** extract the pixel data from a given BaseProcessor2D to |
| 90 |
a Bitmap. This may fail due to maybe system-dependent |
| 91 |
|
| 92 |
@param rProcessor |
| 93 |
A unique_ptr to a BaseProcessor2D from which to extract |
| 94 |
|
| 95 |
@return |
| 96 |
a Bitmap, may be empty, so check result |
| 97 |
*/ |
| 98 |
DRAWINGLAYER_DLLPUBLIC Bitmap extractBitmapFromBaseProcessor2D(const std::unique_ptr<BaseProcessor2D>& rProcessor); |
| 99 |
|
| 100 |
|
| 101 |
} // end of namespace drawinglayer::processor2d |
| 102 |
|
| 103 |
#endif //INCLUDED_DRAWINGLAYER_PROCESSOR2D_PROCESSOR2DTOOLS_HXX |
| 104 |
|
| 105 |
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |