Main Page | Features | Central Services | csv-Files | Types | Transfer | Access | API-C | API-.NET | API-Java | Examples | Downloads
page generated on 31.05.2023 - 04:45
Public Attributes | Protected Member Functions | List of all members
de.desy.tine.types.IMAGE.FrameHeader Class Reference

Subclass of second (and last) part of header (subclass used for logical grouping of class member variables which map almost 1:1 to header structures physically transferred in binary form. More...

Public Attributes

int sourceWidth
 Width in pixels of the source image (if aoi is specified) or the raw appended image size. More...
 
int sourceHeight
 Width in pixels of the source image (if aoi is specified) or the raw appended image size. More...
 
int aoiWidth = -1
 Width in pixels of the area of interest. More...
 
int aoiHeight = -1
 Height in pixels of the area of interest. More...
 
int xStart = 0
 Pixel index location (counting starts from zero) of left index from top-left position if an aoi is set. More...
 
int yStart = 0
 Pixel index location (counting starts from zero) of top index from top-left position if an aoi is set. More...
 
int bytesPerPixel
 Specifies amount of bytes per pixel. More...
 
int effectiveBitsPerPixel
 Specifies amount of effective bits per pixel of appended image bits. More...
 
int horizontalBinning = 0
 Pure informal value describes whether integer binning in horizontal direction was performed on the image. More...
 
int verticalBinning = 0
 Pure informal value describes whether integer binning in vertical direction was performed on the image. More...
 
int sourceFormat
 Rather informal value declaring the image format taken by camera hardware at image source. More...
 
int imageFormat
 Very important member declaring the binary format in which image bits, appended to this header taken by camera, are encoded. More...
 
long frameNumber
 Specifies unique frame identification number. More...
 
long eventNumber
 Specifies event number when frame was taken. More...
 
float xScale = -1F
 Ratio between pixels and millimetres for x-pixel dimension. More...
 
float yScale = -1F
 Ratio between pixels and millimetres for x-pixel dimension. More...
 
float imageRotation = 0F
 Specifies the rotation balance (compare: account balance, saldo in German) that was applied since image acquire at source level. More...
 
float fspare1 = -1F
 First out of three spare floats eserved for future extensions. More...
 
float fspare2 = -1F
 Second out of three spare floats reserved for future extensions. More...
 
float fspare3 = -1
 Third out of three spare floats reserved for future extensions. More...
 
int imageFlags = 0x1
 Contains flags that describe boolean 'states' of an image. More...
 
int ispare1 = -1
 First out of three spare integers reserved for future extensions. More...
 
int ispare2 = -1
 Second out of three spare integers reserved for future extensions. More...
 
int ispare3 = -1
 Third out of three spare integers reserved for future extensions. More...
 
int appendedFrameSize
 Contains number of bytes of 'image bits' data that follows the CF_IMAGE header. More...
 

Protected Member Functions

void read (DataInputStream dis) throws IOException
 
void write (DataOutputStream ds) throws IOException
 

Detailed Description

Subclass of second (and last) part of header (subclass used for logical grouping of class member variables which map almost 1:1 to header structures physically transferred in binary form.

This class public member variables are mainly a clone of the TTF2_IMAGE_STRUCT defined and agreed in 2008 between ERS, MCS 1 and MCS 4.

Member Function Documentation

◆ read()

void de.desy.tine.types.IMAGE.FrameHeader.read ( DataInputStream  dis) throws IOException
protected

◆ write()

void de.desy.tine.types.IMAGE.FrameHeader.write ( DataOutputStream  ds) throws IOException
protected

Member Data Documentation

◆ aoiHeight

int de.desy.tine.types.IMAGE.FrameHeader.aoiHeight = -1

Height in pixels of the area of interest.

A special mechanism is implemented in a CF_IMAGE. If at the image source it can be decided that only a part of the sensor is read out or contains significant information (invaluable surroundings (mounting plates etc.) does not need to get transferred to remote peers), not the whole image may be transferred but only a rectangular region out of it. Even this rectangular piece is break down into two pieces: horizontal truncation (sourceWidth, aoiWidth and xStart) and vertical truncation (sourceHeight, aoiHeight and yStart).

If aoiHeight is specified (bigger than zero), it defines the number of vertical pixels that are attached to the header as frame. The sourceHeight member in that case should be bigger than aoiHeight and defines the source width in pixels (at source level) before an aoi was cut out. The whole mechanism is referred to sometimes as 'aoi cutout'.

If aoiHeight is set to a value of 0 or less, it is treated as NOT set. If yStart is bigger than zero the aoi is considered to be set in horizontal dimension. If aoiHeight is zero or less in that case, the header is considered to be NOT valid!

In C/C++ world, this member variable is a signed int32. If it is unset (very possible), value is less than or equal to zero. A recommendation for unset value is '-1', though.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ aoiWidth

int de.desy.tine.types.IMAGE.FrameHeader.aoiWidth = -1

Width in pixels of the area of interest.

A special mechanism is implemented in a CF_IMAGE. If at the image source it can be decided that only a part of the sensor is read out or contains significant information (invaluable surroundings (mounting plates etc.) does not need to get transferred to remote peers), not the whole image may be transferred but only a rectangular region out of it. Even this rectangular piece is break down into two pieces: horizontal truncation (sourceWidth, aoiWidth and xStart) and vertical truncation (sourceHeight, aoiHeight and yStart).

If aoiWidth is specified (bigger than zero), it defines the number of horizontal pixels that are attached to the header as frame. The sourceWidth member in that case should be bigger than aoiWidth and defines the source width in pixels (at source level) before an aoi was cut out. The whole mechanism is referred to sometimes as 'aoi cutout'.

If aoiWidth is set to a value of 0 or less, it is treated as NOT set. If xStart is bigger than zero the aoi is considered to be set in horizontal dimension. If aoiWidth is zero or less in that case, the header is considered to be NOT valid!

In C/C++ world, this member variable is a signed int32. If it is unset (very possible), value is less than or equal to zero. A recommendation for unset value is '-1', though.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ appendedFrameSize

int de.desy.tine.types.IMAGE.FrameHeader.appendedFrameSize

Contains number of bytes of 'image bits' data that follows the CF_IMAGE header.

A value of -1 means that the member is not yet initialized. A value of 0 means that no bytes are appended at all. A positive integer value is equal to the number of bytes that are appended. A value of less than -1 is treated as invalid!

In C/C++ world, this member is a signed 32 bit integer.

Referenced by de.desy.tine.queryUtils.TQuery.getDeviceServerReport(), de.desy.tine.dataUtils.TDataType.putData(), de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ bytesPerPixel

int de.desy.tine.types.IMAGE.FrameHeader.bytesPerPixel

Specifies amount of bytes per pixel.

Currently defined values are 1 (exactly one byte per pixel), 2 (exactly two bytes per pixel), 3 (three bytes per pixel) and 4 (four bytes per pixel). Fractional bytes per pixel (as with packed 12 bit grayscale values) are not supported at the moment. It is foreseen to use the '0' to specify that.

Generally speaking, header version 1 supports raw grayscale images of 1,2 and 3 bytes per pixel and raw RGB colour images of 3 or 4 bytes per pixel (24 bits or 24 bits padded to 32 bits).

In C/C++ world, this member variable is a signed int32. If it is unset (unlikely), value must be '-1'. Values of less than one or bigger than four are treated as illegal for header version 1.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ effectiveBitsPerPixel

int de.desy.tine.types.IMAGE.FrameHeader.effectiveBitsPerPixel

Specifies amount of effective bits per pixel of appended image bits.

For performance reasons, physical resolution of 12 bits per pixel (in example Prosilica GE / GC-type monochrome cameras) is wrapped into 16 bit integers for improving handling by computers. For such scheme effective bits per pixel value was invented to distinguish valid from invalid pixel values and to have more input for image processing algorithms. The value should be set appropriate. If it is not set, it is believed to be set to the maximum value the current data format is capable of. If the value is bigger than theoretically possible for a given bytesPerPixel member, the header is considered to be invalid.

In C/C++ world, this member variable is a signed int32. If it is unset (unlikely), value must be '-1'. A value of zero is treated as 'unset' for header version 1.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ eventNumber

long de.desy.tine.types.IMAGE.FrameHeader.eventNumber

Specifies event number when frame was taken.

In some modern timing systems, together with the main repetition rate (triggered accelerator like PITZ) an information is modulated on the trigger signal and properly decoded to computer registers by timing hardware. This information can be helpful in joining or synchronization cases. One use-case is DAQ correlation ("where did the lightning hit first before a lot of systems went crazy").

The header members eventNumber, frameNumber, timeStamp and cameraPortId build up a primary key which should identify an image throughout a whole facility for the lifetime of the facility.

In C/C++ world, this member variable is an unsigned int32. If it is unset, value must be '0'. Any positive value is considered a valid event number and usually event number are incremented like frame numbers, but for each event instead of each subsequent frame.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ frameNumber

long de.desy.tine.types.IMAGE.FrameHeader.frameNumber

Specifies unique frame identification number.

This number is not really unique. Starting at one, for each frame (as early as possible after acquiring, maybe even done inside camera hardware) the image is tagged with this number. The next image (no losses in between!) should be tagged with number+1 and so on. By performing this method, it can be checked later whether a sequence contains really subsequent frames as they were acquired at source level and no video frame is lost in between.

In C/C++ world, this member variable is an unsigned int32. If it is unset, value must be '0'.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ fspare1

float de.desy.tine.types.IMAGE.FrameHeader.fspare1 = -1F

First out of three spare floats eserved for future extensions.

Current value of this float should be '-1.0' (uninitialized). In

C/C++ world, this member is a standard 32 bit floating point number.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ fspare2

float de.desy.tine.types.IMAGE.FrameHeader.fspare2 = -1F

Second out of three spare floats reserved for future extensions.

Current value of this float should be '-1.0' (uninitialized). In

C/C++ world, this member is a standard 32 bit floating point number.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ fspare3

float de.desy.tine.types.IMAGE.FrameHeader.fspare3 = -1

Third out of three spare floats reserved for future extensions.

Current value of this float should be '-1.0' (uninitialized). In

C/C++ world, this member is a standard 32 bit floating point number.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ horizontalBinning

int de.desy.tine.types.IMAGE.FrameHeader.horizontalBinning = 0

Pure informal value describes whether integer binning in horizontal direction was performed on the image.

It is not said whether this binning was performed by hardware or software.

  • 0 - binning status unknown
  • 1 - no binning (known status!)
  • 2 - 1 pixel was created out of 2 pixels (2:1)
  • 3 - 1 pixel was created out of 3 pixels (3:1)
  • 4 - 4:1
  • ...

In C/C++ world, this member variable is a signed int32. If it is unset (very likely), value must be '0'. If value is less than zero header is considered invalid.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ imageFlags

int de.desy.tine.types.IMAGE.FrameHeader.imageFlags = 0x1

Contains flags that describe boolean 'states' of an image.

Each state is encoded into one bit. Up to now, four bits are already used (LSB 1, MSB 32):

  • 0: if set, image bits are appended in little endian byte order, big endian otherwise
  • 1: if set, image acquired from source is possible to restore out of data contained within losslessly. If unset, a lossy change was applied on the way...
  • 2: if set, image was flipped along horizontal axis on its way. If bit 2 and 3 are set, horizontal flipping takes precedence over vertical flipping. Any rotation degree, if specified, is performed before any of the flipping.
  • 3: if set, image was flipped along vertical axis on its way. If bit 2 and 3 are set, horizontal flipping takes precedence over vertical flipping. Any rotation degree, if specified, is performed before any of the flipping.
  • 4 to 32: reserved, should be unset

In C/C++ world, this member is a standard 32 bit signed integer.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ imageFormat

int de.desy.tine.types.IMAGE.FrameHeader.imageFormat

Very important member declaring the binary format in which image bits, appended to this header taken by camera, are encoded.

In general, its value can be very different from sourceFormat value. It should always reflect encoding type of image bits. Various formats can be set:

  • 0 - Grayscale
  • 1 - RGB (24bpp)
  • 2 - RGB (32bpp)
  • 3 - RGB (15bpp)*
  • 4 - RGB (16bpp)*
  • 5 - JPEG
  • 6 - TIFF*
  • 7 - YUV411*
  • 8 - YUV422*
  • 9 - YUV444*
  • 10 - HUFFYUV
  • 11 - BMP (Windows BMP)*
  • 11 - BAYER*
  • not specified in more detail up to now, should be used as informal values at sourceFormat only

In C/C++ world, this member variable is a signed int32. If it is unset (very unlikely), value must be '-1'. If value is less than -1, header is considered invalid.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ imageRotation

float de.desy.tine.types.IMAGE.FrameHeader.imageRotation = 0F

Specifies the rotation balance (compare: account balance, saldo in German) that was applied since image acquire at source level.

For example lossless orientation changes can be performed in CoreProvider TINE Server video component to undo perspective changes introduced because of awkward or improper mounting of camera hardware at readout position. This member is always initialized to 0.0 (no rotation performed). Positive values specify clockwise rotation, negative values specify counterclockwise rotation. Regarding value of this field, a general agreement is to keep it in range of -360.0 < imageRotation < 360.0 .

In C/C++ world, this member is a standard 32 bit floating point number.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ ispare1

int de.desy.tine.types.IMAGE.FrameHeader.ispare1 = -1

First out of three spare integers reserved for future extensions.

Current value should be '-1' (uninitialized).

In C/C++ world, this member is a signed 32 bit integer.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ ispare2

int de.desy.tine.types.IMAGE.FrameHeader.ispare2 = -1

Second out of three spare integers reserved for future extensions.

Current value should be '-1' (uninitialized).

In C/C++ world, this member is a signed 32 bit integer.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ ispare3

int de.desy.tine.types.IMAGE.FrameHeader.ispare3 = -1

Third out of three spare integers reserved for future extensions.

Current value should be '-1' (uninitialized).

In C/C++ world, this member is a signed 32 bit integer.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ sourceFormat

int de.desy.tine.types.IMAGE.FrameHeader.sourceFormat

Rather informal value declaring the image format taken by camera hardware at image source.

Once set at image acquire level, this member should not be changed. One practical case is that colour information was originally delivered by sensor as bayer pattern but decoded by image acquire software to 24 bit RGB data, which was subsequently be appended to this image header. The image source format should be bayer in that case. Certain formats are implemented at the moment, see imageFormat.

In C/C++ world, this member variable is a signed int32. If it is unset (unlikely), value must be '-1'. If value is less than -1, header is considered invalid.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ sourceHeight

int de.desy.tine.types.IMAGE.FrameHeader.sourceHeight

Width in pixels of the source image (if aoi is specified) or the raw appended image size.

The variable is unnecessary if an aoi is set and very necessary otherwise. See aoiWidth, aoiHeight, xStart, yStart and sourceHeight.

In C/C++ world, this member variable is a signed int32. If it is unset (unlikely, but possible), value is '-1'.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ sourceWidth

int de.desy.tine.types.IMAGE.FrameHeader.sourceWidth

Width in pixels of the source image (if aoi is specified) or the raw appended image size.

The variable is unnecessary if an aoi is set and very necessary otherwise. See aoiWidth, aoiHeight, xStart, yStart and sourceWidth.

In C/C++ world, this member variable is a signed int32. If it is unset (unlikely, but possible), value is '-1'.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ verticalBinning

int de.desy.tine.types.IMAGE.FrameHeader.verticalBinning = 0

Pure informal value describes whether integer binning in vertical direction was performed on the image.

It is not said whether this binning was performed by hardware or software.

  • 0 - binning status unknown
  • 1 - no binning (known status!)
  • 2 - 1 pixel was created out of 2 pixels (2:1)
  • 3 - 1 pixel was created out of 3 pixels (3:1)
  • 4 - 4:1
  • ...

In C/C++ world, this member variable is a signed int32. If it is unset (very likely), value must be '0'. If value is less than zero, header is considered invalid.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ xScale

float de.desy.tine.types.IMAGE.FrameHeader.xScale = -1F

Ratio between pixels and millimetres for x-pixel dimension.

If xScale is 3.0, one pixel is 3 mm "wide". If unset or unspecified, value must be set to ~ -1.0. Any negative value except ~ -1.0 is treated as faulty. A value of ~ 0.0 is considered to be illegal.

In C/C++ world, this member is a standard 32 bit floating point number.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ xStart

int de.desy.tine.types.IMAGE.FrameHeader.xStart = 0

Pixel index location (counting starts from zero) of left index from top-left position if an aoi is set.

If no aoi is set (here: aoiWidth <= 0); xStart is defined to be exactly zero. If it is not, the header is invalid. xStart plus aoiWidth must be less than or equal to sourceWidth. In C/C++ world, this member variable is a signed int32. If it is unset (very possible), value must be zero. A value of less than zero is invalid!

See also
aoiWidth
sourceWidth
aoiHeight
yStart
sourceHeight

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ yScale

float de.desy.tine.types.IMAGE.FrameHeader.yScale = -1F

Ratio between pixels and millimetres for x-pixel dimension.

If yScale is 2.0, one pixel is 2 mm "tall". If unset or unspecified, value must be set to ~ -1.0. Any negative value except ~ -1.0 is treated as faulty. A value of ~ 0.0 is considered to be illegal.

In C/C++ world, this member is a standard 32 bit floating point number.

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().

◆ yStart

int de.desy.tine.types.IMAGE.FrameHeader.yStart = 0

Pixel index location (counting starts from zero) of top index from top-left position if an aoi is set.

If no aoi is set (here: aoiHeight <= 0); xStart is defined to be exactly zero. If it is not, the header is invalid. yStart plus aoiHeight must be less than or equal to sourceHeight. In C/C++ world, this member variable is a signed int32. If it is unset (very possible), value must be zero. A value of less than zero is invalid!

See also
aoiHeight
sourceHeight
aoiWidth
xStart
sourceWidth

Referenced by de.desy.tine.types.IMAGE.FrameHeader.read(), and de.desy.tine.types.IMAGE.FrameHeader.write().


The documentation for this class was generated from the following file: