EMAN2
Classes | Functions
EMAN::GatanDM4 Namespace Reference

Classes

class  DataType
 
class  TagData
 
class  TagEntry
 
class  TagGroup
 
class  TagTable
 

Functions

int to_em_datatype (int gatan_datatype)
 
const char * to_str (GatanDM4::TagData::Type type)
 
const char * to_str (GatanDM4::TagEntry::EntryType type)
 
const char * to_str (GatanDM4::DataType::GatanDataType type)
 

Function Documentation

◆ to_em_datatype()

int EMAN::GatanDM4::to_em_datatype ( int  gatan_datatype)

Definition at line 1051 of file dm4io.cpp.

1052{
1053 DataType::GatanDataType type = static_cast < DataType::GatanDataType > (gatan_datatype);
1054 int t = 0;
1055
1056 switch (type) {
1057 case GatanDM4::DataType::SIGNED_INT8_DATA:
1058 t = EMUtil::EM_CHAR;
1059 break;
1060 case GatanDM4::DataType::UNSIGNED_INT8_DATA:
1061 t = EMUtil::EM_UCHAR;
1062 break;
1063 case GatanDM4::DataType::SIGNED_INT16_DATA:
1064 t = EMUtil::EM_SHORT;
1065 break;
1066 case GatanDM4::DataType::UNSIGNED_INT16_DATA:
1067 t = EMUtil::EM_USHORT;
1068 break;
1069 case GatanDM4::DataType::SIGNED_INT32_DATA:
1070 t = EMUtil::EM_INT;
1071 break;
1072 case GatanDM4::DataType::UNSIGNED_INT32_DATA:
1073 t = EMUtil::EM_UINT;
1074 break;
1075 default:
1076 t = EMUtil::EM_UNKNOWN;
1077 }
1078
1079 return t;
1080}

References EMAN::EMUtil::EM_CHAR, EMAN::EMUtil::EM_INT, EMAN::EMUtil::EM_SHORT, EMAN::EMUtil::EM_UCHAR, EMAN::EMUtil::EM_UINT, EMAN::EMUtil::EM_UNKNOWN, EMAN::EMUtil::EM_USHORT, EMAN::GatanDM4::DataType::SIGNED_INT16_DATA, EMAN::GatanDM4::DataType::SIGNED_INT32_DATA, EMAN::GatanDM4::DataType::SIGNED_INT8_DATA, EMAN::GatanDM4::DataType::UNSIGNED_INT16_DATA, EMAN::GatanDM4::DataType::UNSIGNED_INT32_DATA, and EMAN::GatanDM4::DataType::UNSIGNED_INT8_DATA.

◆ to_str() [1/3]

const char * EMAN::GatanDM4::to_str ( GatanDM4::DataType::GatanDataType  type)

Definition at line 1148 of file dm4io.cpp.

