#include "adapters/config/WatermarkConfigAdapter.h"

#include "foundation/product/ProductInfo.h"

namespace ta::adapters::config
{
    WatermarkConfigAdapter::WatermarkConfigAdapter()
        : ta::application::config::ConfigOwner("watermark", "Watermark", ta::application::config::ConfigCategory::Config),
          text_(*this, "text", ta::foundation::product_info::display_title(), "Text")
    {
    }

    ta::features::watermark::WatermarkView WatermarkConfigAdapter::read() const
    {
        return {
            enabled_->get_value(),
            text_->get(),
            ta::foundation::to_rgba(color_->get_value()),
            font_size_->get_value()
        };
    }
}
