libfreenect2  0.2
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
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...
 

Detailed Description

Frame format and metadata.

Member Enumeration Documentation

enum Type

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.

enum Format

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

Constructor & Destructor Documentation

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

Member Data Documentation

size_t width

Length of a line (in pixels).

size_t height

Number of lines in the frame.

size_t bytes_per_pixel

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

unsigned char* data

Data of the frame (aligned).

See also
See Frame::Type for pixel format.
uint32_t timestamp

Unit: roughly or exactly 0.1 millisecond.

uint32_t sequence

Increasing frame sequence number.

float exposure

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

float gain

From 1.0 (bright) to 1.5 (covered)

float gamma

From 1.0 (bright) to 6.4 (covered)

uint32_t status

zero if ok; non-zero for errors.

Format format

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

unsigned char* rawdata
protected

Unaligned start of data.