Skip to content

include/cvw/image_builder.hpp

Image loading utility with Expected-based error reporting. More...

Namespaces

Name
cvw

Classes

Name
classcvw::ImageBuilder
Factory class for loading images from disk in a specific format.

Detailed Description

Image loading utility with Expected-based error reporting.

Author: Charliechen114514

Version: 1.0.0

Since: 1.0.0

Date: 2026-05-15

Declares the ImageBuilder template and LoadError enum for loading images from disk with compile-time pixel format selection.

Source code

cpp

#pragma once
#include "base/expected.hpp"
#include "image.hpp"
#include "pixel_format.hpp"
#include <cstdint>
#include <string_view>

namespace cvw {

enum class LoadError : uint8_t {
    FileOpenFailed,         
    UnsupportedConversion,  
};

template <is_pixel_format format_type> class ImageBuilder {
  public:
    expected<Image<format_type>, LoadError> load(std::string_view path);
};
} // namespace cvw

#include "details/image_builder_impl.hpp"

Updated on 2026-05-17 at 13:22:38 +0000

Built with VitePress