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