|
xentara-plugin v2.1
The Xentara Plugin Framework
|
Functionality for accessing the value of Xentara attributes. More...
Classes | |
| class | DataType |
| A custom type. More... | |
| class | FixedValue |
| A helper class that allows constructing read handles that return fixed values. More... | |
| class | Image |
| An image data point value. More... | |
| class | ReadHandle |
| A handle for reading a data value. More... | |
| class | WriteHandle |
| A handle for writing a data value. More... | |
Concepts | |
| concept | PixelCppType |
| Concept for types that can be used to store image pixels. | |
Typedefs | |
| template<PixelType kPixelType> | |
| using | PixelTypeToCppType = typename __opaque_find_pixel_cpp_type__< kPixelType >::type |
| The C++ type associated with a specific PixelType enum. | |
| template<NativeType kNativeType, TypeUsage kUsage = TypeUsage::Get> | |
| using | NativeTypeToCppType = typename __opaque_find_native_cpp_type__< kNativeType, kUsage >::type |
| The C++ type associated with a specific NativeType enum. | |
| using | Qualities = utils::core::Flags< Quality > |
| A combination of different qualities. | |
Enumerations | |
| enum class | ColorSpace { Mono , Rgb , Rgba , PremultipliedRgba , Bgr , Bgra , PremultipliedBgra , Hsv , Hls , Hsv255 , Hls255 , Xyz , Luv , Lab , YCrCb , BayerBg , BayerGb , BayerRg , BayerGr , Yuv444 , Yuv420sp_Nv12 , Yuv420sp_Nv21 , Yuv420p_I420 , Yuv420p_Yv12 , Yuv422_Uyvy , Yuv422_Yuy2 , Yuv422_Yvyu , internal } |
| Colour spaces for images. More... | |
| enum class | ColorDepth { Unsigned8Bit , Unsigned10Bit , Unsigned12Bit , Unsigned16Bit , Signed8Bit , Signed16Bit , Float32 , Float64 , internal } |
| Colour depths for images. More... | |
| enum class | PixelType { Uint8 , Uint16 , Int8 , Int16 , Float , Double } |
| The C++ type used for the individual pixels in an image. More... | |
| enum class | NativeType { Boolean , Integer , UnsignedInteger , FloatingPoint , String , WString , U8String , U16String , U32String , Image , TimePoint , Uuid , Quality , ElementCategory , ErrorCode , Custom , None } |
| An enum describing different types of native C++ data used in read and write handles. More... | |
| enum class | TypeUsage { Get , Put } |
| usage for a type when converting between NativeType and C++ types More... | |
| enum class | Quality : std::uint8_t { Good , Acceptable , Unreliable , Bad , internal } |
| A Quality for a data point value. More... | |
Functions | |
| template<typename CppType > requires PixelCppType<std::remove_cvref_t<CppType>> | |
| constexpr auto | cppTypeToPixelType () noexcept -> PixelType |
| Find the correct PixelType enum to use for a C++ type. | |
| constexpr auto | channelCount (ColorSpace colorSpace) noexcept -> std::size_t |
| Gets the number of channels in a colour space. | |
| template<utils::tools::CharType Char> | |
| auto | toBasicString (ColorSpace colorSpace) -> std::basic_string_view< Char > |
| Converts a colour space value to a string. | |
| auto | toString (ColorSpace colorSpace) -> std::string_view |
| Converts a colour space value to a string of type char | |
| auto | toWString (ColorSpace colorSpace) -> std::wstring_view |
| Converts a colour space value to a string of type wchar_t | |
| auto | toU8String (ColorSpace colorSpace) -> std::u8string_view |
| Converts a colour space value to a string of type char8_t | |
| auto | toU16String (ColorSpace colorSpace) -> std::u16string_view |
| Converts a colour space value to a string of type char16_t | |
| auto | toU32String (ColorSpace colorSpace) -> std::u32string_view |
| Converts a colour space value to a string of type char32_t | |
| auto | operator<< (std::ostream &stream, ColorSpace colorSpace) -> std::ostream & |
| Stream insertion operator for color space values. | |
| constexpr auto | pixelType (ColorDepth colorDepth) noexcept -> PixelType |
| Gets the pixel type for a colour depth. | |
| template<utils::tools::CharType Char> | |
| auto | toBasicString (ColorDepth colorDepth) -> std::basic_string_view< Char > |
| Converts a colour depth to a string. | |
| auto | toString (ColorDepth colorDepth) -> std::string_view |
| Converts a colour depth to a string of type char | |
| auto | toWString (ColorDepth colorDepth) -> std::wstring_view |
| Converts a colour depth to a string of type wchar_t | |
| auto | toU8String (ColorDepth colorDepth) -> std::u8string_view |
| Converts a colour depth to a string of type char8_t | |
| auto | toU16String (ColorDepth colorDepth) -> std::u16string_view |
| Converts a colour depth to a string of type char16_t | |
| auto | toU32String (ColorDepth colorDepth) -> std::u32string_view |
| Converts a colour depth to a string of type char32_t | |
| auto | operator<< (std::ostream &stream, ColorDepth colorDepth) -> std::ostream & |
| Stream insertion operator for target color depths. | |
| template<typename CppType > | |
| constexpr auto | cppTypeToNativeType (TypeUsage usage=TypeUsage::Put) noexcept -> NativeType |
| Find the correct NativeType enum to use for a C++ type. | |
| template<utils::tools::CharType Char> | |
| auto | toBasicString (Quality quality) -> std::basic_string_view< Char > |
| Converts a quality value to a string. | |
| auto | toString (Quality quality) -> std::string_view |
| Converts a quality value to a string of type char | |
| auto | toWString (Quality quality) -> std::wstring_view |
| Converts a quality value to a string of type wchar_t | |
| auto | toU8String (Quality quality) -> std::u8string_view |
| Converts a quality value to a string of type char8_t | |
| auto | toU16String (Quality quality) -> std::u16string_view |
| Converts a quality value to a string of type char16_t | |
| auto | toU32String (Quality quality) -> std::u32string_view |
| Converts a number to a string of type char32_t | |
| constexpr auto | isBetter (Quality quality, Quality referenceQuality) noexcept -> bool |
| Determines if one quality is better than another quality. | |
| constexpr auto | isWorse (Quality quality, Quality referenceQuality) noexcept -> bool |
| Determines if one quality is worse than another quality. | |
| template<std::convertible_to< Quality >... MoreQualities> | |
| constexpr auto | combine (Quality firstQuality, MoreQualities &&... moreQualities) noexcept -> Quality |
| Picks the worse of a number of qualities. | |
| constexpr auto | isUsable (Quality quality) noexcept -> bool |
| Determines if a quality is usable, i.e. if the corresponding value can be relied upon. | |
| template<typename Error1 , typename Error2 > | |
| constexpr auto | selectError (Quality quality1, Error1 &&error1, Quality quality2, Error2 &&error2) -> std::common_type< Error1, Error2 > |
| Selects one of two error messages depending on two corresponding qualities. | |
| auto | operator<< (std::ostream &stream, Quality quality) -> std::ostream & |
| Stream insertion operator for qualities. | |
| auto | operator<< (utils::cbor::Encoder &encoder, Quality quality) -> utils::cbor::Encoder & |
| Encodes a quality to a CBOR encoder. | |
| auto | operator>> (utils::cbor::Decoder &decoder, Quality &quality) -> utils::cbor::Decoder & |
| Decodes a quality from a CBOR encoder. | |
| template<class Type > | |
| FixedValue (Type) -> FixedValue< Type > | |
| Deduction guide for a fixed value passed by value. | |
Functionality for accessing the value of Xentara attributes.
This namespace contains functionality used to read and write the values of Xentara attributes, including the values of data points.
| using xentara::data::NativeTypeToCppType = typedef typename __opaque_find_native_cpp_type__<kNativeType, kUsage>::type |
The C++ type associated with a specific NativeType enum.
This type alias represents the C++ type associated with a particular NativeType value.
Special cases:
| kNativeType | The native type to use. If kNativeType is NativeType::None, this type is an alias for a non-existent type. |
| kUsage | The usage for the C++ type, used to determine how handle string types. If you specify TypeUsage::Get, then string types will map to the appropriate specialization of std::basic_string, suitable for storing strings. If you specify TypeUsage::Put, then string types will will map to the appropriate specialization of std::basic_string_view, suitable for passing stored strings to consumers. |
| using xentara::data::PixelTypeToCppType = typedef typename __opaque_find_pixel_cpp_type__<kPixelType>::type |
The C++ type associated with a specific PixelType enum.
This type alias represents the C++ type associated with a particular PixelType value.
| kPixelType | The pixel type to use. |
| using xentara::data::Qualities = typedef utils::core::Flags<Quality> |
A combination of different qualities.
#include <xentara/data/Quality.hpp>
|
strong |
Colour depths for images.
| Enumerator | |
|---|---|
| Unsigned8Bit | 8-bit colour, stored as std::uint8_t |
| Unsigned10Bit | 10-bit colour, stored as std::uint16_t |
| Unsigned12Bit | 12-bit colour, stored as std::uint16_t |
| Unsigned16Bit | 16-bit colour, stored as std::uint16_t |
| Signed8Bit | 8-bit colour, stored as std::int8_t |
| Signed16Bit | 16-bit colour, stored as std::int16_t |
| Float32 | 32-bit floating point colour, stored as float |
| Float64 | 64-bit floating point colour, stored as double |
|
strong |
Colour spaces for images.
|
strong |
An enum describing different types of native C++ data used in read and write handles.
This enum provides a hint as to the best C++ data type to use when calling ReadHandle::read() or WriteHandle::write().
| Enumerator | |
|---|---|
| Boolean | The best C++ type is bool |
| Integer | The best C++ type is std::intmax_t. |
| UnsignedInteger | The best C++ type is std::uintmax_t. |
| FloatingPoint | The best C++ type is double |
| String | The best C++ type is std::string for reading and std::string_view for writing. |
| WString | The best C++ type is std::wstring for reading and std::wstring_view for writing. |
| U8String | The best C++ type is std::u8string for reading and std::u8string_view for writing. |
| U16String | The best C++ type is std::u16string for reading and std::u16string_view for writing. |
| U32String | The best C++ type is std::u32string for reading and std::u32string_view for writing. |
| Image | The best C++ type is xentara::data::Image. |
| TimePoint | The best C++ type is std::chrono::system_clock::time_point. |
| Uuid | The best C++ type is xentara::utils::core::Uuid. |
| Quality | The best C++ type is xentara::data::Quality. |
| ElementCategory | The best C++ type is xentara::model::ElementCategory. |
| ErrorCode | The best C++ type is std::error_code. |
| Custom | The best C++ type is some custom type specific to some plugin. This enum value denotes that the data is stored internally as some custom type specific to a plugin, like a custom enum type. |
| None | The handle is does not represent any data. This type is used for error handles. Error handles are handles that never read or write any data, but always return an error from [read()](@ref ReadHandle::read()) or [write(@ref ]WriteHandle::write()). |
|
strong |
The C++ type used for the individual pixels in an image.
| Enumerator | |
|---|---|
| Uint8 | The pixels are stored as std::uint8_t. |
| Uint16 | The pixels are stored as std::uint16_t. |
| Int8 | The pixels are stored as std::int8_t. |
| Int16 | The pixels are stored as std::int16_t. |
| Float | The pixels are stored as float. |
| Double | The pixels are stored as double. |
|
strong |
A Quality for a data point value.
#include <xentara/data/Quality.hpp> | Enumerator | |
|---|---|
| Good | The value was successfully acquired. Values with this quality have been acquired in the normal way without any errors or issues. |
| Acceptable | The value was acquired in an acceptable way, but some problem occurred. Values with this quality were acquired successfully, but may have reduced precision or accuracy. This may be due to using an alternate, inferior data source, to some non-critical error situation, or because a sensor or such is operating under conditions where the accuracy is reduced. Values with quality Quality::Acceptable can still be used as inputs to control circuits, simulations, etc., but the results may not be as good as when using values with quality Quality::Good. Calculated or derived values that are based on values with this quality should themselves not be flagged with a quality better than Quality::Acceptable. |
| Unreliable | There was a problem acquiring the value, and it should not be relied upon. Values with this quality can used for informational purposes, but are not reliable enough for system critical uses, such as control ciruits, safety systems, etc. Calculated or derived values that are based on values with this quality should themselves not be flagged with a quality better than Quality::Unreliable. |
| Bad | The value could not be acquired correctly. Values with this quality either could not be acquired at all, or a serious error was encountered, like exceeding the range of a sensor. Calculated or derived values that are based on values with this quality should themselves be flagged as Quality::Bad. Expensive operations, such as executing FMUs or AI models, can be skipped altogether, and some default or fallback value used as the output instead (also with quality Quality::Bad, of course). |
|
strong |
|
constexprnoexcept |
Gets the number of channels in a colour space.
#include <xentara/data/ImageTypes.hpp> | colorSpace | The colour space |
|
constexprnoexcept |
Picks the worse of a number of qualities.
#include <xentara/data/Quality.hpp> | firstQuality | The first quality to consider |
| moreQualities | Any number of additional qualities to consider |
|
constexprnoexcept |
Find the correct NativeType enum to use for a C++ type.
This function returns the NativeType value that is used for a specific C++ type.
This template is available for all C++ types, not only the canonical native C++ type, as returned by NativeTypeToCppType. For non-canonical types, the function will return the best fitting native type.
If no suitable standard NativeType value is exists, then the function will return value NativeType::Custom.
| CppType | The C++ type to convert. References and cv-qualifiers are removed using std::remove_cvref before checking the type. The type is not limited to the canonical native C++ type, as returned by NativeTypeToCppType, any C++ type can be used, and the best fitting NativeType value will be returned. |
| usage | The usage for the C++ type. Specify TypeUsage::Get if you are reading the value from producer, and TypeUsage::Put if you are writing the value to a consumer. This will affect some types:
|
|
constexprnoexcept |
Find the correct PixelType enum to use for a C++ type.
This function returns the PixelType value that is used for a specific C++ type.
| CppType | The C++ type to convert. References and cv-qualifiers are removed using std::remove_cvref before checking the type. |
| xentara::data::FixedValue | ( | Type | ) | -> FixedValue< Type > |
Deduction guide for a fixed value passed by value.
|
constexprnoexcept |
Determines if one quality is better than another quality.
#include <xentara/data/Quality.hpp> | quality | The quality value to check |
| referenceQuality | The quality value to compare with |
|
constexprnoexcept |
Determines if a quality is usable, i.e. if the corresponding value can be relied upon.
#include <xentara/data/Quality.hpp> | quality | The quality value to check |
|
constexprnoexcept |
Determines if one quality is worse than another quality.
#include <xentara/data/Quality.hpp> | quality | The quality value to check |
| referenceQuality | The quality value to compare with |
| auto xentara::data::operator<< | ( | std::ostream & | stream, |
| ColorDepth | colorDepth | ||
| ) | -> std::ostream & |
Stream insertion operator for target color depths.
#include <xentara/data/ImageTypes.hpp> | stream | The stream |
| colorDepth | The colour depth |
| auto xentara::data::operator<< | ( | std::ostream & | stream, |
| ColorSpace | colorSpace | ||
| ) | -> std::ostream & |
Stream insertion operator for color space values.
#include <xentara/data/ImageTypes.hpp> | stream | The stream |
| colorSpace | The colour space value |
| auto xentara::data::operator<< | ( | std::ostream & | stream, |
| Quality | quality | ||
| ) | -> std::ostream & |
Stream insertion operator for qualities.
#include <xentara/data/Quality.hpp> | stream | The stream |
| quality | The quality value |
| auto xentara::data::operator<< | ( | utils::cbor::Encoder & | encoder, |
| Quality | quality | ||
| ) | -> utils::cbor::Encoder & |
Encodes a quality to a CBOR encoder.
#include <xentara/data/Quality.hpp> | encoder | The encoder |
| quality | The quality |
| auto xentara::data::operator>> | ( | utils::cbor::Decoder & | decoder, |
| Quality & | quality | ||
| ) | -> utils::cbor::Decoder & |
Decodes a quality from a CBOR encoder.
#include <xentara/data/Quality.hpp> | decoder | The decoder |
| quality | The quality |
|
constexprnoexcept |
Gets the pixel type for a colour depth.
#include <xentara/data/ImageTypes.hpp> | colorDepth | The colour depth |
|
constexpr |
Selects one of two error messages depending on two corresponding qualities.
#include <xentara/data/Quality.hpp> | quality1 | The quality that corresponds to error1 |
| error1 | The error that corresponds to quality1 |
| quality2 | The quality that corresponds to error2 |
| error2 | The error that corresponds to quality2 |
| auto xentara::data::toBasicString | ( | ColorDepth | colorDepth | ) | -> std::basic_string_view<Char> |
Converts a colour depth to a string.
#include <xentara/data/ImageTypes.hpp> | colorDepth | The colour depth |
| auto xentara::data::toBasicString | ( | ColorSpace | colorSpace | ) | -> std::basic_string_view<Char> |
Converts a colour space value to a string.
#include <xentara/data/ImageTypes.hpp> | colorSpace | The colour space value |
| auto xentara::data::toBasicString | ( | Quality | quality | ) | -> std::basic_string_view<Char> |
Converts a quality value to a string.
#include <xentara/data/Quality.hpp> | quality | The quality value |
| auto xentara::data::toString | ( | ColorDepth | colorDepth | ) | -> std::string_view |
Converts a colour depth to a string of type char
#include <xentara/data/ColorDepth.hpp> | colorDepth | The colour depth |
| auto xentara::data::toString | ( | ColorSpace | colorSpace | ) | -> std::string_view |
Converts a colour space value to a string of type char
#include <xentara/data/ImageTypes.hpp> | colorSpace | The colour space value |
| auto xentara::data::toString | ( | Quality | quality | ) | -> std::string_view |
Converts a quality value to a string of type char
#include <xentara/data/Quality.hpp> | quality | The quality value |
| auto xentara::data::toU16String | ( | ColorDepth | colorDepth | ) | -> std::u16string_view |
Converts a colour depth to a string of type char16_t
#include <xentara/data/ColorDepth.hpp> | colorDepth | The colour depth |
| auto xentara::data::toU16String | ( | ColorSpace | colorSpace | ) | -> std::u16string_view |
Converts a colour space value to a string of type char16_t
#include <xentara/data/ImageTypes.hpp> | colorSpace | The colour space value |
| auto xentara::data::toU16String | ( | Quality | quality | ) | -> std::u16string_view |
Converts a quality value to a string of type char16_t
#include <xentara/data/Quality.hpp> | quality | The quality value |
| auto xentara::data::toU32String | ( | ColorDepth | colorDepth | ) | -> std::u32string_view |
Converts a colour depth to a string of type char32_t
#include <xentara/data/ColorDepth.hpp> | colorDepth | The colour depth |
| auto xentara::data::toU32String | ( | ColorSpace | colorSpace | ) | -> std::u32string_view |
Converts a colour space value to a string of type char32_t
#include <xentara/data/ImageTypes.hpp> | colorSpace | The colour space value |
| auto xentara::data::toU32String | ( | Quality | quality | ) | -> std::u32string_view |
Converts a number to a string of type char32_t
#include <xentara/data/Quality.hpp> | quality | The quality value |
| auto xentara::data::toU8String | ( | ColorDepth | colorDepth | ) | -> std::u8string_view |
Converts a colour depth to a string of type char8_t
#include <xentara/data/ColorDepth.hpp> | colorDepth | The colour depth |
| auto xentara::data::toU8String | ( | ColorSpace | colorSpace | ) | -> std::u8string_view |
Converts a colour space value to a string of type char8_t
#include <xentara/data/ImageTypes.hpp> | colorSpace | The colour space value |
| auto xentara::data::toU8String | ( | Quality | quality | ) | -> std::u8string_view |
Converts a quality value to a string of type char8_t
#include <xentara/data/Quality.hpp> | quality | The quality value |
| auto xentara::data::toWString | ( | ColorDepth | colorDepth | ) | -> std::wstring_view |
Converts a colour depth to a string of type wchar_t
#include <xentara/data/ColorDepth.hpp> | colorDepth | The colour depth |
| auto xentara::data::toWString | ( | ColorSpace | colorSpace | ) | -> std::wstring_view |
Converts a colour space value to a string of type wchar_t
#include <xentara/data/ImageTypes.hpp> | colorSpace | The colour space value |
| auto xentara::data::toWString | ( | Quality | quality | ) | -> std::wstring_view |
Converts a quality value to a string of type wchar_t
#include <xentara/data/Quality.hpp> | quality | The quality value |