[postgis-commits] svn - r2661 - branches/gSoC2007_raster/pgraster
postgis-commits at postgis.refractions.net
postgis-commits at postgis.refractions.net
Sun Jul 15 15:32:45 PDT 2007
Author: xingkth
Date: 2007-07-15 15:32:44 -0700 (Sun, 15 Jul 2007)
New Revision: 2661
Added:
branches/gSoC2007_raster/pgraster/pgraster_compression.c
branches/gSoC2007_raster/pgraster/pgraster_compression.h
branches/gSoC2007_raster/pgraster/pgraster_const.h
Log:
Xing Lin: PGRaster Loaders Codes - Function & Type Declaration (GoogleSoC2007)
Added: branches/gSoC2007_raster/pgraster/pgraster_compression.c
===================================================================
--- branches/gSoC2007_raster/pgraster/pgraster_compression.c 2007-07-15 22:31:30 UTC (rev 2660)
+++ branches/gSoC2007_raster/pgraster/pgraster_compression.c 2007-07-15 22:32:44 UTC (rev 2661)
@@ -0,0 +1,202 @@
+/**********************************************************************
+ * $Id: pgraster_compression.c 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.h
+ *
+ * Author: Xing Lin, solo.lin at gmail.com
+ *
+ * Create Date: 2007-07-15
+ *
+ * Description: This file will include the implementation of
+ * data compression functions that will be used
+ * in PGRaster extension.
+ *
+ * Original Author: Xing Lin, solo.lin at gmail.com
+ *
+ * Maintainer: Xing Lin, solo.lin at gmail.com
+ *
+ * Last Update: 2007-07-15
+ *
+ **********************************************************************/
+#include "pgraster_compression.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)
+{
+ return false;
+}
+
+/*
+ * 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)
+{
+ return false;
+}
+
+/*
+ * 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)
+{
+ return false;
+}
+
+/*
+ * 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)
+{
+ return false;
+}
+
+/*
+ * 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)
+{
+ return false;
+}
+
+/*
+ * 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)
+{
+ return false;
+}
+
+/*
+ * 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)
+{
+ return false;
+}
+
+/*
+ * 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)
+{
+ return false;
+}
+
+/*
+ * 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)
+{
+ return false;
+}
+
+/*
+ * 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)
+{
+ return false;
+}
Added: branches/gSoC2007_raster/pgraster/pgraster_compression.h
===================================================================
--- branches/gSoC2007_raster/pgraster/pgraster_compression.h 2007-07-15 22:31:30 UTC (rev 2660)
+++ branches/gSoC2007_raster/pgraster/pgraster_compression.h 2007-07-15 22:32:44 UTC (rev 2661)
@@ -0,0 +1,176 @@
+/**********************************************************************
+ * $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 at 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 at gmail.com
+ *
+ * Maintainer: Xing Lin, solo.lin at 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
Added: branches/gSoC2007_raster/pgraster/pgraster_const.h
===================================================================
--- branches/gSoC2007_raster/pgraster/pgraster_const.h 2007-07-15 22:31:30 UTC (rev 2660)
+++ branches/gSoC2007_raster/pgraster/pgraster_const.h 2007-07-15 22:32:44 UTC (rev 2661)
@@ -0,0 +1,95 @@
+/**********************************************************************
+ * $Id: pgraster_const.c 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_const.c
+ *
+ * Author: Xing Lin, solo.lin at gmail.com
+ *
+ * Create Date: 2007-07-15
+ *
+ * Description: This file will include the definition of const that
+ * will be used in the database to store PGRaster data.
+ *
+ * Original Author: Xing Lin, solo.lin at gmail.com
+ *
+ * Maintainer: Xing Lin, solo.lin at gmail.com
+ *
+ * Last Update: 2007-07-15
+ *
+ **********************************************************************/
+
+#ifndef _PGRASTER_CONST
+
+#define _PGRASTER_CONST 1
+
+/* DEFINITION OF BANDTYPE */
+typedef enum _BandType
+{
+ BT_UNKNOWN = -1, // UNKNOWN Band Type (uninitialized code)
+ BT_SINGLE = 0, // Single Band Type
+ BT_RGB = 1, // RGB Image Band Type
+ BT_RGBA = 2, // RGBA Image Band Type
+ BT_MULTI = 3, // Multi-spectral Band Type
+ BT_OTHERS = 4 // Other Band Type (error code)
+} PGRasterBandType;
+
+/* DEFINITION OF DATA TYPE */
+typedef enum _DataType
+{
+ DT_UNKNOWN = -1, // Unknown Data Type
+ DT_1BIT = 0, // 1 Bit Boolean Data Type
+ DT_2BIT = 1, // 2 Bit Unsigned Integer Data Type
+ DT_4BIT = 2, // 4 Bit Unsigned Integer Data Type
+ DT_8BIT_U = 3, // 8 Bit Unsigned Integer Data Type
+ DT_8BIT_S = 4, // 8 Bit Signed Integer Data Type
+ DT_16BIT_U = 5, // 16 Bit Unsigned Integer Data Type
+ DT_16BIT_S = 6, // 16 Bit Signed Integer Data Type
+ DT_32BIT_U = 7, // 32 Bit Unsigned Integer Data Type
+ DT_32BIT_S = 8, // 32 Bit Signed Integer Data Type
+ DT_24BIT_RGB = 9, // 24 Bit Image Color Data Type (RGB)
+ DT_32BIT_RGBA = 10, // 32 Bit Image Color Data Type (RGBA)
+ DT_32BIT_REAL = 11, // 32 BIT Real/Single Floating Point Data Type
+ DT_64BIT_REAL = 12 // 64 BIT Real/Double Floating Point Data Type
+}PGRasterDataType;
+
+/* DEFINITION OF VALUE TYPE */
+typedef enum _ValueType
+{
+ VT_UNKNOWN = -1, // Unknown Value Type
+ VT_NOMINAL = 0, // Nominal Value Type
+ VT_ORDINAL = 1, // Ordinal Value Type
+ VT_INTERVAL = 2, // Interval Value Type
+ VT_RATIO = 3, // Ratio Value Type
+ VT_IMAGE = 4 // Image Value Type
+}PGRasterValueType;
+
+/* DEFINITION OF BANDINTERLEAVING TYPE*/
+typedef enum _BandInterLeavingType
+{
+ BI_UNKNOWN = -1, // Unknown Band Interleaving Type
+ BI_BSQ = 0, // BSQ Band Interleaving Type
+ BI_BIL = 1, // BIL Band Interleaving Type
+ BI_BIP = 2 // BIP Band Interleaving Type
+}PGBandInterleavingType;
+
+/* DEFINITION OF COMPRESSION TYPE */
+typedef enum _CompressionType
+{
+ CT_UNKNOWN = -1, // Unknow Data Compression Type
+ CT_JPEG_B = 0, // JPEG-B Data Compression Type
+ CT_JPEG_F3 = 1, // JPEG-F3 Data Compression Type (JPEG Image compression)
+ CT_JPEG_F4 = 2, // JPEG-F4 Data Compression Type
+ CT_LZW = 3, // LZW/LZ77 Lossless Compressio Type
+ CT_NONE = 4 // No-Compression/Flat Data
+}PGRasterCompressionType;
+
+#endif
More information about the postgis-commits
mailing list