/********************************************************************** * $Id: pgraster_compression.h 2007-07-15 Xing $ * * PostGIS - Spatial Types for PostgreSQL * http://postgis.refractions.net * Copyright 2001-2003 Refractions Research Inc. * * This is free software; you can redistribute and/or modify it under * the terms of hte GNU General Public Licence. See the COPYING file. * ********************************************************************** * * File Name: pgraster_compression.c * * Author: Xing Lin, solo.lin@gmail.com * * Create Date: 2007-07-15 * * Description: This file will include the prototype of compression * functions that will be used in PGRaster extension. * * Original Author: Xing Lin, solo.lin@gmail.com * * Maintainer: Xing Lin, solo.lin@gmail.com * * Last Update: 2007-07-15 * **********************************************************************/ #ifndef _PGRASTER_COMPRESSION #define _PGRASTER_COMPRESSION 1 #include "pgraster_const.h" /* * Name: compress * Function: Compress the input data in the approach that specified by * type paramater. * Parameters: [in] PGRasterCompressionType type * [in] const char *in (in bits) * [in] const in sizeIn * [out] char **out, * [out] int *sizeOut (in bits) * [return] bool (true=succesful, false=failed) * Warning: memory will be allocated within the functions, but need to * be freed outside the function. */ bool compress(PGRasterCompressionType type, const char *in, char **out, const int sizeIn, int *sizeOut); /* * Name: compressLZW * Function: Compress the input data in the approach of LZW * Parameters: [in] PGRasterCompressionType type * [in] const char *in (in bits) * [in] const in sizeIn * [out] char **out, * [out] int *sizeOut (in bits) * [return] bool (true=succesful, false=failed) * Warning: memory will be allocated within the functions, but need to * be freed outside the function. */ bool compressLZW(const char *in, char **out, const int sizeIn, int *sizeOut); /* * Name: compressJPEG-B * Function: Compress the input data in the approach of JPEG-B * Parameters: [in] PGRasterCompressionType type * [in] const char *in (in bits) * [in] const in sizeIn * [out] char **out, * [out] int *sizeOut (in bits) * [return] bool (true=succesful, false=failed) * Warning: memory will be allocated within the functions, but need to * be freed outside the function. */ bool compressJPEGB(const char *in, char **out, const int sizeIn, int *sizeOut); /* * Name: compressJPEG-F3 * Function: Compress the input data in the approach of JPEG-F3 * Parameters: [in] PGRasterCompressionType type * [in] const char *in (in bits) * [in] const in sizeIn * [out] char **out, * [out] int *sizeOut (in bits) * [return] bool (true=succesful, false=failed) * Warning: memory will be allocated within the functions, but need to * be freed outside the function. */ bool compressJPEGF3(const char *in, char **out, const int sizeIn, int *sizeOut); /* * Name: compressJPEG-F4 * Function: Compress the input data in the approach of JPEG-F3 * Parameters: [in] PGRasterCompressionType type * [in] const char *in (in bits) * [in] const in sizeIn * [out] char **out, * [out] int *sizeOut (in bits) * [return] bool (true=succesful, false=failed) * Warning: memory will be allocated within the functions, but need to * be freed outside the function. */ bool compressJPEGF4(const char *in, char **out, const int sizeIn, int *sizeOut); /* * Name: decompress * Function: Compress the input data in the approach that specified by * type paramater. * Parameters: [in] PGRasterCompressionType type * [in] const char *in (in bits) * [in] const in sizeIn * [out] char **out, * [out] int *sizeOut (in bits) * [return] bool (true=succesful, false=failed) * Warning: memory will be allocated within the functions, but need to * be freed outside the function. */ bool decompress(PGRasterCompressionType type, const char *in, char **out, const int sizeIn, int *sizeOut); /* * Name: decompressLZW * Function: DeCompress the input data in the approach of LZW * Parameters: [in] PGRasterCompressionType type * [in] const char *in (in bits) * [in] const in sizeIn * [out] char **out, * [out] int *sizeOut (in bits) * [return] bool (true=succesful, false=failed) * Warning: memory will be allocated within the functions, but need to * be freed outside the function. */ bool decompressLZW(const char *in, char **out, const int sizeIn, int *sizeOut); /* * Name: decompressJPEG-B * Function: DECompress the input data in the approach of JPEG-B * Parameters: [in] PGRasterCompressionType type * [in] const char *in (in bits) * [in] const in sizeIn * [out] char **out, * [out] int *sizeOut (in bits) * [return] bool (true=succesful, false=failed) * Warning: memory will be allocated within the functions, but need to * be freed outside the function. */ bool decompressJPEGB(const char *in, char **out, const int sizeIn, int *sizeOut); /* * Name: decompressJPEG-F3 * Function: DeCompress the input data in the approach of JPEG-F3 * Parameters: [in] PGRasterCompressionType type * [in] const char *in (in bits) * [in] const in sizeIn * [out] char **out, * [out] int *sizeOut (in bits) * [return] bool (true=succesful, false=failed) * Warning: memory will be allocated within the functions, but need to * be freed outside the function. */ bool decompressJPEGF3(const char *in, char **out, const int sizeIn, int *sizeOut); /* * Name: decompressJPEG-F4 * Function: DeCompress the input data in the approach of JPEG-F3 * Parameters: [in] PGRasterCompressionType type * [in] const char *in (in bits) * [in] const in sizeIn * [out] char **out, * [out] int *sizeOut (in bits) * [return] bool (true=succesful, false=failed) * Warning: memory will be allocated within the functions, but need to * be freed outside the function. */ bool decompressJPEGF4(const char *in, char **out, const int sizeIn, int *sizeOut); #endif