1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _XOUTBMP_HXX 25 #define _XOUTBMP_HXX 26 27 #include <vcl/graph.hxx> 28 #include <com/sun/star/uno/Sequence.h> 29 #include <com/sun/star/beans/PropertyValue.hpp> 30 #include "svx/svxdllapi.h" 31 32 // ----------- 33 // - Defines - 34 // ----------- 35 36 #define XOUTBMP_MIRROR_HORZ 0x00000001L 37 #define XOUTBMP_MIRROR_VERT 0x00000010L 38 39 #define XOUTBMP_CONTOUR_HORZ 0x00000001L 40 #define XOUTBMP_CONTOUR_VERT 0x00000002L 41 #define XOUTBMP_CONTOUR_EDGEDETECT 0x00000004L 42 #define XOUTBMP_DONT_ADD_EXTENSION 0x00000008L 43 44 #define XOUTBMP_DONT_EXPAND_FILENAME 0x10000000L 45 #define XOUTBMP_USE_GIF_IF_POSSIBLE 0x20000000L 46 #define XOUTBMP_USE_GIF_IF_SENSIBLE 0x40000000L 47 #define XOUTBMP_USE_NATIVE_IF_POSSIBLE 0x80000000L 48 49 // -------------- 50 // - XOutBitmap - 51 // -------------- 52 53 class GraphicFilter; 54 class VirtualDevice; 55 class INetURLObject; 56 class Polygon; 57 58 class SVX_DLLPUBLIC XOutBitmap 59 { 60 public: 61 62 static GraphicFilter* pGrfFilter; 63 64 static Graphic MirrorGraphic( const Graphic& rGraphic, const sal_uIntPtr nMirrorFlags ); 65 static Animation MirrorAnimation( const Animation& rAnimation, sal_Bool bHMirr, sal_Bool bVMirr ); 66 static sal_uInt16 WriteGraphic( const Graphic& rGraphic, String& rFileName, 67 const String& rFilterName, const sal_uIntPtr nFlags = 0L, 68 const Size* pMtfSize_100TH_MM = NULL ); 69 static sal_uInt16 ExportGraphic( const Graphic& rGraphic, const INetURLObject& rURL, 70 GraphicFilter& rFilter, const sal_uInt16 nFormat, 71 const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData = NULL ); 72 73 static Bitmap DetectEdges( const Bitmap& rBmp, const sal_uInt8 cThreshold ); 74 75 static Polygon GetCountour( const Bitmap& rBmp, const sal_uIntPtr nContourFlags, 76 const sal_uInt8 cEdgeDetectThreshold = 50, 77 const Rectangle* pWorkRect = NULL ); 78 }; 79 80 // ---------------- 81 // - DitherBitmap - 82 // ---------------- 83 84 SVX_DLLPUBLIC sal_Bool DitherBitmap( Bitmap& rBitmap ); 85 86 #endif // _XOUTBMP_HXX 87