/*
 * 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 = "CameraSensorProtos";

/// \ingroup gz.msgs
/// \interface CameraSensor
/// \brief Information about a camera sensor element

import "gz/msgs/distortion.proto";
import "gz/msgs/double.proto";
import "gz/msgs/header.proto";
import "gz/msgs/image.proto";
import "gz/msgs/lens.proto";
import "gz/msgs/sensor_noise.proto";
import "gz/msgs/vector2d.proto";

message CameraSensor
{
  /// \brief Bounding box types.
  enum BoundingBoxType
  {
    /// \brief No bounding box.
    NO_BOUNDING_BOX = 0;

    /// \brief 2D box that shows the full box of occluded objects
    FULL_BOX_2D     = 1;

    /// \brief 2D box that shows the visible part of the occluded object
    VISIBLE_BOX_2D  = 2;

    /// \brief 3D oriented box
    BOX_3D          = 3;
  }

  /// \brief Segmentation types.
  enum SegmentationType
  {
    /// \brief No segmentation.
    NO_SEGMENTATION = 0;

    /// \brief Pixels of same label from different items
    /// have the same color & id.
    SEMANTIC        = 1;

    /// \brief Pixels of same label from different items, have different
    /// color & id. 1 channel for label id & 2 channels for instance id
    PANOPTIC       = 2;
  }

  /// \brief Optional header data
  Header header         = 1;

  /// \brief Horizontal field of view in radians
  double horizontal_fov = 2;

  /// \brief Image size in pixels.
  Vector2d image_size   = 3;

  /// \brief Image format. This field is deprecated, please use pixel_format.
  string image_format   = 4;

  /// \brief Near clip distance in meters.
  double near_clip      = 5;

  /// \brief Far clip distance in meters.
  double far_clip       = 6;

  /// \brief True if frames should be saved.
  bool save_enabled     = 7;

  /// \brief Path in which to save frames.
  string save_path      = 8;

  /// \brief Optional distortion information.
  Distortion distortion = 9;

  /// \brief Optional noise parameters for the image.
  SensorNoise image_noise = 10;

  /// \brief Optional depth near clip in meters.
  Double depth_near_clip  = 11;

  /// \brief Optional depth far clip in meters.
  Double depth_far_clip   = 12;

  /// \brief Optional bounding box camera type.
  BoundingBoxType bounding_box_type  = 13;

  /// \brief Optional segmentation camera type.
  SegmentationType segmentation_type = 14;

  /// \brief Optional lens information
  Lens lens = 15;

  /// \brief True if the camera will be triggered by a topic
  bool triggered = 16;

  /// \brief Name of the topic that will trigger the camera if enabled
  string triggered_topic = 17;

  /// \brief Value used for anti-aliasing
  int32 anti_aliasing = 18;

  /// \brief Visibility mask of a camera. When the camera's visibility_mask and 
  /// a visual's visibility_flags evaluates to non-zero, then the visual will
  /// be visible to the camera.
  uint32 visibility_mask = 19;

  /// \brief True if the camera is a depth camera.
  bool is_depth_camera = 20;

  /// \brief Pixel format used by the camera. This replaces image_format.
  PixelFormatType pixel_format = 21;
}
