#include <df3io.h>
Inheritance diagram for EMAN::Df3IO:
Public Member Functions | |
Df3IO (const string &filename, IOMode rw_mode=READ_ONLY) | |
~Df3IO () | |
Static Public Member Functions | |
static bool | is_valid (const void *first_block, off_t file_size=0) |
Public Attributes | |
DEFINE_IMAGEIO_FUNC | |
Private Attributes | |
unsigned short | nx |
unsigned short | ny |
unsigned short | nz |
string | filename |
IOMode | rw_mode |
FILE * | df3file |
bool | initialized |
bool | is_new_file |
Definition at line 58 of file df3io.h.
Df3IO::Df3IO | ( | const string & | filename, | |
IOMode | rw_mode = READ_ONLY | |||
) | [explicit] |
Definition at line 44 of file df3io.cpp.
00045 : filename(df3_filename), rw_mode(rw), df3file(0), 00046 initialized(false), is_new_file(false) 00047 { 00048 }
Df3IO::~Df3IO | ( | ) |
bool Df3IO::is_valid | ( | const void * | first_block, | |
off_t | file_size = 0 | |||
) | [static] |
Definition at line 263 of file df3io.cpp.
References ENTERFUNC, EXITFUNC, EMAN::ByteOrder::is_data_big_endian(), ny, and nz.
Referenced by EMAN::EMUtil::get_image_type().
00264 { 00265 ENTERFUNC; 00266 00267 if (!first_block) { 00268 return false; 00269 } 00270 00271 const unsigned short *data = static_cast < const unsigned short *>(first_block); 00272 unsigned short nx = data[0]; 00273 unsigned short ny = data[1]; 00274 unsigned short nz = data[2]; 00275 00276 if(ByteOrder::is_data_big_endian(&nx) && ByteOrder::is_data_big_endian(&ny) && ByteOrder::is_data_big_endian(&nz)) { 00277 return true; 00278 } 00279 00280 EXITFUNC; 00281 return false; 00282 }
FILE* EMAN::Df3IO::df3file [private] |
string EMAN::Df3IO::filename [private] |
bool EMAN::Df3IO::initialized [private] |
bool EMAN::Df3IO::is_new_file [private] |
unsigned short EMAN::Df3IO::nx [private] |
unsigned short EMAN::Df3IO::ny [private] |
unsigned short EMAN::Df3IO::nz [private] |
IOMode EMAN::Df3IO::rw_mode [private] |