|
roentgen |
b75cab |
/******************************************************************************
|
|
roentgen |
b75cab |
* tif_ovrcache.h,v 1.3 2005/05/25 09:03:16 dron Exp
|
|
roentgen |
b75cab |
*
|
|
roentgen |
b75cab |
* Project: TIFF Overview Builder
|
|
roentgen |
b75cab |
* Purpose: Library functions to maintain two rows of tiles or two strips
|
|
roentgen |
b75cab |
* of data for output overviews as an output cache.
|
|
roentgen |
b75cab |
* Author: Frank Warmerdam, warmerdam@pobox.com
|
|
roentgen |
b75cab |
*
|
|
roentgen |
b75cab |
* This code could potentially be used by other applications wanting to
|
|
roentgen |
b75cab |
* manage a once-through write cache.
|
|
roentgen |
b75cab |
*
|
|
roentgen |
b75cab |
******************************************************************************
|
|
roentgen |
b75cab |
* Copyright (c) 2000, Frank Warmerdam
|
|
roentgen |
b75cab |
*
|
|
roentgen |
b75cab |
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
roentgen |
b75cab |
* copy of this software and associated documentation files (the "Software"),
|
|
roentgen |
b75cab |
* to deal in the Software without restriction, including without limitation
|
|
roentgen |
b75cab |
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
roentgen |
b75cab |
* and/or sell copies of the Software, and to permit persons to whom the
|
|
roentgen |
b75cab |
* Software is furnished to do so, subject to the following conditions:
|
|
roentgen |
b75cab |
*
|
|
roentgen |
b75cab |
* The above copyright notice and this permission notice shall be included
|
|
roentgen |
b75cab |
* in all copies or substantial portions of the Software.
|
|
roentgen |
b75cab |
*
|
|
roentgen |
b75cab |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
roentgen |
b75cab |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
roentgen |
b75cab |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
roentgen |
b75cab |
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
roentgen |
b75cab |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
roentgen |
b75cab |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
roentgen |
b75cab |
* DEALINGS IN THE SOFTWARE.
|
|
roentgen |
b75cab |
******************************************************************************
|
|
roentgen |
b75cab |
*/
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
#ifndef TIF_OVRCACHE_H_INCLUDED
|
|
roentgen |
b75cab |
#define TIF_OVRCACHE_H_INCLUDED
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
#include "tiffio.h"
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
#if defined(__cplusplus)
|
|
roentgen |
b75cab |
extern "C" {
|
|
roentgen |
b75cab |
#endif
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
typedef struct
|
|
roentgen |
b75cab |
{
|
|
roentgen |
b75cab |
uint32 nXSize;
|
|
roentgen |
b75cab |
uint32 nYSize;
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
uint16 nBitsPerPixel;
|
|
roentgen |
b75cab |
uint16 nSamples;
|
|
roentgen |
b75cab |
uint16 nPlanarConfig;
|
|
roentgen |
b75cab |
uint32 nBlockXSize;
|
|
roentgen |
b75cab |
uint32 nBlockYSize;
|
|
roentgen |
b75cab |
toff_t nBytesPerBlock;
|
|
roentgen |
b75cab |
toff_t nBytesPerRow;
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
int nBlocksPerRow;
|
|
roentgen |
b75cab |
int nBlocksPerColumn;
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
int nBlockOffset; /* what block is the first in papabyBlocks? */
|
|
roentgen |
b75cab |
unsigned char *pabyRow1Blocks;
|
|
roentgen |
b75cab |
unsigned char *pabyRow2Blocks;
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
toff_t nDirOffset;
|
|
roentgen |
b75cab |
TIFF *hTIFF;
|
|
roentgen |
b75cab |
int bTiled;
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
} TIFFOvrCache;
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
TIFFOvrCache *TIFFCreateOvrCache( TIFF *hTIFF, toff_t nDirOffset );
|
|
roentgen |
b75cab |
unsigned char *TIFFGetOvrBlock( TIFFOvrCache *psCache, int iTileX, int iTileY,
|
|
roentgen |
b75cab |
int iSample );
|
|
roentgen |
b75cab |
unsigned char *TIFFGetOvrBlock_Subsampled( TIFFOvrCache *psCache, int iTileX, int iTileY );
|
|
roentgen |
b75cab |
void TIFFDestroyOvrCache( TIFFOvrCache * );
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
void TIFFBuildOverviews( TIFF *, int, int *, int, const char *,
|
|
roentgen |
b75cab |
int (*)(double,void*), void * );
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
void TIFF_ProcessFullResBlock( TIFF *, int, int, int, int, int, int *, int,
|
|
roentgen |
b75cab |
int, TIFFOvrCache **, uint32, uint32,
|
|
roentgen |
b75cab |
unsigned char *, uint32, uint32,
|
|
roentgen |
b75cab |
int, const char * );
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
uint32 TIFF_WriteOverview( TIFF *, uint32, uint32, int, int, int, int, int,
|
|
roentgen |
b75cab |
int, int, int, int, unsigned short *,
|
|
roentgen |
b75cab |
unsigned short *, unsigned short *, int,
|
|
roentgen |
b75cab |
int, int);
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
#if defined(__cplusplus)
|
|
roentgen |
b75cab |
}
|
|
roentgen |
b75cab |
#endif
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
#endif /* ndef TIF_OVRCACHE_H_INCLUDED */
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
/*
|
|
roentgen |
b75cab |
* Local Variables:
|
|
roentgen |
b75cab |
* mode: c
|
|
roentgen |
b75cab |
* c-basic-offset: 8
|
|
roentgen |
b75cab |
* fill-column: 78
|
|
roentgen |
b75cab |
* End:
|
|
roentgen |
b75cab |
*/
|