Xmipp  v3.23.11-Nereus
xmipp_datatype.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Authors: Joaquin Oton (joton@cnb.csic.es)
3  *
4  *
5  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  * 02111-1307 USA
21  *
22  * All comments concerning this program package may be sent to the
23  * e-mail address 'xmipp@cnb.csic.es'
24  ***************************************************************************/
25 
26 #ifndef CORE_DATATYPE_H_
27 #define CORE_DATATYPE_H_
28 
29 #include <string>
30 
38 typedef enum
39 {
40  DT_Default = -1, // For writing purposes
41  DT_Unknown = 0, // Undefined data type
42  DT_UChar = 1, // Unsigned character or byte type
43  DT_SChar = 2, // Signed character (for CCP4)
44  DT_UShort = 3, // Unsigned integer (2-byte)
45  DT_Short = 4, // Signed integer (2-byte)
46  DT_UInt = 5, // Unsigned integer (4-byte)
47  DT_Int = 6, // Signed integer (4-byte)
48  DT_ULong = 7, // Unsigned integer (4 or 8 byte, depending on system)
49  DT_Long = 8, // Signed integer (4 or 8 byte, depending on system)
50  DT_Float = 9, // Floating point (4-byte)
51  DT_Double = 10, // DT_Double precision floating point (8-byte)
52  DT_CShort = 11, // Complex two-byte integer (4-byte)
53  DT_CInt = 12, // Complex integer (8-byte)
54  DT_CFloat = 13, // Complex floating point (8-byte)
55  DT_CDouble = 14, // Complex floating point (16-byte)
56  DT_Bool = 15, // Boolean (1-byte?)
57  DT_UHalfByte = 16, // For 4-bit format (e.g. mrc 4bit file)
58  DT_HalfFloat = 17, // Half precision floating point (2-byte)
59  DT_LastEntry = 18 // This must be the last entry
60 } DataType;
61 
62 
64 size_t gettypesize(DataType type);
65 
67 DataType str2Datatype(const std::string & str);
68 
70 std::string datatype2Str(DataType datatype);
71 
73 std::string datatype2StrLong(DataType datatype);
74 
76 #endif /* DATATYPE_H_ */
std::string datatype2Str(DataType datatype)
viol type
DataType
std::string datatype2StrLong(DataType datatype)
DataType str2Datatype(const std::string &str)
size_t gettypesize(DataType type)
Returns memory size of datatype.