1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_SVX_XOUTBMP_HXX
21 #define INCLUDED_SVX_XOUTBMP_HXX
23 #include <vcl/graph.hxx>
24 #include <com/sun/star/uno/Sequence.h>
25 #include <com/sun/star/beans/PropertyValue.hpp>
26 #include <svx/svxdllapi.h>
28 #define XOUTBMP_MIRROR_HORZ 0x00000001L
29 #define XOUTBMP_MIRROR_VERT 0x00000010L
31 #define XOUTBMP_CONTOUR_HORZ 0x00000001L
32 #define XOUTBMP_CONTOUR_VERT 0x00000002L
33 #define XOUTBMP_CONTOUR_EDGEDETECT 0x00000004L
34 #define XOUTBMP_DONT_ADD_EXTENSION 0x00000008L
36 #define XOUTBMP_DONT_EXPAND_FILENAME 0x10000000L
37 #define XOUTBMP_USE_GIF_IF_POSSIBLE 0x20000000L
38 #define XOUTBMP_USE_GIF_IF_SENSIBLE 0x40000000L
39 #define XOUTBMP_USE_NATIVE_IF_POSSIBLE 0x80000000L
46 class SVX_DLLPUBLIC XOutBitmap
50 static GraphicFilter
* pGrfFilter
;
52 static Graphic
MirrorGraphic( const Graphic
& rGraphic
, const BmpMirrorFlags nMirrorFlags
);
53 static Animation
MirrorAnimation( const Animation
& rAnimation
, bool bHMirr
, bool bVMirr
);
54 static sal_uInt16
WriteGraphic( const Graphic
& rGraphic
, OUString
& rFileName
,
55 const OUString
& rFilterName
, const sal_uIntPtr nFlags
= 0L,
56 const Size
* pMtfSize_100TH_MM
= NULL
);
57 static sal_uLong
GraphicToBase64(const Graphic
& rGraphic
,OUString
& rOUString
);
59 static sal_uInt16
ExportGraphic( const Graphic
& rGraphic
, const INetURLObject
& rURL
,
60 GraphicFilter
& rFilter
, const sal_uInt16 nFormat
,
61 const com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>* pFilterData
= NULL
);
63 static Bitmap
DetectEdges( const Bitmap
& rBmp
, const sal_uInt8 cThreshold
);
65 static Polygon
GetCountour( const Bitmap
& rBmp
, const sal_uIntPtr nContourFlags
,
66 const sal_uInt8 cEdgeDetectThreshold
= 50,
67 const Rectangle
* pWorkRect
= NULL
);
70 SVX_DLLPUBLIC
bool DitherBitmap( Bitmap
& rBitmap
);
72 #endif // INCLUDED_SVX_XOUTBMP_HXX
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */