65 lines
1.7 KiB
JavaScript
65 lines
1.7 KiB
JavaScript
// Metro module 4819 (f4820).
|
|
import Module4807 from "./Module4807";
|
|
let c2961_2 = {
|
|
1: 1,
|
|
2: 1,
|
|
3: 2,
|
|
4: 4,
|
|
5: 8,
|
|
7: 1,
|
|
9: 4,
|
|
10: 8,
|
|
13: 4
|
|
};
|
|
let c2961_3 = {
|
|
BYTE: 1,
|
|
ASCII: 2,
|
|
SHORT: 3,
|
|
LONG: 4,
|
|
RATIONAL: 5,
|
|
UNDEFINED: 7,
|
|
SLONG: 9,
|
|
SRATIONAL: 10,
|
|
IFD: 13
|
|
};
|
|
export default {
|
|
getAsciiValue: function getAsciiValue(a0) {
|
|
return a0.map((item) => String.fromCharCode(item));
|
|
},
|
|
getByteAt: function getByteAt(a0, a1) {
|
|
return a0.getUint8(a1);
|
|
},
|
|
getAsciiAt: function getAsciiAt(a0, a1) {
|
|
return a0.getUint8(a1);
|
|
},
|
|
getShortAt: function getShortAt(a0, a1, a2) {
|
|
return a0.getUint16(a1, a2 === Module4807.LITTLE_ENDIAN);
|
|
},
|
|
getLongAt: function getLongAt(a0, a1, a2) {
|
|
return a0.getUint32(a1, a2 === Module4807.LITTLE_ENDIAN);
|
|
},
|
|
getRationalAt: function getRationalAt(a0, a1, a2) {
|
|
return [a0.getUint32(a1, a2 === Module4807.LITTLE_ENDIAN), a0.getUint32(a1 + 4, a2 === Module4807.LITTLE_ENDIAN)];
|
|
},
|
|
getUndefinedAt: function getUndefinedAt(a0, a1) {
|
|
return a0.getUint8(a1);
|
|
},
|
|
getSlongAt: function getSlongAt(a0, a1, a2) {
|
|
return a0.getInt32(a1, a2 === Module4807.LITTLE_ENDIAN);
|
|
},
|
|
getSrationalAt: function getSrationalAt(a0, a1, a2) {
|
|
return [a0.getInt32(a1, a2 === Module4807.LITTLE_ENDIAN), a0.getInt32(a1 + 4, a2 === Module4807.LITTLE_ENDIAN)];
|
|
},
|
|
getIfdPointerAt: function getIfdPointerAt(a0, a1, a2) {
|
|
return a0.getUint32(a1, a2 === Module4807.LITTLE_ENDIAN);
|
|
},
|
|
typeSizes: c2961_2,
|
|
tagTypes: c2961_3,
|
|
getTypeSize: function getTypeSize(a0) {
|
|
if (c2961_3[a0] === void 0) {
|
|
throw new Error("No such type found.");
|
|
}
|
|
return c2961_2[c2961_3[a0]];
|
|
}
|
|
};
|