1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xoutbmp.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <vcl/graph.hxx>
35 #include <com/sun/star/uno/Sequence.h>
36 #include <com/sun/star/beans/PropertyValue.hpp>
37 #include "svx/svxdllapi.h"
43 #define XOUTBMP_MIRROR_HORZ 0x00000001L
44 #define XOUTBMP_MIRROR_VERT 0x00000010L
46 #define XOUTBMP_CONTOUR_HORZ 0x00000001L
47 #define XOUTBMP_CONTOUR_VERT 0x00000002L
48 #define XOUTBMP_CONTOUR_EDGEDETECT 0x00000004L
50 #define XOUTBMP_DONT_EXPAND_FILENAME 0x10000000L
51 #define XOUTBMP_USE_GIF_IF_POSSIBLE 0x20000000L
52 #define XOUTBMP_USE_GIF_IF_SENSIBLE 0x40000000L
53 #define XOUTBMP_USE_NATIVE_IF_POSSIBLE 0x80000000L
64 class SVX_DLLPUBLIC XOutBitmap
68 static GraphicFilter
* pGrfFilter
;
70 static BitmapEx
CreateQuickDrawBitmapEx( const Graphic
& rGraphic
, const OutputDevice
& rCompDev
,
71 const MapMode
& rMapMode
, const Size
& rLogSize
,
72 const Point
& rPoint
, const Size
& rSize
);
73 static Graphic
MirrorGraphic( const Graphic
& rGraphic
, const ULONG nMirrorFlags
);
74 static Animation
MirrorAnimation( const Animation
& rAnimation
, BOOL bHMirr
, BOOL bVMirr
);
75 static USHORT
WriteGraphic( const Graphic
& rGraphic
, String
& rFileName
,
76 const String
& rFilterName
, const ULONG nFlags
= 0L,
77 const Size
* pMtfSize_100TH_MM
= NULL
);
78 static void DrawQuickDrawBitmapEx( OutputDevice
* pOutDev
, const Point
& rPt
,
79 const Size
& rSize
, const BitmapEx
& rBmpEx
);
80 static void DrawTiledBitmapEx( OutputDevice
* pOutDev
, const Point
& rStartPt
, const Size
& rGrfSize
,
81 const Rectangle
& rTileRect
, const BitmapEx
& rBmpEx
);
83 static USHORT
ExportGraphic( const Graphic
& rGraphic
, const INetURLObject
& rURL
,
84 GraphicFilter
& rFilter
, const USHORT nFormat
,
85 const com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>* pFilterData
= NULL
);
87 static Bitmap
DetectEdges( const Bitmap
& rBmp
, const BYTE cThreshold
);
89 static Polygon
GetCountour( const Bitmap
& rBmp
, const ULONG nContourFlags
,
90 const BYTE cEdgeDetectThreshold
= 50,
91 const Rectangle
* pWorkRect
= NULL
);
98 SVX_DLLPUBLIC BOOL
DitherBitmap( Bitmap
& rBitmap
);
100 #endif // _XOUTBMP_HXX