/*
 * Copyright (C) 2017 Open Source Robotics Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
*/

syntax = "proto3";
package gz.msgs;
option java_package = "com.gz.msgs";
option java_outer_classname = "ImageProtos";

/// \ingroup gz.msgs
/// \interface Image
/// \brief Message for an image

import "gz/msgs/header.proto";

/// \brief Possible pixel formats.
/// This list should match gz::common::Image::PixelFormatType
enum PixelFormatType
{
  UNKNOWN_PIXEL_FORMAT = 0;
  L_INT8 = 1;
  L_INT16 = 2;
  RGB_INT8 = 3;
  RGBA_INT8 = 4;
  BGRA_INT8 = 5;
  RGB_INT16 = 6;
  RGB_INT32 = 7;
  BGR_INT8 = 8;
  BGR_INT16 = 9;
  BGR_INT32 = 10;
  R_FLOAT16 = 11;
  RGB_FLOAT16 = 12;
  R_FLOAT32 = 13;
  RGB_FLOAT32 = 14;
  BAYER_RGGB8 = 15;
  BAYER_BGGR8 = 16;
  BAYER_GBRG8 = 17;
  BAYER_GRBG8 = 18;
}

message Image
{
  /// \brief Optional header data
  Header header        = 1;

  /// \brief Image width (number of columns)
  uint32 width         = 2;

  /// \brief Image height (number of rows)
  uint32 height        = 3;

  /// \brief Full row length in bytes
  uint32 step          = 4;

  /// \brief Actual data, size if (step * rows)
  bytes data           = 5;

  /// \brief Pixel format type.
  PixelFormatType pixel_format_type = 6;
}
