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 <com/sun/star/rendering/XCanvas.hpp>
23 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
24 #include <basegfx/vector/b2ivector.hxx>
25 #include <basegfx/point/b2dpoint.hxx>
26 #include <basegfx/range/b2drange.hxx>
28 #include "dx_winstuff.hxx"
29 #include "dx_ibitmap.hxx"
30 #include "dx_graphicsprovider.hxx"
31 #include "dx_gdiplususer.hxx"
35 class DXBitmap
: public IBitmap
38 DXBitmap( const BitmapSharedPtr
& rBitmap
, bool bWithAlpha
);
39 DXBitmap( const ::basegfx::B2ISize
& rSize
, bool bWithAlpha
);
41 virtual GraphicsSharedPtr
getGraphics() override
;
43 virtual BitmapSharedPtr
getBitmap() const override
;
44 virtual ::basegfx::B2ISize
getSize() const override
;
45 virtual bool hasAlpha() const override
;
47 css::uno::Sequence
< sal_Int8
> getData(
48 css::rendering::IntegerBitmapLayout
& bitmapLayout
,
49 const css::geometry::IntegerRectangle2D
& rect
) override
;
52 const css::uno::Sequence
< sal_Int8
>& data
,
53 const css::rendering::IntegerBitmapLayout
& bitmapLayout
,
54 const css::geometry::IntegerRectangle2D
& rect
) override
;
57 const css::uno::Sequence
< sal_Int8
>& color
,
58 const css::rendering::IntegerBitmapLayout
& bitmapLayout
,
59 const css::geometry::IntegerPoint2D
& pos
) override
;
61 css::uno::Sequence
< sal_Int8
> getPixel(
62 css::rendering::IntegerBitmapLayout
& bitmapLayout
,
63 const css::geometry::IntegerPoint2D
& pos
) override
;
66 // Refcounted global GDI+ state container
67 GDIPlusUserSharedPtr mpGdiPlusUser
;
69 // size of this image in pixels [integral unit]
70 ::basegfx::B2ISize maSize
;
72 BitmapSharedPtr mpBitmap
;
73 GraphicsSharedPtr mpGraphics
;
75 // true if the bitmap contains an alpha channel
79 typedef std::shared_ptr
< DXBitmap
> DXBitmapSharedPtr
;
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */