-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmx4.cpp
More file actions
26 lines (23 loc) · 1.19 KB
/
mx4.cpp
File metadata and controls
26 lines (23 loc) · 1.19 KB
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
#include "sap.h"
#include "mx4.h"
// GetMX4MetadataFromBuffer returns a struct of MX4Metadata that has been parsed from the buffer
// of data passed into this function. Also pass in the width of the image area of the buffer, along with the
// line number (1-indexed) of the buffer for which you want the metadata.
MX4MetadataWrapper GetMX4MetadataFromBuffer(SapBufferWrapper buf, int width, int line) {
int numRead;
MX4MetadataWrapper metadata = new MX4Metadata;
buf->ReadLine(width, line-1, width-1+MX4MetadataSize, line-1, metadata, &numRead);
return metadata;
}
// GetMX4MetadataFromBufferWithIndex returns a struct of MX4Metadata that has been parsed from the indexed buffer
// of data passed into this function. Also pass in the width of the image area of the buffer, along with the
// line number (1-indexed) of the buffer for which you want the metadata.
MX4MetadataWrapper GetMX4MetadataFromBufferWithIndex(SapBufferWrapper buf, int index, int width, int line) {
int numRead;
MX4MetadataWrapper metadata = new MX4Metadata;
buf->ReadLine(index, width, line-1, width-1+MX4MetadataSize, line-1, metadata, &numRead);
return metadata;
}
void MX4Metadata_Close(MX4MetadataWrapper mta) {
delete mta;
}