DESY ACOP Beans Home

de.desy.video.sw
Class CVideoHeader3

java.lang.Object
  extended by de.desy.video.sw.CVideoHeader3

public final class CVideoHeader3
extends java.lang.Object

CVideoHeader3 implements reference caching of a Video System v3 (VSv3) data array known as TINE IMAGE datatype for usage with the rest of Video System v3 Java code.
It contains useful helper functions to decode certain properties of VSv3 header into human-readable format.

Note:This class is only a very basic construct and might be substantially changed in future. It fits its purpose currently but will not win a price for meaningful class design!

Version:
$Id: Templates.xml,v 1.10 2008/06/20 17:40:13 sweisse Exp $
Author:
Stefan Weisse

Field Summary
static long CF_IMAGE_FLAG_HORIZONTAL_FLIP_180
          if set, image was flipped around horizontal axis on its way
static long CF_IMAGE_FLAG_IMAGE_LOSSLESS
          if set, original image data (first digital image data) can be restored out of the appended image bits
static long CF_IMAGE_FLAG_LITTLE_ENDIAN_BYTE_ORDER
          if set, appended video data is ordered little endian (on video format types where this is applicable)
static long CF_IMAGE_FLAG_VERTICAL_FLIP_180
          if set, image was flipped around vertical axis on its way
static long CF_IMAGE_FORMAT_BAYER
          video format id of 'Bayer pattern'
static long CF_IMAGE_FORMAT_BMP
          video format id of 'Windows BMP file'
static long CF_IMAGE_FORMAT_FIRST
          first format for range checking
static long CF_IMAGE_FORMAT_GRAY
          video format id of 'Grayscale format'
static long CF_IMAGE_FORMAT_HUFFYUV
          video format id of 'HuffYUV' (compressed grayscale)
static long CF_IMAGE_FORMAT_JPEG
          video format id of 'JPEG file'
static long CF_IMAGE_FORMAT_LAST
          last format for range checking
static long CF_IMAGE_FORMAT_RGB
          video format id of 'RGB (24bpp r-g-b) format'
static long CF_IMAGE_FORMAT_RGB15
          video format id of 'RGB (16bpp 0-5r-5g-5b) format'
static long CF_IMAGE_FORMAT_RGB16
          video format id of 'RGB (16bpp 5r-6g-5b)) format'
static long CF_IMAGE_FORMAT_RGBA
          video format id of 'RGB (32bpp a-r-g-b) format'
static long CF_IMAGE_FORMAT_TIFF
          video format id of 'TIFF file'
static long CF_IMAGE_FORMAT_YUV411
          video format id of 'YUV411 format'
static long CF_IMAGE_FORMAT_YUV422
          video format id of 'YUV422 format'
static long CF_IMAGE_FORMAT_YUV444
          video format id of 'YUV444 format'
static int CF_IMAGE_INITIAL_VERSION
          initial IMAGE version
static long CF_IMAGE_MAGIC_01
          first magic id for VSv3 'VSV3'
static int CF_IMAGE_MAX_VERSION
          maximum IMAGE version
static long CF_IMAGE_NO_CAMERA_PORT_ID
          cameraPortId is put to if no camera port is set there
static int CF_IMAGE_VERSION
          current IMAGE version
 FrameHeader frameHeader
          referenced frameHeader of private TINE IMAGE
static int HDRSIZE
          size in bytes of a VSv3 header on transport level
 SourceHeader sourceHeader
          referenced sourceHeader of private TINE IMAGE
static int TRANSPORT_LENGTH_V3
          maximum size in bytes of a VSv3 image (without header)
 
Constructor Summary
CVideoHeader3()
          default constructor, creates barebone initialized member variables
CVideoHeader3(IMAGE img)
          The new instance of the class will be a reference to the passed image data.
 
Method Summary
static java.lang.String flagsToString(long aFlags)
          decodes flags integer into human readable string format
