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/.
10 #ifndef INCLUDED_CANVAS_SOURCE_OPENGL_OGL_BITMAPCANVASHELPER_HXX
11 #define INCLUDED_CANVAS_SOURCE_OPENGL_OGL_BITMAPCANVASHELPER_HXX
13 #include <com/sun/star/rendering/XBitmapCanvas.hpp>
14 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
16 #include <basegfx/vector/b2isize.hxx>
17 #include <basegfx/vector/b2dsize.hxx>
19 #include <boost/utility.hpp>
20 #include <boost/shared_ptr.hpp>
23 #include "ogl_canvashelper.hxx"
28 /** Helper class for basic canvas functionality. */
29 class BitmapCanvasHelper
: public CanvasHelper
34 /// Release all references
37 /** Initialize canvas helper
39 This method late-initializes the canvas helper, providing
40 it with the necessary device and output objects. Note that
41 the CanvasHelper does <em>not</em> take ownership of the
42 passed rDevice reference, nor does it perform any
43 reference counting. Thus, to prevent the reference counted
44 SpriteCanvas object from deletion, the user of this class
45 is responsible for holding ref-counted references itself!
48 Reference device this canvas is associated with
51 void init( ::com::sun::star::rendering::XGraphicDevice
& rDevice
,
52 SpriteDeviceHelper
& rDeviceHelper
,
53 const ::com::sun::star::geometry::IntegerSize2D
& rSize
);
55 // BitmapCanvasHelper functionality
56 // ================================
58 ::com::sun::star::geometry::IntegerSize2D
getSize() { return maSize
; }
60 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XBitmapCanvas
> queryBitmapCanvas();
62 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XBitmap
>
63 getScaledBitmap( const ::com::sun::star::geometry::RealSize2D
& newSize
,
66 ::com::sun::star::uno::Sequence
< sal_Int8
>
67 getData( ::com::sun::star::rendering::IntegerBitmapLayout
& bitmapLayout
,
68 const ::com::sun::star::geometry::IntegerRectangle2D
& rect
);
70 ::com::sun::star::uno::Sequence
< sal_Int8
>
71 getPixel( ::com::sun::star::rendering::IntegerBitmapLayout
& bitmapLayout
,
72 const ::com::sun::star::geometry::IntegerPoint2D
& pos
);
74 ::com::sun::star::rendering::IntegerBitmapLayout
getMemoryLayout();
77 ::com::sun::star::geometry::IntegerSize2D maSize
;
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */