PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
annotation_repository.cpp File Reference

Implementation of the annotation repository. More...

#include "kcenon/pacs/storage/annotation_repository.h"
#include <chrono>
#include <iomanip>
#include <sstream>
#include <sqlite3.h>
Include dependency graph for annotation_repository.cpp:

Go to the source code of this file.

Namespaces

namespace  kcenon
 
namespace  kcenon::pacs
 
namespace  kcenon::pacs::storage
 

Functions

 if (!color.empty()) style.color
 
 if (style.line_width==0) style.line_width = 14
 
 if (!font_family.empty()) style.font_family
 

Variables

auto find_int_value
 
auto find_float_value
 
auto color = find_string_value("color")
 
style line_width = find_int_value("line_width")
 
style fill_color = find_string_value("fill_color")
 
style fill_opacity = find_float_value("fill_opacity")
 
auto font_family = find_string_value("font_family")
 
style font_size = find_int_value("font_size")
 
return style
 

Detailed Description

Implementation of the annotation repository.

See also
Issue #545 - Implement Annotation & Measurement APIs
Issue #581 - Part 1: Data Models and Repositories
Issue #610 - Phase 4: Repository Migrations
Issue #650 - Part 2: Migrate annotation, routing, node repositories

Definition in file annotation_repository.cpp.

Function Documentation

◆ if() [1/3]

◆ if() [2/3]

if ( !font_family. empty())

◆ if() [3/3]

if ( style. line_width = =0) = 14

Variable Documentation

◆ color

auto color = find_string_value("color")

Definition at line 607 of file annotation_repository.cpp.

◆ fill_color

style fill_color = find_string_value("fill_color")

Definition at line 613 of file annotation_repository.cpp.

◆ fill_opacity

style fill_opacity = find_float_value("fill_opacity")

Definition at line 614 of file annotation_repository.cpp.

◆ find_float_value

auto find_float_value
Initial value:
= [&](const char* key) -> float {
std::string search = std::string("\"") + key + "\":";
auto pos = json.find(search);
if (pos == std::string_view::npos) return 0.0f;
pos += search.size();
return static_cast<float>(std::atof(json.data() + pos));
}

Definition at line 599 of file annotation_repository.cpp.

599 {
600 std::string search = std::string("\"") + key + "\":";
601 auto pos = json.find(search);
602 if (pos == std::string_view::npos) return 0.0f;
603 pos += search.size();
604 return static_cast<float>(std::atof(json.data() + pos));
605 };

◆ find_int_value

auto find_int_value
Initial value:
= [&](const char* key) -> int {
std::string search = std::string("\"") + key + "\":";
auto pos = json.find(search);
if (pos == std::string_view::npos) return 0;
pos += search.size();
return std::atoi(json.data() + pos);
}

Definition at line 591 of file annotation_repository.cpp.

591 {
592 std::string search = std::string("\"") + key + "\":";
593 auto pos = json.find(search);
594 if (pos == std::string_view::npos) return 0;
595 pos += search.size();
596 return std::atoi(json.data() + pos);
597 };

◆ font_family

auto font_family = find_string_value("font_family")

Definition at line 616 of file annotation_repository.cpp.

◆ font_size

style font_size = find_int_value("font_size")

Definition at line 619 of file annotation_repository.cpp.

◆ line_width

style line_width = find_int_value("line_width")

Definition at line 610 of file annotation_repository.cpp.

◆ style