1149{
1150 switch (type) {
1151 case GatanDM4::DataType::SIGNED_INT16_DATA:
1152 return "SIGNED_INT16_DATA";
1153 case GatanDM4::DataType::REAL4_DATA:
1154 return "REAL4_DATA";
1155 case GatanDM4::DataType::COMPLEX8_DATA:
1156 return "COMPLEX8_DATA";
1157 case GatanDM4::DataType::OBSELETE_DATA:
1158 return "OBSELETE_DATA";
1159 case GatanDM4::DataType::PACKED_DATA:
1160 return "PACKED_DATA";
1161 case GatanDM4::DataType::UNSIGNED_INT8_DATA:
1162 return "UNSIGNED_INT8_DATA";
1163 case GatanDM4::DataType::SIGNED_INT32_DATA:
1164 return "SIGNED_INT32_DATA";
1165 case GatanDM4::DataType::RGB_DATA:
1166 return "RGB_DATA";
1167 case GatanDM4::DataType::SIGNED_INT8_DATA:
1168 return "SIGNED_INT8_DATA";
1169 case GatanDM4::DataType::UNSIGNED_INT16_DATA:
1170 return "UNSIGNED_INT16_DATA";
1171 case GatanDM4::DataType::UNSIGNED_INT32_DATA:
1172 return "UNSIGNED_INT32_DATA";
1173 case GatanDM4::DataType::REAL8_DATA:
1174 return "REAL8_DATA";
1175 case GatanDM4::DataType::COMPLEX16_DATA:
1176 return "COMPLEX16_DATA";
1177 case GatanDM4::DataType::BINARY_DATA:
1178 return "BINARY_DATA";
1179 case GatanDM4::DataType::RGB_UINT8_0_DATA:
1180 return "RGB_UINT8_0_DATA";
1181 case GatanDM4::DataType::RGB_UINT8_1_DATA:
1182 return "RGB_UINT8_1_DATA";
1183 case GatanDM4::DataType::RGB_UINT16_DATA:
1184 return "RGB_UINT16_DATA";
1185 case GatanDM4::DataType::RGB_FLOAT32_DATA:
1186 return "RGB_FLOAT32_DATA";
1187 case GatanDM4::DataType::RGB_FLOAT64_DATA:
1188 return "RGB_FLOAT64_DATA";
1189 case GatanDM4::DataType::RGBA_UINT8_0_DATA:
1190 return "RGBA_UINT8_0_DATA";
1191 case GatanDM4::DataType::RGBA_UINT8_1_DATA:
1192 return "RGBA_UINT8_1_DATA";
1193 case GatanDM4::DataType::RGBA_UINT8_2_DATA:
1194 return "RGBA_UINT8_2_DATA";
1195 case GatanDM4::DataType::RGBA_UINT8_3_DATA:
1196 return "RGBA_UINT8_3_DATA";
1197 case GatanDM4::DataType::RGBA_UINT16_DATA:
1198 return "RGBA_UINT16_DATA";
1199 case GatanDM4::DataType::RGBA_FLOAT32_DATA:
1200 return "RGBA_FLOAT32_DATA";
1201 case GatanDM4::DataType::RGBA_FLOAT64_DATA:
1202 return "RGBA_FLOAT64_DATA";
1203 case GatanDM4::DataType::POINT2_SINT16_0_DATA:
1204 return "POINT2_SINT16_0_DATA";
1205 case GatanDM4::DataType::POINT2_SINT16_1_DATA:
1206 return "POINT2_SINT16_1_DATA";
1207 case GatanDM4::DataType::POINT2_SINT32_0_DATA:
1208 return "POINT2_SINT32_0_DATA";
1209 case GatanDM4::DataType::POINT2_FLOAT32_0_DATA:
1210 return "POINT2_FLOAT32_0_DATA";
1211 case GatanDM4::DataType::RECT_SINT16_1_DATA:
1212 return "RECT_SINT16_1_DATA";
1213 case GatanDM4::DataType::RECT_SINT32_1_DATA:
1214 return "RECT_SINT32_1_DATA";
1215 case GatanDM4::DataType::RECT_FLOAT32_1_DATA:
1216 return "RECT_FLOAT32_1_DATA";
1217 case GatanDM4::DataType::RECT_FLOAT32_0_DATA:
1218 return "RECT_FLOAT32_0_DATA";
1219 case GatanDM4::DataType::SIGNED_INT64_DATA:
1220 return "SIGNED_INT64_DATA";
1221 case GatanDM4::DataType::UNSIGNED_INT64_DATA:
1222 return "UNSIGNED_INT64_DATA";
1223 default:
1224 break;
1225 }
1226 return "Unknown Type";
1227}

