Debian Codegraph @

texk/xdvipsk/thirdparty/libtiff/contrib/addtiffo/tif_ovrcache.h

raw
1 /******************************************************************************
2 * tif_ovrcache.h,v 1.3 2005/05/25 09:03:16 dron Exp
3 *
4 * Project: TIFF Overview Builder
5 * Purpose: Library functions to maintain two rows of tiles or two strips
6 * of data for output overviews as an output cache.
7 * Author: Frank Warmerdam, [email protected]
8 *
9 * This code could potentially be used by other applications wanting to
10 * manage a once-through write cache.
11 *
12 ******************************************************************************
13 * Copyright (c) 2000, Frank Warmerdam
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining a
16 * copy of this software and associated documentation files (the "Software"),
17 * to deal in the Software without restriction, including without limitation
18 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
19 * and/or sell copies of the Software, and to permit persons to whom the
20 * Software is furnished to do so, subject to the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be included
23 * in all copies or substantial portions of the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
26 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
28 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
31 * DEALINGS IN THE SOFTWARE.
32 ******************************************************************************
33 */
34
35 #ifndef TIF_OVRCACHE_H_INCLUDED
36 #define TIF_OVRCACHE_H_INCLUDED
37
38 #include "tiffio.h"
39
40 #if defined(__cplusplus)
41 extern "C"
42 {
43 #endif
44
45 typedef struct
46 {
47 uint32_t nXSize;
48 uint32_t nYSize;
49
50 uint16_t nBitsPerPixel;
51 uint16_t nSamples;
52 uint16_t nPlanarConfig;
53 uint32_t nBlockXSize;
54 uint32_t nBlockYSize;
55 toff_t nBytesPerBlock;
56 toff_t nBytesPerRow;
57
58 int nBlocksPerRow;
59 int nBlocksPerColumn;
60
61 int nBlockOffset; /* what block is the first in papabyBlocks? */
62 unsigned char *pabyRow1Blocks;
63 unsigned char *pabyRow2Blocks;
64
65 toff_t nDirOffset;
66 TIFF *hTIFF;
67 int bTiled;
68
69 } TIFFOvrCache;
70
71 TIFFOvrCache *TIFFCreateOvrCache(TIFF *hTIFF, toff_t nDirOffset);
72 unsigned char *TIFFGetOvrBlock(TIFFOvrCache *psCache, int iTileX,
73 int iTileY, int iSample);
74 unsigned char *TIFFGetOvrBlock_Subsampled(TIFFOvrCache *psCache, int iTileX,
75 int iTileY);
76 void TIFFDestroyOvrCache(TIFFOvrCache *);
77
78 void TIFFBuildOverviews(TIFF *, int, int *, int, const char *,
79 int (*)(double, void *), void *);
80
81 void TIFF_ProcessFullResBlock(TIFF *, int, int, int, int, int, int *, int,
82 int, TIFFOvrCache **, uint32_t, uint32_t,
83 unsigned char *, uint32_t, uint32_t, int,
84 const char *);
85
86 uint32_t TIFF_WriteOverview(TIFF *, uint32_t, uint32_t, int, int, int, int,
87 int, int, int, int, int, unsigned short *,
88 unsigned short *, unsigned short *, int, int,
89 int);
90
91 #if defined(__cplusplus)
92 }
93 #endif
94
95 #endif /* ndef TIF_OVRCACHE_H_INCLUDED */