1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _DXCANVAS_DXIBITMAP_HXX
25 #define _DXCANVAS_DXIBITMAP_HXX
26 
27 #include <com/sun/star/rendering/XCanvas.hpp>
28 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
29 #include <boost/shared_ptr.hpp>
30 #include <basegfx/vector/b2ivector.hxx>
31 #include <basegfx/point/b2dpoint.hxx>
32 #include <basegfx/range/b2drange.hxx>
33 #include "dx_graphicsprovider.hxx"
34 
35 namespace dxcanvas
36 {
37     /// Interface for internal canvas bitmap objects
38     struct IBitmap : public GraphicsProvider
39     {
40         virtual BitmapSharedPtr           getBitmap() const = 0;
41         virtual ::basegfx::B2IVector      getSize() const = 0;
42         virtual bool                      hasAlpha() const = 0;
43 
44         virtual ::com::sun::star::uno::Sequence< sal_Int8 > getData(
45             ::com::sun::star::rendering::IntegerBitmapLayout&		bitmapLayout,
46             const ::com::sun::star::geometry::IntegerRectangle2D&	rect ) = 0;
47 
48         virtual void setData(
49             const ::com::sun::star::uno::Sequence< sal_Int8 >&		data,
50             const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
51             const ::com::sun::star::geometry::IntegerRectangle2D&	rect ) = 0;
52 
53         virtual void setPixel(
54             const ::com::sun::star::uno::Sequence< sal_Int8 >&		color,
55             const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
56             const ::com::sun::star::geometry::IntegerPoint2D&		pos ) = 0;
57 
58         virtual ::com::sun::star::uno::Sequence< sal_Int8 > getPixel(
59             ::com::sun::star::rendering::IntegerBitmapLayout&		bitmapLayout,
60             const ::com::sun::star::geometry::IntegerPoint2D&		pos ) = 0;
61     };
62 
63     typedef boost::shared_ptr<IBitmap> IBitmapSharedPtr;
64 }
65 
66 #endif
67