libpcidsk

pcidsk_file.h

00001 /******************************************************************************
00002  *
00003  * Purpose: Declaration of the PCIDSKFile Interface
00004  * 
00005  ******************************************************************************
00006  * Copyright (c) 2009
00007  * PCI Geomatics, 50 West Wilmot Street, Richmond Hill, Ont, Canada
00008  *
00009  * Permission is hereby granted, free of charge, to any person obtaining a
00010  * copy of this software and associated documentation files (the "Software"),
00011  * to deal in the Software without restriction, including without limitation
00012  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00013  * and/or sell copies of the Software, and to permit persons to whom the
00014  * Software is furnished to do so, subject to the following conditions:
00015  *
00016  * The above copyright notice and this permission notice shall be included
00017  * in all copies or substantial portions of the Software.
00018  *
00019  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00020  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00021  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00022  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00023  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00024  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00025  * DEALINGS IN THE SOFTWARE.
00026  ****************************************************************************/
00027 #ifndef __INCLUDE_PCIDSK_FILE_H
00028 #define __INCLUDE_PCIDSK_FILE_H
00029 
00030 #include "pcidsk_segment.h"
00031 #include <string>
00032 #include <vector>
00033 
00034 namespace PCIDSK
00035 {
00036 /************************************************************************/
00037 /*                              PCIDSKFile                              */
00038 /************************************************************************/
00039 
00040     class PCIDSKChannel;
00041     class PCIDSKSegment;
00042     class PCIDSKInterfaces;
00043     class Mutex;
00044     
00046     class PCIDSK_DLL PCIDSKFile
00047     {
00048     public:
00049         virtual ~PCIDSKFile() {};
00050 
00051         virtual PCIDSKInterfaces *GetInterfaces() = 0;
00052 
00053         virtual PCIDSKChannel  *GetChannel( int band ) = 0;
00054         virtual PCIDSKSegment  *GetSegment( int segment ) = 0;
00055         virtual std::vector<PCIDSKSegment *> GetSegments() = 0;
00056 
00057         virtual PCIDSK::PCIDSKSegment *GetSegment( int type, 
00058             std::string name,
00059             int previous = 0 ) = 0;
00060 
00061         virtual int GetWidth() const = 0;
00062         virtual int GetHeight() const = 0;
00063         virtual int GetChannels() const = 0;
00064         virtual std::string GetInterleaving() const = 0;
00065         virtual bool GetUpdatable() const = 0;
00066         virtual uint64 GetFileSize() const = 0; 
00067 
00068         virtual int  CreateSegment( std::string name, std::string description,
00069             eSegType seg_type, int data_blocks ) = 0;
00070         virtual void DeleteSegment( int segment ) = 0;
00071         virtual void CreateOverviews( int chan_count, int *chan_list, 
00072             int factor, std::string resampling ) = 0;
00073 
00074     // the following are only for pixel interleaved IO
00075         virtual int    GetPixelGroupSize() const = 0;
00076         virtual void *ReadAndLockBlock( int block_index, int xoff=-1, int xsize=-1) = 0;
00077         virtual void  UnlockBlock( bool mark_dirty = false ) = 0;
00078 
00079     // low level io, primarily internal.
00080         virtual void WriteToFile( const void *buffer, uint64 offset, uint64 size)=0;
00081         virtual void ReadFromFile( void *buffer, uint64 offset, uint64 size ) = 0;
00082 
00083         virtual void GetIODetails( void ***io_handle_pp, Mutex ***io_mutex_pp,
00084             std::string filename = "" ) = 0;
00085 
00086         virtual std::string GetMetadataValue( const std::string& key ) = 0;
00087         virtual void SetMetadataValue( const std::string& key, const std::string& value ) = 0;
00088         virtual std::vector<std::string> GetMetadataKeys() = 0;
00089 
00090         virtual void Synchronize() = 0;
00091     };
00092 } // end namespace PCIDSK
00093 
00094 #endif // __INCLUDE_PCIDSK_FILE_H

Generated for GDAL by doxygen 1.7.3.