Subclass of first part of header (subclass used for logical grouping of class member variables which map almost 1:1 to header structures transferred in binary form. More...
Inherits Cloneable.
Public Member Functions | |
void | setTotalLength (long lengthInBytes) |
Sets the totalLength member. More... | |
void | setTimeStamp (long time) |
Sets the timestamp member variables (UTC seconds and microseconds). More... | |
void | setStaticValues (int baseId, long specId, long version, String cameraPort) |
Public Attributes | |
int | baseTag = DEFAULT_BASE_TAG |
Magic ID in front of binary data block. More... | |
long | cameraPortId = DEFAULT_CAMERA_PORT_ID |
Unique ID that identifies one single location of image creation, usually named Image Source in VSV3. More... | |
long | versionTag = IMAGE_INITIAL_VERSION |
Defines the version of the IMAGE header. More... | |
long | totalLength |
Contains the whole length of the data block as it would be transferred bytewise on network level. More... | |
int | timestampSeconds |
Contains the time the image was originally taken at image source, UTC seconds part. More... | |
int | timestampMicroseconds |
Contains the time the image was originally taken at image source, microseconds offset to UTC time. More... | |
String | cameraPortName = DEFAULT_CAMERA_PORT_NAME |
< image timestamp (micro seconds) More... | |
Protected Member Functions | |
void | read (DataInputStream dis) throws IOException |
Reads the SourceHeader from the supplied DataInputStream . More... | |
void | write (DataOutputStream ds) throws IOException |
Subclass of first part of header (subclass used for logical grouping of class member variables which map almost 1:1 to header structures transferred in binary form.
|
protected |
Reads the SourceHeader
from the supplied DataInputStream
.
input |
|
IOException | if an error occurs during reading. |
References de.desy.tine.types.IMAGE.SourceHeader.baseTag, de.desy.tine.types.IMAGE.SourceHeader.cameraPortId, de.desy.tine.types.IMAGE.SourceHeader.cameraPortName, de.desy.tine.types.IMAGE.SourceHeader.timestampMicroseconds, de.desy.tine.types.IMAGE.SourceHeader.timestampSeconds, de.desy.tine.types.IMAGE.SourceHeader.totalLength, de.desy.tine.dataUtils.UnsignedUtils.toUnsignedInt(), and de.desy.tine.types.IMAGE.SourceHeader.versionTag.
void de.desy.tine.types.IMAGE.SourceHeader.setStaticValues | ( | int | baseId, |
long | specId, | ||
long | version, | ||
String | cameraPort | ||
) |
References de.desy.tine.types.IMAGE.SourceHeader.cameraPortName, and de.desy.tine.types.IMAGE.SourceHeader.versionTag.
void de.desy.tine.types.IMAGE.SourceHeader.setTimeStamp | ( | long | time | ) |
Sets the timestamp member variables (UTC seconds and microseconds).
This function never fails.
time | Contains UTC time*1000 plus fractional millisecond offset*1000. |
References de.desy.tine.types.IMAGE.SourceHeader.timestampMicroseconds, and de.desy.tine.types.IMAGE.SourceHeader.timestampSeconds.
void de.desy.tine.types.IMAGE.SourceHeader.setTotalLength | ( | long | lengthInBytes | ) |
Sets the totalLength member.
This function never fails.
lengthInBytes |
|
References de.desy.tine.types.IMAGE.SourceHeader.totalLength.
|
protected |
ds |
|
IOException |
References de.desy.tine.types.IMAGE.SourceHeader.baseTag, de.desy.tine.types.IMAGE.SourceHeader.cameraPortId, de.desy.tine.types.IMAGE.SourceHeader.cameraPortName, de.desy.tine.types.IMAGE.SourceHeader.timestampMicroseconds, de.desy.tine.types.IMAGE.SourceHeader.timestampSeconds, de.desy.tine.types.IMAGE.SourceHeader.totalLength, and de.desy.tine.types.IMAGE.SourceHeader.versionTag.
int de.desy.tine.types.IMAGE.SourceHeader.baseTag = DEFAULT_BASE_TAG |
Magic ID in front of binary data block.
Value is fixed to four character code 'VSV3' (little endian: 33565356 hex). VSV3 stands for VideoSystem Version 3.
In C/C++ world, member is an unsigned int32.
Referenced by de.desy.tine.types.IMAGE.SourceHeader.read(), and de.desy.tine.types.IMAGE.SourceHeader.write().
long de.desy.tine.types.IMAGE.SourceHeader.cameraPortId = DEFAULT_CAMERA_PORT_ID |
Unique ID that identifies one single location of image creation, usually named Image Source in VSV3.
There must not be two image sources sharing the same camera port Id. If cameraPortId is set to 0 it means that no camera port id is attached to the image buffer so Image Source (origin of image) is undefined.
In C/C++ world, member is an unsigned int32.
Referenced by de.desy.tine.types.IMAGE.SourceHeader.read(), and de.desy.tine.types.IMAGE.SourceHeader.write().
String de.desy.tine.types.IMAGE.SourceHeader.cameraPortName = DEFAULT_CAMERA_PORT_NAME |
< image timestamp (micro seconds)
A human-readable string giving imaginative representation of image source. Image source here does not only mean Image Source in VSv3 terms (position of image acquire location), but might also contain a string describing file name where the image was taken from (if loaded).
In C/C++ world, this header member is a 64 char array (64 bytes). It may not contain a null byte at the end, but 64 truly useful characters!
Referenced by de.desy.tine.types.IMAGE.SourceHeader.read(), de.desy.tine.types.IMAGE.SourceHeader.setStaticValues(), and de.desy.tine.types.IMAGE.SourceHeader.write().
int de.desy.tine.types.IMAGE.SourceHeader.timestampMicroseconds |
Contains the time the image was originally taken at image source, microseconds offset to UTC time.
The same design rules as for timestampSeconds member applies. If the granularity of system clock or camera clock (if image bits are time-tagged at hardware) is not good enough to deliver microseconds, close-by values like milliseconds or tenths of a second are also fine.
In C/C++ world, this header member is an signed int32.
Referenced by de.desy.tine.types.IMAGE.SourceHeader.read(), de.desy.tine.types.IMAGE.SourceHeader.setTimeStamp(), and de.desy.tine.types.IMAGE.SourceHeader.write().
int de.desy.tine.types.IMAGE.SourceHeader.timestampSeconds |
Contains the time the image was originally taken at image source, UTC seconds part.
The design rule is that this timestamp should be acquired as early as possible after image acquire from hardware sensor. Some digital cameras are even capable of tagging image data with a proper timestamp. This timestamp, as it is most precise one can get, should be transformed and copied here. The aim of the game is not to take a second timestamp in source code once the image is received in software, except if no other possibility exist.
In C/C++ world, this header member is an unsigned int32.
Referenced by de.desy.tine.types.IMAGE.SourceHeader.read(), de.desy.tine.types.IMAGE.SourceHeader.setTimeStamp(), and de.desy.tine.types.IMAGE.SourceHeader.write().
long de.desy.tine.types.IMAGE.SourceHeader.totalLength |
Contains the whole length of the data block as it would be transferred bytewise on network level.
This value contains physical amount of bytes necessary for sourceHeader, for frameHeader and the net size of appended frame bits. If no frame bits are appended, the size of sourceHeader plus frameHeader must be contained within.
For practical reason, current C/C++ implementations of the VideoSystem V3 are limited to 6 Megabytes of frame bits size plus header size (sourceHeader + frameHeader). But the general design rule is that an application should never expect to receive image frames that are less than or equal to 6 megabytes in size.
In C/C++ world, this header member is an unsigned int32.
Referenced by de.desy.tine.types.IMAGE.SourceHeader.read(), de.desy.tine.types.IMAGE.SourceHeader.setTotalLength(), and de.desy.tine.types.IMAGE.SourceHeader.write().
long de.desy.tine.types.IMAGE.SourceHeader.versionTag = IMAGE_INITIAL_VERSION |
Defines the version of the IMAGE header.
At the moment only version 1 is defined so this tag is fixed to '1'. Applications are asked to check this version number whether it meets their minimum requirements. It is foreseen that future header versions will be backward compatible. New applications should be able to work with old headers and new headers. Old applications can only work with old headers. Checking is performed based on integer comparison.
if (versionTag == 0x1) { good_header_version } else { bad header }
In C/C++ world, this header member is an unsigned int32.
Referenced by de.desy.tine.types.IMAGE.SourceHeader.read(), de.desy.tine.types.IMAGE.SourceHeader.setStaticValues(), and de.desy.tine.types.IMAGE.SourceHeader.write().