Blame contrib/addtiffo/tif_ovrcache.h

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