| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeDecoderFile.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00026 #ifndef  __TERRALIB_INTERNAL_DECODERFILE_H
    00027 #define  __TERRALIB_INTERNAL_DECODERFILE_H
    00028
    00029 #ifdef WIN32
    00030 #include "TeDecoderVirtualMemory.h"
    00031 #include <windows.h>
    00032 #include <winbase.h>
    00033
    00035 /*         \note This implementation is valid only for the windows platform
    00036 */
    00037 class TL_DLL TeDecoderFile : public TeDecoderVirtualMemory
    00038 {
    00039 public:
    00041            TeDecoderFile ( const TeRasterParams& );
    00042
    00044            ~TeDecoderFile ();
    00045
    00047            void init  ();
    00048
    00050            bool create           ();
    00051
    00053            bool clear ();
    00054
    00055 protected:
    00056            bool       getRasterBlock(const TeBlockIndex& index, void *buf);
    00057            bool       putRasterBlock(const TeBlockIndex& index, void *buf, long bsize);
    00058            TeBlockIndex blockIndex(int col, int lin, int band);
    00059            void blockIndexPos(const TeBlockIndex& index, int& ulCol, int& ulLin, int& band);
    00060
    00061 private:
    00062
    00063            unsigned long         dataInitPos_;
    00064            HANDLE  m_hFile;                            // Handle to file we're currently zapping
    00065            LPVOID  m_buffer;                           // Pointer to view of file mapped to memory
    00066            DWORD      m_dwSize;                        // File size in bytes
    00067            DWORD      m_dwPosition;                    // Current file pointer position
    00068            DWORD      m_dwWordSize;                    // word size in bytes
    00069 };
    00070
    00072 class TL_DLL TeDecoderFileFactory : public TeDecoderFactory
    00073 {
    00074 public:
    00075
    00076            TeDecoderFileFactory(const string& name) : TeDecoderFactory(name) {}
    00077
    00079            virtual TeDecoder* build (const TeRasterParams& arg)
    00080            {  return new TeDecoderFile(arg); }
    00081 };
    00082
    00083 #endif
    00084 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines