libfreenect2: Frame Class Reference

Frame format and metadata. More...

#include <libfreenect2/frame_listener.hpp>

Public Types

enum  Type { Color = 1, Ir = 2, Depth = 4 }
 Available types of frames. More...
 
enum  Format {
  Invalid = 0, Raw = 1, Float = 2, BGRX = 4,
  RGBX = 5, Gray = 6
}
 Pixel format. More...
 

Public Member Functions

 Frame (size_t width, size_t height, size_t bytes_per_pixel, unsigned char *data_=NULL)
 Construct a new frame. More...
 
virtual ~Frame ()
 

Public Attributes

size_t width
 Length of a line (in pixels). More...
 
size_t height
 Number of lines in the frame. More...
 
size_t bytes_per_pixel
 Number of bytes in a pixel. If frame format is 'Raw' this is the buffer size. More...
 
unsigned char * data
 Data of the frame (aligned). More...
 
uint32_t timestamp
 Unit: roughly or exactly 0.1 millisecond. More...
 
uint32_t sequence
 Increasing frame sequence number. More...
 
float exposure
 From 0.5 (very bright) to ~60.0 (fully covered) More...
 
float gain
 From 1.0 (bright) to 1.5 (covered) More...
 
float gamma
 From 1.0 (bright) to 6.4 (covered) More...
 
uint32_t status
 zero if ok; non-zero for errors. More...
 
Format format
 Byte format. Informative only, doesn't indicate errors. More...
 

Protected Attributes

unsigned char * rawdata
 Unaligned start of data. More...
 

Frame format and metadata.

Available types of frames.

Enumerator
Color 

1920x1080. BGRX or RGBX.

Ir 

512x424 float. Range is [0.0, 65535.0].

Depth 

512x424 float, unit: millimeter. Non-positive, NaN, and infinity are invalid or missing data.

Pixel format.

Enumerator
Invalid 

Invalid format.

Raw 

Raw bitstream. 'bytes_per_pixel' defines the number of bytes.

Float 

A 4-byte float per pixel.

BGRX 

4 bytes of B, G, R, and unused per pixel

RGBX 

4 bytes of R, G, B, and unused per pixel

Gray 

1 byte of gray per pixel

Frame ( size_t  width,
size_t  height,
size_t  bytes_per_pixel,
unsigned char *  data_ = NULL 
)

Construct a new frame.

Parameters
widthWidth in pixel
heightHeight in pixel
bytes_per_pixelBytes per pixel
data_Memory to store frame data. If NULL, new memory is allocated.
virtual ~Frame ( )
virtual

Length of a line (in pixels).

Number of lines in the frame.

Number of bytes in a pixel. If frame format is 'Raw' this is the buffer size.

Unit: roughly or exactly 0.1 millisecond.

Increasing frame sequence number.

From 0.5 (very bright) to ~60.0 (fully covered)

From 1.0 (bright) to 1.5 (covered)

From 1.0 (bright) to 6.4 (covered)

zero if ok; non-zero for errors.

Byte format. Informative only, doesn't indicate errors.