update dev300-m58
[ooovba.git] / svtools / inc / jpeg.hxx
blob9a7b8c392256a8de8b2716328298a34354ba2782
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: jpeg.hxx,v $
10 * $Revision: 1.10 $
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 ************************************************************************/
31 #ifndef _JPEG_HXX
32 #define _JPEG_HXX
34 #ifndef _GRAPH_HXX
35 #include <vcl/graph.hxx>
36 #endif
37 #include <svtools/fltcall.hxx>
38 #include <com/sun/star/uno/Sequence.h>
39 #include <com/sun/star/beans/PropertyValue.hpp>
40 #include <com/sun/star/task/XStatusIndicator.hpp>
42 #ifdef _JPEGPRIVATE
44 // --------
45 // - Enum -
46 // --------
48 enum ReadState
50 JPEGREAD_OK,
51 JPEGREAD_ERROR,
52 JPEGREAD_NEED_MORE
55 // --------------
56 // - JPEGReader -
57 // --------------
59 class JPEGReader : public GraphicReader
61 SvStream& rIStm;
62 Bitmap aBmp;
63 Bitmap aBmp1;
64 BitmapWriteAccess* pAcc;
65 BitmapWriteAccess* pAcc1;
66 void* pBuffer;
67 long nLastPos;
68 long nFormerPos;
69 long nLastLines;
70 sal_Bool bSetLogSize;
72 Graphic CreateIntermediateGraphic( const Bitmap& rBitmap, long nLines );
73 void FillBitmap();
75 public:
77 void* CreateBitmap( void* JPEGCreateBitmapParam );
79 public:
83 JPEGReader( SvStream& rStm, void* pCallData, sal_Bool bSetLogSize );
84 virtual ~JPEGReader();
87 ReadState Read( Graphic& rGraphic );
90 // --------------
91 // - JPEGWriter -
92 // --------------
94 class JPEGWriter
96 SvStream& rOStm;
97 Bitmap aBmp;
98 BitmapReadAccess* pAcc;
99 BYTE* pBuffer;
100 BOOL bNative;
102 sal_Bool bGreys;
103 sal_Int32 nQuality;
105 com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
107 public:
109 void* GetScanline( long nY );
111 JPEGWriter( SvStream& rOStm, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData );
112 ~JPEGWriter() {};
114 BOOL Write( const Graphic& rGraphic );
117 #endif // _JPEGPRIVATE
119 // ---------------------
120 // - Import/ExportJPEG -
121 // ---------------------
123 BOOL ImportJPEG( SvStream& rStream, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags );
125 BOOL ExportJPEG( SvStream& rStream, const Graphic& rGraphic, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData );
127 #endif // _JPEG_HXX