#pragma once

#include <optional>
#include <sstream>
#include <string>

namespace origincar_birdseye
{

inline std::optional<std::string> validateImageSize(
  int expected_width, int expected_height, int actual_width, int actual_height)
{
  if (expected_width == actual_width && expected_height == actual_height) {
    return std::nullopt;
  }

  std::ostringstream message;
  message << "input image size mismatch: expected " << expected_width << 'x' << expected_height
          << ", received " << actual_width << 'x' << actual_height;
  return message.str();
}

inline std::optional<std::string> validateImageMessageType(const std::string & value)
{
  if (value == "raw" || value == "compressed") {
    return std::nullopt;
  }
  return "image_message_type must be raw or compressed";
}

}  // namespace origincar_birdseye
