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