X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=include%2Farray2dfile.h;h=9af82a70d8c7949f8c7310d65e8cc5dc4fda7b86;hb=01ee1e0085970643368d65c38b09008927e24cd5;hp=da4671e859517b754fba299805a1cb4a3faf6013;hpb=2f3d6e2580db607105bb072b13e4aff453ae4495;p=ctsim.git diff --git a/include/array2dfile.h b/include/array2dfile.h index da4671e..9af82a7 100644 --- a/include/array2dfile.h +++ b/include/array2dfile.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: array2dfile.h,v 1.1 2000/06/26 21:15:24 kevin Exp $ +** $Id: array2dfile.h,v 1.8 2000/12/04 04:15:48 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -28,9 +28,12 @@ #ifndef ARRAY2DFILE_H #define ARRAY2DFILE_H +#ifndef MSVC +#include +#endif + #include #include -#include #include #include #include @@ -44,9 +47,11 @@ using namespace std; class Array2dFileLabel { public: - static const int L_EMPTY = 0; - static const int L_HISTORY = 1; - static const int L_USER = 2; + enum { + L_EMPTY = 0, + L_HISTORY = 1, + L_USER = 2, + }; Array2dFileLabel(); @@ -62,6 +67,12 @@ public: kfloat64 getCalcTime (void) const { return m_calcTime; } + void setCalcTime (kfloat64 calcTime) + { m_calcTime = calcTime; } + + void setLabelType (int labelType) + { m_labelType = labelType; } + int getLabelType (void) const { return m_labelType; } @@ -77,9 +88,11 @@ public: const string& getDateString () const; - // Array2dFileLabel (const Array2dFileLabel&); + void print (ostream& os) const; + + Array2dFileLabel (const Array2dFileLabel& rhs); - // Array2dFileLabel& operator= (const Array2dFileLabel&); + Array2dFileLabel& operator= (const Array2dFileLabel& rhs); private: void init (void); @@ -101,15 +114,17 @@ private: class Array2dFile { public: - static const int PIXEL_INVALID = 0; - static const int PIXEL_INT8 = 1; - static const int PIXEL_UINT8 = 2; - static const int PIXEL_INT16 = 3; - static const int PIXEL_UINT16 = 4; - static const int PIXEL_INT32 = 5; - static const int PIXEL_UINT32 = 6; - static const int PIXEL_FLOAT32 = 7; - static const int PIXEL_FLOAT64 = 8; + enum { + PIXEL_INVALID = 0, + PIXEL_INT8 = 1, + PIXEL_UINT8 = 2, + PIXEL_INT16 = 3, + PIXEL_UINT16 = 4, + PIXEL_INT32 = 5, + PIXEL_UINT32 = 6, + PIXEL_FLOAT32 = 7, + PIXEL_FLOAT64 = 8, + }; Array2dFile (int nx, int ny, int pixelSize, int pixelFormat = PIXEL_INVALID); Array2dFile (void); @@ -156,8 +171,12 @@ public: bool fileRead (const char* const filename); + bool fileRead (const string& filename); + bool fileWrite (const char* const filename); + bool fileWrite (const string& filename); + const string& getFilename (void) const { return m_filename; } @@ -169,7 +188,7 @@ public: protected: typedef vector labelContainer; - static const kuint16 m_signature = ('I'*256+'F'); + static const kuint16 m_signature; kuint16 m_headersize; string m_filename;