package botlcm;

// Describes an image
//
// This type should be kept compatible with camlcm.image_t, as defined
// in camunits-extra

struct image_t
{
    // microseconds since the epoch
    int64_t  utime;

    int32_t  width;
    int32_t  height;
    int32_t  row_stride;

    int32_t  pixelformat;

    int32_t  size;
    byte     data[size];

    // metadata dictionary
    int32_t nmetadata;
    image_metadata_t metadata[nmetadata];

    // these values are to be kept in sync with the CamPixelFormat enumeration
    // in the Camunits library.  See camunits/pixels.h in Camunits
    const int32_t PIXEL_FORMAT_UYVY             = 1498831189;
    const int32_t PIXEL_FORMAT_YUYV             = 1448695129;
    const int32_t PIXEL_FORMAT_IYU1             = 827677001;
    const int32_t PIXEL_FORMAT_IYU2             = 844454217;
    const int32_t PIXEL_FORMAT_YUV420           = 842093913;
    const int32_t PIXEL_FORMAT_YUV411P          = 1345401140;
    const int32_t PIXEL_FORMAT_I420             = 808596553;
    const int32_t PIXEL_FORMAT_NV12             = 842094158;
    const int32_t PIXEL_FORMAT_GRAY             = 1497715271;
    const int32_t PIXEL_FORMAT_RGB              = 859981650;
    const int32_t PIXEL_FORMAT_BGR              = 861030210;
    const int32_t PIXEL_FORMAT_RGBA             = 876758866;
    const int32_t PIXEL_FORMAT_BGRA             = 877807426;
    const int32_t PIXEL_FORMAT_BAYER_BGGR       = 825770306;
    const int32_t PIXEL_FORMAT_BAYER_GBRG       = 844650584;
    const int32_t PIXEL_FORMAT_BAYER_GRBG       = 861427800;
    const int32_t PIXEL_FORMAT_BAYER_RGGB       = 878205016;
    const int32_t PIXEL_FORMAT_MJPEG            = 1196444237;
    const int32_t PIXEL_FORMAT_BE_GRAY16        = 357;
    const int32_t PIXEL_FORMAT_BE_RGB16         = 358;
    const int32_t PIXEL_FORMAT_BE_SIGNED_GRAY16 = 359;
    const int32_t PIXEL_FORMAT_BE_SIGNED_RGB16  = 360;
    const int32_t PIXEL_FORMAT_LE_GRAY16        = 909199180;
    const int32_t PIXEL_FORMAT_FLOAT_GRAY32     = 842221382;
    const int32_t PIXEL_FORMAT_INVALID          = -2;
    const int32_t PIXEL_FORMAT_ANY              = -1;
}
