-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCubelet.java
More file actions
40 lines (32 loc) · 968 Bytes
/
Cubelet.java
File metadata and controls
40 lines (32 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/** Encapsulate one cubelet.
*/
public class Cubelet {
public int width, height, depth;
public int xOffset, yOffset, zOffset;
public enum DataType {UINT8, FLOAT32, INT32};
public DataType datatype;
public int maxPossibleValue;
public long dataFileOffset;
public enum CompressionAlg {NONE, ZLIB, WAVELET};
public CompressionAlg compressionAlg;
// These correspond to the setting of 'datatype'.
// For example, if datatype==UINT8, the data is assumed
// to be in 'byteData', and 'floatData' is ignored.
public byte[] byteData;
public float[] floatData;
public int[] intData;
public void setSize(int w, int h, int d) {
width = w;
height = h;
depth = d;
}
public void setOffset(int x, int y, int z) {
xOffset = x;
yOffset = y;
zOffset = z;
}
public String toString() {
return "Cubelet " + width + "x" + height + "x" + depth +
", offset " + xOffset + "," + yOffset + "," + zOffset;
}
}