Move setting of LD_LIBRARY_PATH closer to invocation of cppunittester
[LibreOffice.git] / canvas / source / directx / dx_impltools.hxx
blob2c6b85ce83ff04da2dc1a99d75ff75246e743e84
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <com/sun/star/uno/Reference.hxx>
23 #include <com/sun/star/uno/Sequence.hxx>
24 #include <com/sun/star/util/TriState.hpp>
26 #include <basegfx/polygon/b2dpolygon.hxx>
27 #include <basegfx/polygon/b2dpolypolygon.hxx>
28 #include <basegfx/numeric/ftools.hxx>
30 #include <memory>
31 #include "dx_canvasfont.hxx"
33 namespace basegfx
35 class B2DPoint;
36 class B2DRange;
37 class B2DHomMatrix;
38 class B2IRange;
39 class B2DPolyPolygon;
42 namespace com::sun::star::geometry
44 struct IntegerRectangle2D;
45 struct RealPoint2D;
48 namespace com::sun::star::rendering
50 class XBitmap;
51 class XPolyPolygon2D;
52 class XCanvasFont;
56 namespace dxcanvas::tools
58 struct RawRGBABitmap;
60 ::basegfx::B2DPolyPolygon
61 polyPolygonFromXPolyPolygon2D( const css::uno::Reference< css::rendering::XPolyPolygon2D >& );
63 Gdiplus::Graphics* createGraphicsFromHDC(HDC);
64 GraphicsSharedPtr createGraphicsFromBitmap(const BitmapSharedPtr&);
66 void setupGraphics( Gdiplus::Graphics& rGraphics );
68 void gdiPlusMatrixFromB2DHomMatrix( Gdiplus::Matrix& rGdiplusMatrix,
69 const ::basegfx::B2DHomMatrix& rMatrix );
70 void gdiPlusMatrixFromAffineMatrix2D( Gdiplus::Matrix& rGdiplusMatrix,
71 const css::geometry::AffineMatrix2D& rMatrix );
73 Gdiplus::PointF gdiPlusPointFFromRealPoint2D( const css::geometry::RealPoint2D& );
74 Gdiplus::RectF gdiPlusRectFFromRectangle2D( const css::geometry::RealRectangle2D& );
75 Gdiplus::Rect gdiPlusRectFromIntegerRectangle2D( const css::geometry::IntegerRectangle2D& );
76 RECT gdiRectFromB2IRect( const ::basegfx::B2IRange& );
78 css::geometry::RealPoint2D realPoint2DFromGdiPlusPointF( const Gdiplus::PointF& );
79 css::geometry::RealRectangle2D realRectangle2DFromGdiPlusRectF( const Gdiplus::RectF& );
81 ::basegfx::B2DPoint b2dPointFromGdiPlusPointF( const Gdiplus::PointF& );
82 ::basegfx::B2DRange b2dRangeFromGdiPlusRectF( const Gdiplus::RectF& );
84 css::uno::Sequence< sal_Int8 > argbToIntSequence( Gdiplus::ARGB rColor );
85 Gdiplus::ARGB sequenceToArgb( const css::uno::Sequence< sal_Int8 >& rColor );
86 Gdiplus::ARGB sequenceToArgb( const css::uno::Sequence< double >& rColor );
88 GraphicsPathSharedPtr graphicsPathFromRealPoint2DSequence( const css::uno::Sequence<
89 css::uno::Sequence< css::geometry::RealPoint2D > >& );
91 GraphicsPathSharedPtr graphicsPathFromB2DPolygon(
92 const ::basegfx::B2DPolygon& rPoly,
93 bool bNoLineJoin = false);
95 GraphicsPathSharedPtr graphicsPathFromB2DPolyPolygon(
96 const ::basegfx::B2DPolyPolygon& rPoly,
97 bool bNoLineJoin = false);
99 GraphicsPathSharedPtr graphicsPathFromXPolyPolygon2D(
100 const css::uno::Reference< css::rendering::XPolyPolygon2D >&,
101 bool bNoLineJoin = false );
103 bool drawGdiPlusBitmap( const GraphicsSharedPtr& rGraphics,
104 const BitmapSharedPtr& rBitmap );
105 bool drawDIBits( const std::shared_ptr< Gdiplus::Graphics >& rGraphics,
106 const BITMAPINFO& rBI,
107 const void* pBits );
109 bool drawRGBABits( const std::shared_ptr< Gdiplus::Graphics >& rGraphics,
110 const RawRGBABitmap& rRawRGBAData );
112 BitmapSharedPtr bitmapFromXBitmap( const css::uno::Reference< css::rendering::XBitmap >& xBitmap );
114 CanvasFont::ImplRef canvasFontFromXFont( const css::uno::Reference< css::rendering::XCanvasFont >& xFont );
116 void setModulateImageAttributes( Gdiplus::ImageAttributes& o_rAttr,
117 double nRedModulation,
118 double nGreenModulation,
119 double nBlueModulation,
120 double nAlphaModulation );
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */