/******************************************************************************
* $Id: gdal.h 10646 2007-01-18 02:38:10Z warmerdam $
*
* Project: GDAL Core
* Purpose: GDAL Core C/Public declarations.
* Author: Frank Warmerdam, warmerdam@pobox.com
*
******************************************************************************
* Copyright (c) 1998, 2002 Frank Warmerdam
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
#ifndef GDAL_H_INCLUDED
#define GDAL_H_INCLUDED
/**
* \file gdal.h
*
* Public (C callable) GDAL entry points.
*/
#include "gdal_version.h"
#include "cpl_port.h"
#include "cpl_error.h"
/* -------------------------------------------------------------------- */
/* Significant constants. */
/* -------------------------------------------------------------------- */
CPL_C_START
/*! Pixel data types */
typedef enum {
GDT_Unknown = 0,
/*! Eight bit unsigned integer */ GDT_Byte = 1,
/*! Sixteen bit unsigned integer */ GDT_UInt16 = 2,
/*! Sixteen bit signed integer */ GDT_Int16 = 3,
/*! Thirty two bit unsigned integer */ GDT_UInt32 = 4,
/*! Thirty two bit signed integer */ GDT_Int32 = 5,
/*! Thirty two bit floating point */ GDT_Float32 = 6,
/*! Sixty four bit floating point */ GDT_Float64 = 7,
/*! Complex Int16 */ GDT_CInt16 = 8,
/*! Complex Int32 */ GDT_CInt32 = 9,
/*! Complex Float32 */ GDT_CFloat32 = 10,
/*! Complex Float64 */ GDT_CFloat64 = 11,
GDT_TypeCount = 12 /* maximum type # + 1 */
} GDALDataType;
int CPL_DLL CPL_STDCALL GDALGetDataTypeSize( GDALDataType );
int CPL_DLL CPL_STDCALL GDALDataTypeIsComplex( GDALDataType );
const char CPL_DLL * CPL_STDCALL GDALGetDataTypeName( GDALDataType );
GDALDataType CPL_DLL CPL_STDCALL GDALGetDataTypeByName( const char * );
GDALDataType CPL_DLL CPL_STDCALL GDALDataTypeUnion( GDALDataType, GDALDataType );
/*! Flag indicating read/write, or read-only access to data. */
typedef enum {
/*! Read only (no update) access */ GA_ReadOnly = 0,
/*! Read/write access. */ GA_Update = 1
} GDALAccess;
/*! Read/Write flag for RasterIO() method */
typedef enum {
/*! Read data */ GF_Read = 0,
/*! Write data */ GF_Write = 1
} GDALRWFlag;
/*! Types of color interpretation for raster bands. */
typedef enum
{
GCI_Undefined=0,
/*! Greyscale */ GCI_GrayIndex=1,
/*! Paletted (see associated color table) */ GCI_PaletteIndex=2,
/*! Red band of RGBA image */ GCI_RedBand=3,
/*! Green band of RGBA image */ GCI_GreenBand=4,
/*! Blue band of RGBA image */ GCI_BlueBand=5,
/*! Alpha (0=transparent, 255=opaque) */ GCI_AlphaBand=6,
/*! Hue band of HLS image */ GCI_HueBand=7,
/*! Saturation band of HLS image */ GCI_SaturationBand=8,
/*! Lightness band of HLS image */ GCI_LightnessBand=9,
/*! Cyan band of CMYK image */ GCI_CyanBand=10,
/*! Magenta band of CMYK image */ GCI_MagentaBand=11,
/*! Yellow band of CMYK image */ GCI_YellowBand=12,
/*! Black band of CMLY image */ GCI_BlackBand=13,
/*! Y Luminance */ GCI_YCbCr_YBand=14,
/*! Cb Chroma */ GCI_YCbCr_CbBand=15,
/*! Cr Chroma */ GCI_YCbCr_CrBand=16,
/*! Max current value */ GCI_Max=16
} GDALColorInterp;
/*! Translate a GDALColorInterp into a user displayable string. */
const char CPL_DLL *GDALGetColorInterpretationName( GDALColorInterp );
/*! Types of color interpretations for a GDALColorTable. */
typedef enum
{
/*! Grayscale (in GDALColorEntry.c1) */ GPI_Gray=0,
/*! Red, Green, Blue and Alpha in (in c1, c2, c3 and c4) */ GPI_RGB=1,
/*! Cyan, Magenta, Yellow and Black (in c1, c2, c3 and c4)*/ GPI_CMYK=2,
/*! Hue, Lightness and Saturation (in c1, c2, and c3) */ GPI_HLS=3
} GDALPaletteInterp;
/*! Translate a GDALPaletteInterp into a user displayable string. */
const char CPL_DLL *GDALGetPaletteInterpretationName( GDALPaletteInterp );
/* "well known" metadata items. */
#define GDALMD_AREA_OR_POINT "AREA_OR_POINT"
# define GDALMD_AOP_AREA "Area"
# define GDALMD_AOP_POINT "Point"
/* -------------------------------------------------------------------- */
/* GDAL Specific error codes. */
/* */
/* error codes 100 to 299 reserved for GDAL. */
/* -------------------------------------------------------------------- */
#define CPLE_WrongFormat 200
/* -------------------------------------------------------------------- */
/* Define handle types related to various internal classes. */
/* -------------------------------------------------------------------- */
typedef void *GDALMajorObjectH;
typedef void *GDALDatasetH;
typedef void *GDALRasterBandH;
typedef void *GDALDriverH;
typedef void *GDALProjDefH;
typedef void *GDALColorTableH;
typedef void *GDALRasterAttributeTableH;
/* -------------------------------------------------------------------- */
/* Callback "progress" function. */
/* -------------------------------------------------------------------- */
typedef int (CPL_STDCALL *GDALProgressFunc)(double,const char *, void *);
int CPL_DLL CPL_STDCALL GDALDummyProgress( double, const char *, void *);
int CPL_DLL CPL_STDCALL GDALTermProgress( double, const char *, void *);
int CPL_DLL CPL_STDCALL GDALScaledProgress( double, const char *, void *);
void CPL_DLL * CPL_STDCALL GDALCreateScaledProgress( double, double,
GDALProgressFunc, void * );
void CPL_DLL CPL_STDCALL GDALDestroyScaledProgress( void * );
/* ==================================================================== */
/* Registration/driver related. */
/* ==================================================================== */
typedef struct {
char *pszOptionName;
char *pszValueType; /* "boolean", "int", "float", "string",
"string-select" */
char *pszDescription;
char **papszOptions;
} GDALOptionDefinition;
#define GDAL_DMD_LONGNAME "DMD_LONGNAME"
#define GDAL_DMD_HELPTOPIC "DMD_HELPTOPIC"
#define GDAL_DMD_MIMETYPE "DMD_MIMETYPE"
#define GDAL_DMD_EXTENSION "DMD_EXTENSION"
#define GDAL_DM