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,
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: */
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:74
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
::basegfx::B2IVector maSize
Definition: dx_bitmap.hxx:72
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:69
GraphicsSharedPtr mpGraphics
Definition: dx_bitmap.hxx:75
css::uno::Sequence< sal_Int8 > getData(css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect) override
Definition: dx_bitmap.cxx:97
virtual ::basegfx::B2IVector getSize() const override
Definition: dx_bitmap.cxx:87
DXBitmap(const BitmapSharedPtr &rBitmap, bool bWithAlpha)
Definition: dx_bitmap.cxx:40
virtual BitmapSharedPtr getBitmap() const override
Definition: dx_bitmap.cxx:77
std::shared_ptr< DXBitmap > DXBitmapSharedPtr
Definition: dx_bitmap.hxx:81
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