References EMAN::GatanDM4::DataType::BINARY_DATA, EMAN::GatanDM4::DataType::COMPLEX16_DATA, EMAN::GatanDM4::DataType::COMPLEX8_DATA, EMAN::GatanDM4::DataType::OBSELETE_DATA, EMAN::GatanDM4::DataType::PACKED_DATA, EMAN::GatanDM4::DataType::POINT2_FLOAT32_0_DATA, EMAN::GatanDM4::DataType::POINT2_SINT16_0_DATA, EMAN::GatanDM4::DataType::POINT2_SINT16_1_DATA, EMAN::GatanDM4::DataType::POINT2_SINT32_0_DATA, EMAN::GatanDM4::DataType::REAL4_DATA, EMAN::GatanDM4::DataType::REAL8_DATA, EMAN::GatanDM4::DataType::RECT_FLOAT32_0_DATA, EMAN::GatanDM4::DataType::RECT_FLOAT32_1_DATA, EMAN::GatanDM4::DataType::RECT_SINT16_1_DATA, EMAN::GatanDM4::DataType::RECT_SINT32_1_DATA, EMAN::GatanDM4::DataType::RGB_DATA, EMAN::GatanDM4::DataType::RGB_FLOAT32_DATA, EMAN::GatanDM4::DataType::RGB_FLOAT64_DATA, EMAN::GatanDM4::DataType::RGB_UINT16_DATA, EMAN::GatanDM4::DataType::RGB_UINT8_0_DATA, EMAN::GatanDM4::DataType::RGB_UINT8_1_DATA, EMAN::GatanDM4::DataType::RGBA_FLOAT32_DATA, EMAN::GatanDM4::DataType::RGBA_FLOAT64_DATA, EMAN::GatanDM4::DataType::RGBA_UINT16_DATA, EMAN::GatanDM4::DataType::RGBA_UINT8_0_DATA, EMAN::GatanDM4::DataType::RGBA_UINT8_1_DATA, EMAN::GatanDM4::DataType::RGBA_UINT8_2_DATA, EMAN::GatanDM4::DataType::RGBA_UINT8_3_DATA, EMAN::GatanDM4::DataType::SIGNED_INT16_DATA, EMAN::GatanDM4::DataType::SIGNED_INT32_DATA, EMAN::GatanDM4::DataType::SIGNED_INT64_DATA, EMAN::GatanDM4::DataType::SIGNED_INT8_DATA, EMAN::GatanDM4::DataType::UNSIGNED_INT16_DATA, EMAN::GatanDM4::DataType::UNSIGNED_INT32_DATA, EMAN::GatanDM4::DataType::UNSIGNED_INT64_DATA, and EMAN::GatanDM4::DataType::UNSIGNED_INT8_DATA.

◆ to_str() [2/3]

const char * EMAN::GatanDM4::to_str ( GatanDM4::TagData::Type  type)

Definition at line 1083 of file dm4io.cpp.

1084{
1085 const char *str = "unknown";
1086
1087 switch (type) {
1088 case TagData::SHORT:
1089 str = "short";
1090 break;
1091 case TagData::INT:
1092 str = "int";
1093 break;
1094 case TagData::USHORT:
1095 str = "unsigned short";
1096 break;
1097 case TagData::UINT:
1098 str = "unsigned int";
1099 break;
1100 case TagData::FLOAT:
1101 str = "float";
1102 break;
1103 case TagData::DOUBLE:
1104 str = "double";
1105 break;
1106 case TagData::BOOLEAN:
1107 str = "boolean";
1108 break;
1109 case TagData::CHAR:
1110 str = "char";
1111 break;
1112 case TagData::OCTET:
1113 str = "octet";
1114 break;
1115 case TagData::STRUCT:
1116 str = "struct";
1117 break;
1118 case TagData::STRING:
1119 str = "string";
1120 break;
1121 case TagData::ARRAY:
1122 str = "array";
1123 break;
1124 default:
1125 str = "unknown";
1126 }
1127 return str;
1128}

Referenced by EMAN::GatanDM4::TagData::read_any(), EMAN::GatanDM4::TagData::read_array_types(), EMAN::GatanDM4::TagData::read_struct_types(), and EMAN::GatanDM4::TagEntry::read_tag_entry().

◆ to_str() [3/3]

const char * EMAN::GatanDM4::to_str ( GatanDM4::TagEntry::EntryType  type)

Definition at line 1130 of file dm4io.cpp.

1131{
1132 const char *str = "unknown";
1133
1134 switch (type) {
1135 case TagEntry::GROUP_TAG:
1136 str = "Group";
1137 break;
1138 case TagEntry::DATA_TAG:
1139 str = "Data";
1140 break;
1141 default:
1142 str = "unknown";
1143 }
1144 return str;
1145}