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