static java.lang.String formatToString(long aformat)
          decodes video format integer (e.g.
 int getAppendedHeight()
          in order to get the real height of the image bits appended this function must be used.
 int getAppendedWidth()
          in order to get the real width of the image bits appended this function must be used.
 IMAGE getImage()
          returns the image reference currently cached in class.
 java.util.Date getTimestampAsDate()
          decodes timestamp of video frame into java Date class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frameHeader

public FrameHeader frameHeader
referenced frameHeader of private TINE IMAGE


sourceHeader

public SourceHeader sourceHeader
referenced sourceHeader of private TINE IMAGE


HDRSIZE

public static final int HDRSIZE
size in bytes of a VSv3 header on transport level

See Also:
Constant Field Values

TRANSPORT_LENGTH_V3

public static final int TRANSPORT_LENGTH_V3
maximum size in bytes of a VSv3 image (without header)

See Also:
Constant Field Values

CF_IMAGE_MAGIC_01

public static final long CF_IMAGE_MAGIC_01
first magic id for VSv3 'VSV3'

See Also:
Constant Field Values

CF_IMAGE_NO_CAMERA_PORT_ID

public static final long CF_IMAGE_NO_CAMERA_PORT_ID
cameraPortId is put to if no camera port is set there

See Also:
Constant Field Values

CF_IMAGE_INITIAL_VERSION

public static final int CF_IMAGE_INITIAL_VERSION
initial IMAGE version

See Also:
Constant Field Values

CF_IMAGE_VERSION

public static final int CF_IMAGE_VERSION
current IMAGE version

See Also:
Constant Field Values

CF_IMAGE_MAX_VERSION

public static final int CF_IMAGE_MAX_VERSION
maximum IMAGE version

See Also:
Constant Field Values

CF_IMAGE_FORMAT_GRAY

public static final long CF_IMAGE_FORMAT_GRAY
video format id of 'Grayscale format'

See Also:
Constant Field Values

CF_IMAGE_FORMAT_RGB

public static final long CF_IMAGE_FORMAT_RGB
video format id of 'RGB (24bpp r-g-b) format'

See Also:
Constant Field Values

CF_IMAGE_FORMAT_RGBA

public static final long CF_IMAGE_FORMAT_RGBA
video format id of 'RGB (32bpp a-r-g-b) format'

See Also:
Constant Field Values

CF_IMAGE_FORMAT_RGB15

public static final long CF_IMAGE_FORMAT_RGB15
video format id of 'RGB (16bpp 0-5r-5g-5b) format'

See Also:
Constant Field Values

CF_IMAGE_FORMAT_RGB16

public static final long CF_IMAGE_FORMAT_RGB16
video format id of 'RGB (16bpp 5r-6g-5b)) format'

See Also:
Constant Field Values

CF_IMAGE_FORMAT_JPEG

public static final long CF_IMAGE_FORMAT_JPEG
video format id of 'JPEG file'

See Also:
Constant Field Values

CF_IMAGE_FORMAT_TIFF

public static final long CF_IMAGE_FORMAT_TIFF
video format id of 'TIFF file'

See Also:
Constant Field Values

CF_IMAGE_FORMAT_YUV411

public static final long CF_IMAGE_FORMAT_YUV411
video format id of 'YUV411 format'

See Also:
Constant Field Values

CF_IMAGE_FORMAT_YUV422

public static final long CF_IMAGE_FORMAT_YUV422
video format id of 'YUV422 format'

See Also:
Constant Field Values

CF_IMAGE_FORMAT_YUV444

public static final long CF_IMAGE_FORMAT_YUV444
video format id of 'YUV444 format'

See Also:
Constant Field Values

CF_IMAGE_FORMAT_HUFFYUV

public static final long CF_IMAGE_FORMAT_HUFFYUV
video format id of 'HuffYUV' (compressed grayscale)

See Also:
Constant Field Values

CF_IMAGE_FORMAT_BMP

public static final long CF_IMAGE_FORMAT_BMP
video format id of 'Windows BMP file'

See Also:
Constant Field Values

CF_IMAGE_FORMAT_BAYER

public static final long CF_IMAGE_FORMAT_BAYER
video format id of 'Bayer pattern'

See Also:
Constant Field Values

CF_IMAGE_FORMAT_FIRST

public static final long CF_IMAGE_FORMAT_FIRST
first format for range checking

See Also:
Constant Field Values

CF_IMAGE_FORMAT_LAST

public static final long CF_IMAGE_FORMAT_LAST
last format for range checking

See Also:
Constant Field Values

CF_IMAGE_FLAG_LITTLE_ENDIAN_BYTE_ORDER

public static final long CF_IMAGE_FLAG_LITTLE_ENDIAN_BYTE_ORDER
if set, appended video data is ordered little endian (on video format types where this is applicable)

See Also:
Constant Field Values

CF_IMAGE_FLAG_IMAGE_LOSSLESS

public static final long CF_IMAGE_FLAG_IMAGE_LOSSLESS
if set, original image data (first digital image data) can be restored out of the appended image bits

See Also:
Constant Field Values

CF_IMAGE_FLAG_HORIZONTAL_FLIP_180

public static final long CF_IMAGE_FLAG_HORIZONTAL_FLIP_180
if set, image was flipped around horizontal axis on its way

See Also:
Constant Field Values

CF_IMAGE_FLAG_VERTICAL_FLIP_180

public static final long CF_IMAGE_FLAG_VERTICAL_FLIP_180
if set, image was flipped around vertical axis on its way

See Also:
Constant Field Values
Constructor Detail

CVideoHeader3

public CVideoHeader3()
default constructor, creates barebone initialized member variables


CVideoHeader3

public CVideoHeader3(IMAGE img)
The new instance of the class will be a reference to the passed image data.

Parameters:
img - image data to wrap inside this class
Method Detail

getImage

public IMAGE getImage()
returns the image reference currently cached in class.

Returns:
image reference currently cached in class

flagsToString

public static final java.lang.String flagsToString(long aFlags)
decodes flags integer into human readable string format

Returns:
string representation of the passed aFlags (frameHeader.imageFlags)

getTimestampAsDate

public final java.util.Date getTimestampAsDate()
decodes timestamp of video frame into java Date class

Returns:
date representation of sourceHeader.timestamp(Seconds+Microseconds)

formatToString

public static final java.lang.String formatToString(long aformat)
decodes video format integer (e.g. frameHeader.sourceFormat, frameHeader.imageFormat) into human readable string format

Returns:
string representation of the passed aFormat

getAppendedWidth

public int getAppendedWidth()
in order to get the real width of the image bits appended this function must be used. In case if the area of interest is set, one can not directly look at sourceWidth because aoiWidth depict the height of the appended image in such case

Returns:
the width in pixels of the appended image data bits

getAppendedHeight

public int getAppendedHeight()
in order to get the real height of the image bits appended this function must be used. In case if the area of interest is set, one can not directly look at sourceHeight because aoiHeight depict the height of the appended image in such case

Returns:
the height in pixels of the appended image data bits


Copyright © 2009. All Rights Reserved.