LibreOffice Module canvas (master)  1
dx_bitmap.hxx
Go to the documentation of this file.
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 
20 #ifndef INCLUDED_CANVAS_SOURCE_DIRECTX_DX_BITMAP_HXX
21 #define INCLUDED_CANVAS_SOURCE_DIRECTX_DX_BITMAP_HXX
22 
23 #include <com/sun/star/rendering/XCanvas.hpp>
24 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
28 #include <memory>
29 #include "dx_winstuff.hxx"
30 #include "dx_ibitmap.hxx"
31 #include "dx_graphicsprovider.hxx"
32 #include "dx_gdiplususer.hxx"
33 
34 namespace dxcanvas
35 {
36  class DXBitmap : public IBitmap
37  {
38  public:
39  DXBitmap( const BitmapSharedPtr& rBitmap,
40  bool bWithAlpha );
41  DXBitmap( const ::basegfx::B2IVector& rSize,
42  bool bWithAlpha );
43 
44  virtual GraphicsSharedPtr getGraphics() override;
45 
46  virtual BitmapSharedPtr getBitmap() const override;
47  virtual ::basegfx::B2IVector getSize() const override;
48  virtual bool hasAlpha() const override;
49 
50  css::uno::Sequence< sal_Int8 > getData(
51  css::rendering::IntegerBitmapLayout& bitmapLayout,
52  const css::geometry::IntegerRectangle2D& rect ) override;
53 
54  void setData(
55  const css::uno::Sequence< sal_Int8 >& data,
56  const css::rendering::IntegerBitmapLayout& bitmapLayout,
57  const css::geometry::IntegerRectangle2D& rect ) override;
58 
59  void setPixel(
60  const css::uno::Sequence< sal_Int8 >& color,
61  const css::rendering::IntegerBitmapLayout& bitmapLayout,
62  const css::geometry::IntegerPoint2D& pos ) override;
63 
64  css::uno::Sequence< sal_Int8 > getPixel(
65  css::rendering::IntegerBitmapLayout& bitmapLayout,
66  const css::geometry::IntegerPoint2D& pos ) override;
67 
68  private:
69  // Refcounted global GDI+ state container
71 
72  // size of this image in pixels [integral unit]
74 
77 
78  // true if the bitmap contains an alpha channel
79  bool mbAlpha;
80  };
81 
82  typedef std::shared_ptr< DXBitmap > DXBitmapSharedPtr;
83 }
84 
85 #endif
86 
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
BitmapSharedPtr mpBitmap
Definition: dx_bitmap.hxx:75
::basegfx::B2IVector maSize
Definition: dx_bitmap.hxx:73
css::uno::Sequence< sal_Int8 > getPixel(css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos) override
Definition: dx_bitmap.cxx:184
virtual bool hasAlpha() const override
Definition: dx_bitmap.cxx:92
virtual GraphicsSharedPtr getGraphics() override
Definition: dx_bitmap.cxx:82
void setData(const css::uno::Sequence< sal_Int8 > &data, const css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect) override
Definition: dx_bitmap.cxx:131
std::shared_ptr< DXBitmap > DXBitmapSharedPtr
Definition: dx_bitmap.hxx:82
css::uno::Sequence< sal_Int8 > getData(css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect) override
Definition: dx_bitmap.cxx:97
size_t pos
virtual BitmapSharedPtr getBitmap() const override
Definition: dx_bitmap.cxx:77
virtual ::basegfx::B2IVector getSize() const override
Definition: dx_bitmap.cxx:87
GDIPlusUserSharedPtr mpGdiPlusUser
Definition: dx_bitmap.hxx:70
void setPixel(const css::uno::Sequence< sal_Int8 > &color, const css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos) override
Definition: dx_bitmap.cxx:164
std::shared_ptr< Gdiplus::Bitmap > BitmapSharedPtr
Definition: dx_winstuff.hxx:63
exports com.sun.star.chart2. data
GraphicsSharedPtr mpGraphics
Definition: dx_bitmap.hxx:76
GDIPlusUser::GDIPlusUserSharedPtr GDIPlusUserSharedPtr
DXBitmap(const BitmapSharedPtr &rBitmap, bool bWithAlpha)
Definition: dx_bitmap.cxx:40
Interface for internal canvas bitmap objects.
Definition: dx_ibitmap.hxx:34
std::shared_ptr< Gdiplus::Graphics > GraphicsSharedPtr
Definition: dx_winstuff.hxx:61