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