#ifndef C_API_CONVERTOR_2_H
#define C_API_CONVERTOR_2_H

/**
 * @file convertor_2.h
 * @brief Converters that only the move_base2 entry points need.
 *
 * Kept apart from convertor.h so the move_base2 surface can be added, reviewed and reverted without
 * touching the converters the existing binding already depends on.
 */

// C
#include "std_msgs/Header.h"
#include "sensor_msgs/Image.h"
#include "sensor_msgs/CameraInfo.h"
#include "sensor_msgs/DepthCameraData.h"

// C++
#include <robot_std_msgs/Header.h>
#include <robot_sensor_msgs/Image.h>
#include <robot_sensor_msgs/CameraInfo.h>
#include <robot_sensor_msgs/DepthCameraData.h>

/**
 * @brief Convert C Header to C++ Header.
 * @param header C header; `frame_id` may be NULL (becomes an empty string).
 */
robot_std_msgs::Header convert2CppHeader(const Header& header);

/**
 * @brief Convert C Image to C++ Image.
 *
 * The pixel buffer is copied, so the caller keeps ownership of `image.data` and may free it as
 * soon as this call returns.
 *
 * @param image C image; `data` and `encoding` may be NULL.
 */
robot_sensor_msgs::Image convert2CppImage(const Image& image);

/**
 * @brief Convert C CameraInfo to C++ CameraInfo.
 * @param info C camera info; `D` and `distortion_model` may be NULL. K/R/P are fixed size (9/9/12).
 */
robot_sensor_msgs::CameraInfo convert2CppCameraInfo(const CameraInfo& info);

/**
 * @brief Convert C DepthCameraData to C++ DepthCameraData. Everything is deep-copied.
 */
robot_sensor_msgs::DepthCameraData convert2CppDepthCameraData(const DepthCameraData& data);

#endif // C_API_CONVERTOR_2_H
