IARPA Janus  0.4.0
IARPA Janus Program API
Public Attributes | List of all members
janus_image Struct Reference

Common representation for still images and video frames. More...

#include <iarpa_janus.h>

Public Attributes

 Data buffer.
size_t width
 Column count in pixels.
size_t height
 Row count in pixels.
size_t step
 Bytes per row, including padding.
janus_color_space color_space
 Arrangement of data.

Detailed Description

Common representation for still images and video frames.

Pixels are stored in row-major order. In other words, pixel layout with respect to decreasing memory spatial locality is channel, column, row. Thus pixel intensity can be retrieved as follows:

janus_data get_intensity(janus_image image, size_t channel, size_t column,
size_t row)
const size_t columnStep = (image.image_format == JANUS_COLOR ? 3 : 1);
const size_t index = row*image.step + column*columnStep + channel;
return image.data[index];

Coordinate (0, 0) corresponds to the top-left corner of the image. Coordinate (width-1, height-1) corresponds to the bottom-right corner of the image.

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