NDEVR
API Documentation
ImageVectorizationEngine.h
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/String.h>
4#include <NDEVR/RGBColor.h>
5#include <NDEVR/Polygon.h>
6#include <NDEVR/TranslatedString.h>
7#include <NDEVR/Dictionary.h>
8#include <NDEVR/LogPtr.h>
9#include <functional>
10namespace NDEVR
11{
12 class InfoPipe;
13
18 {
21 std::function<void(RGBColor color, Buffer<Polygon<fltp08>> polygon_add)> add_polygon;
22 std::function<void(bool)> finished_callback;
23 };
24
28 class NDEVR_DESIGN_API ImageVectorizationEngine
29 {
30 protected:
37 public:
43
49
56 virtual bool vectorize(VectorizeImageParams&) = 0;
57
62 [[nodiscard]] const TranslatedString& name() const { return m_name; }
63
68 [[nodiscard]] const String& id() const { return m_id; }
69 protected:
72 protected:
74 };
75}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:64
String m_id
The unique string identifier used for registry lookup.
static Dictionary< String, ImageVectorizationEngine * > s_global_engines
Global registry of all available vectorization engines, keyed by id.
static const Dictionary< String, ImageVectorizationEngine * > & AvailableVectorizors()
Returns the global dictionary of all registered vectorization engines, keyed by id.
ImageVectorizationEngine(const TranslatedString &name, const StringView &id)
Constructs an ImageVectorizationEngine with the given display name and unique identifier.
TranslatedString m_name
The user-facing translated display name of this engine.
const TranslatedString & name() const
Returns the user-facing translated display name of this engine.
const String & id() const
Returns the unique string identifier of this engine.
virtual bool vectorize(VectorizeImageParams &)=0
Performs vectorization of a raster image according to the given parameters.
static void AddAvailableEngine(ImageVectorizationEngine *filter)
Registers a vectorization engine in the global registry so it can be discovered by consumers.
A light-weight base class for Log that allows processes to update, without the need for additional in...
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
An N-sided polygon.
Definition Polygon.hpp:55
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:57
The core String View class for the NDEVR API.
Definition StringView.h:58
The core String class for the NDEVR API.
Definition String.h:95
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
The primary namespace for the NDEVR SDK.
Arguments used for creating vectorizations of an image.
std::function< void(RGBColor color, Buffer< Polygon< fltp08 > > polygon_add)> add_polygon
Callback invoked to emit vectorized polygon geometry with its associated color.
LogPtr log
Log target for reporting progress and diagnostics during vectorization.
std::function< void(bool)> finished_callback
Callback invoked when vectorization completes; the bool indicates success or failure.
String input_image
The file path or identifier of the input raster image to vectorize.