1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dx_bitmap.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _DXCANVAS_DXBITMAP_HXX
32 #define _DXCANVAS_DXBITMAP_HXX
34 #include <com/sun/star/rendering/XCanvas.hpp>
35 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
36 #include <boost/shared_ptr.hpp>
37 #include <basegfx/vector/b2ivector.hxx>
38 #include <basegfx/point/b2dpoint.hxx>
39 #include <basegfx/range/b2drange.hxx>
40 #include "dx_winstuff.hxx"
41 #include "dx_ibitmap.hxx"
42 #include "dx_graphicsprovider.hxx"
43 #include "dx_gdiplususer.hxx"
47 class DXBitmap
: public IBitmap
50 DXBitmap( const BitmapSharedPtr
& rBitmap
,
52 DXBitmap( const ::basegfx::B2IVector
& rSize
,
55 virtual GraphicsSharedPtr
getGraphics();
57 virtual BitmapSharedPtr
getBitmap() const;
58 virtual ::basegfx::B2IVector
getSize() const;
59 virtual bool hasAlpha() const;
61 ::com::sun::star::uno::Sequence
< sal_Int8
> getData(
62 ::com::sun::star::rendering::IntegerBitmapLayout
& bitmapLayout
,
63 const ::com::sun::star::geometry::IntegerRectangle2D
& rect
);
66 const ::com::sun::star::uno::Sequence
< sal_Int8
>& data
,
67 const ::com::sun::star::rendering::IntegerBitmapLayout
& bitmapLayout
,
68 const ::com::sun::star::geometry::IntegerRectangle2D
& rect
);
71 const ::com::sun::star::uno::Sequence
< sal_Int8
>& color
,
72 const ::com::sun::star::rendering::IntegerBitmapLayout
& bitmapLayout
,
73 const ::com::sun::star::geometry::IntegerPoint2D
& pos
);
75 ::com::sun::star::uno::Sequence
< sal_Int8
> getPixel(
76 ::com::sun::star::rendering::IntegerBitmapLayout
& bitmapLayout
,
77 const ::com::sun::star::geometry::IntegerPoint2D
& pos
);
80 // Refcounted global GDI+ state container
81 GDIPlusUserSharedPtr mpGdiPlusUser
;
83 // size of this image in pixels [integral unit]
84 ::basegfx::B2IVector maSize
;
86 BitmapSharedPtr mpBitmap
;
87 GraphicsSharedPtr mpGraphics
;
89 // true if the bitmap contains an alpha channel
93 typedef ::boost::shared_ptr
< DXBitmap
> DXBitmapSharedPtr
;