# gdcmPNMCodec.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program: GDCM (Grassroots DICOM). A DICOM library
    00004   Module:  $URL$
    00005
    00006   Copyright (c) 2006-2010 Mathieu Malaterre
    00007   All rights reserved.
    00008   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
    00009
    00010      This software is distributed WITHOUT ANY WARRANTY; without even
    00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00012      PURPOSE.  See the above copyright notice for more information.
    00013
    00014 =========================================================================*/
    00015 #ifndef GDCMPNMCODEC_H
    00016 #define GDCMPNMCODEC_H
    00017
    00018 #include "gdcmImageCodec.h"
    00019
    00020 namespace gdcm
    00021 {
    00022
    00030 class GDCM_EXPORT PNMCodec : public ImageCodec
    00031 {
    00032 public:
    00033   PNMCodec();
    00034   ~PNMCodec();
    00035   bool CanDecode(TransferSyntax const &ts) const;
    00036   bool CanCode(TransferSyntax const &ts) const;
    00037
    00038   unsigned long GetBufferLength() const { return BufferLength; }
    00039   void SetBufferLength(unsigned long l) { BufferLength = l; }
    00040
    00041   bool GetHeaderInfo(std::istream &is, TransferSyntax &ts);
    00042
    00043   bool Read(const char *filename, DataElement &out) const;
    00044   bool Write(const char *filename, const DataElement &out) const;
    00045   //bool Write(const char *filename);
    00046 private:
    00047   unsigned long BufferLength;
    00048 };
    00049
    00050 } // end namespace gdcm
    00051
    00052 #endif //GDCMPNMCODEC_H