Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions pj_base/include/pj_base/builtin/image_annotations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <string>
#include <vector>

#include "pj_base/point2.hpp"
#include "pj_base/types.hpp"

namespace PJ {
Expand All @@ -32,12 +33,8 @@ enum class AnnotationTopology : uint8_t {
kLineLoop, ///< Like LineStrip but closes back to the first point. 4-point loop = rectangle.
};

/// 2D point in image-pixel coordinates (origin top-left).
struct Point2 {
double x = 0.0;
double y = 0.0;
bool operator==(const Point2&) const = default;
};
// `Point2` lives in pj_base/point2.hpp (generic 2D vocab type). In this header
// it's used in image-pixel coordinates (origin top-left).

/// 8-bit per-channel RGBA color. a=0 means transparent / disabled.
struct ColorRGBA {
Expand Down
18 changes: 18 additions & 0 deletions pj_base/include/pj_base/point2.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2026 Davide Faconti
// SPDX-License-Identifier: Apache-2.0
#pragma once

// Plain (x, y) 2D point. Generic double-precision vocab type — used by image
// annotations (pixel coordinates), Filter Editor transforms (time/value
// samples), and any other 2D context where a tagged shape would be overkill.
// The semantic of x / y is owned by the caller.

namespace PJ::sdk {

struct Point2 {
double x = 0.0;
double y = 0.0;
bool operator==(const Point2&) const = default;
};

} // namespace PJ::sdk
21 changes: 20 additions & 1 deletion pj_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@ target_link_libraries(pj_plugin_loader_detail PUBLIC pj_base)

add_subdirectory(dialog_protocol)

# Filter Editor transform contract (header-only) — plugins implement the 12
# concrete strategies and self-register with the factory at load time. See
# pj_plugins/filter_protocol/include/pj_plugins/sdk/filter_transform.hpp.
add_library(pj_filter_sdk INTERFACE)
target_compile_features(pj_filter_sdk INTERFACE cxx_std_20)
target_include_directories(pj_filter_sdk INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/filter_protocol/include>
$<INSTALL_INTERFACE:include>
)
# Builtin strategies (in the plugin) use nlohmann/json for saveParams /
# loadParams; propagate the dep so consumers get it transitively. Also pulls
# pj_base for the C ABI primitives (PJ_string_view_t, PJ_error_t, PJ_NOEXCEPT)
# referenced by the filter registry service.
target_link_libraries(pj_filter_sdk INTERFACE pj_base nlohmann_json::nlohmann_json)
set_target_properties(pj_filter_sdk PROPERTIES EXPORT_NAME filter_sdk)
add_library(plotjuggler_sdk::filter_sdk ALIAS pj_filter_sdk)
install(DIRECTORY filter_protocol/include/ DESTINATION include)
install(TARGETS pj_filter_sdk EXPORT plotjuggler_sdkTargets ARCHIVE DESTINATION lib LIBRARY DESTINATION lib INCLUDES DESTINATION include)

# ---------------------------------------------------------------------------
# pj_plugin_sdk — umbrella INTERFACE library that exposes the full plugin-author
# SDK surface: C++ SDK headers (MessageParserPluginBase, ObjectIngestPolicy,
Expand All @@ -29,7 +48,7 @@ target_include_directories(pj_plugin_sdk INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(pj_plugin_sdk INTERFACE pj_base pj_dialog_sdk)
target_link_libraries(pj_plugin_sdk INTERFACE pj_base pj_dialog_sdk pj_filter_sdk)
set_target_properties(pj_plugin_sdk PROPERTIES EXPORT_NAME plugin_sdk)
add_library(plotjuggler_sdk::plugin_sdk ALIAS pj_plugin_sdk)

Expand Down
Loading
Loading