xref: /trunk/main/svtools/source/filter/jpeg/jpeg.h (revision 2123d757)
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 _JPEG_H
25 #define _JPEG_H
26 
27 #if defined( ICC )
28 #include <stdio.h>
29 #endif
30 
31 #if defined (UNX) || defined(__MINGW32__)
32 #include <sys/types.h>
33 #endif
34 
35 struct JPEGCreateBitmapParam
36 {
37     unsigned long nWidth;
38     unsigned long nHeight;
39     unsigned long density_unit;
40     unsigned long X_density;
41     unsigned long Y_density;
42     long     bGray;
43 
44     long     nAlignedWidth;  // these members will be filled by the
45     long     bTopDown;      // CreateBitmap method in svtools
46 };
47 
48 typedef struct my_error_mgr*	my_error_ptr;
49 typedef unsigned char*			HPBYTE;
50 
51 void*	JPEGMalloc( size_t size );
52 void	JPEGFree( void *ptr );
53 long	JPEGCallback( void* pCallbackData, long nPercent );
54 
55 long	WriteJPEG( void* pJPEGWriter, void* pOStm, long nWidth, long nHeight, long bGreyScale,
56 				   long nQualityPercent, void* pCallbackData );
57 void*	GetScanline( void* pJPEGWriter, long nY );
58 
59 void	ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines );
60 void*	CreateBitmap( void* pJPEGReader, void* pJPEGCreateBitmapParam );
61 
62 /* TODO: when incompatible changes are possible again
63    the preview size hint should be redone */
64 void    SetJpegPreviewSizeHint( int nWidth, int nHeight );
65 
66 #endif
67