C++ API
The following API was auto-generated from source code using Doxygen and Breathe Doxygen.
-
namespace pixelpipes
Typedefs
-
typedef SliceIterator<View<uchar>> ReadonlySliceIterator
-
typedef SliceIterator<Span<uchar>> WriteableSliceIterator
-
typedef Pointer<StringList> StringListReference
- struct PIXELPIPES_API pixelpipes::Point2D Point2D
- struct PIXELPIPES_API pixelpipes::Rectangle Rectangle
- struct PIXELPIPES_API pixelpipes::Point3D Point3D
- struct PIXELPIPES_API pixelpipes::View2D View2D
-
typedef struct pixelpipes::View3D View3D
-
typedef Function<void(ModuleReference)> ModuleCallback
-
typedef void (*ModuleInitializer)()
-
using EvaluateFunction = TokenReference (*)(const TokenList&)
-
typedef Function<OperationReference(TokenList)> OperationConstructor
-
typedef Function<OperationDescription()> OperationDescriber
-
typedef struct pixelpipes::OutputDescription OutputDescription
-
typedef void (*TokenWriter)(const TokenReference&, std::ostream&)
-
typedef TokenReference (*TokenReader)(std::istream&)
-
typedef View<TokenReference> TokenList
-
using uchar = unsigned char
-
using ushort = unsigned short
-
using Type = pixelpipes::details::Type
-
typedef std::map<std::string, int> EnumerationMap
Enums
-
enum class ComparisonOperation
Values:
-
enumerator EQUAL
-
enumerator LOWER
-
enumerator LOWER_EQUAL
-
enumerator GREATER
-
enumerator GREATER_EQUAL
-
enumerator NOT_EQUAL
-
enumerator EQUAL
-
enum class ArithmeticOperation
Values:
-
enumerator ADD
-
enumerator SUBTRACT
-
enumerator MULTIPLY
-
enumerator DIVIDE
-
enumerator POWER
-
enumerator MODULO
-
enumerator ADD
-
enum class ContextData
Values:
-
enumerator SampleIndex
-
enumerator OperationIndex
-
enumerator RandomSeed
-
enumerator SampleIndex
Functions
-
inline void verify(bool condition, std::string reason = std::string("Assertion failed"))
-
template<typename Container>
auto make_view(const Container &c, size_t offset = 0) -> View<typename Container::value_type>
-
template<typename Container>
auto make_span(Container &c, size_t offset = 0) -> Span<typename Container::value_type>
-
template<>
inline BufferReference extract(const TokenReference &v)
-
template<>
inline TokenReference wrap(const std::string v)
-
template<>
inline TokenReference wrap(const std::vector<std::string> &v)
-
template<>
inline TokenReference wrap(const Span<std::string> &v)
-
template<>
inline TokenReference wrap(const Point2D v)
-
template<>
inline TokenReference wrap(const Rectangle v)
-
template<>
inline TokenReference wrap(const Point3D v)
-
template<>
inline TokenReference wrap(const View2D v)
-
template<>
inline TokenReference wrap(const View3D v)
-
template<>
inline TokenReference wrap(const std::vector<Point2D> &v)
-
template<>
inline TokenReference wrap(const Sequence<Point2D> &v)
-
template<>
inline TokenReference wrap(Sequence<Point2D> v)
-
template<>
inline TokenReference wrap(const std::vector<Point3D> &v)
-
inline bool is_numeric_list(const ListReference &v)
-
inline bool is_rectangle(const ListReference &v)
-
inline OperationTrait operator|(OperationTrait a, OperationTrait b)
-
inline bool operator&(OperationTrait a, int b)
- RandomGenerator PIXELPIPES_API make_generator (uint32_t seed)
- RandomGenerator PIXELPIPES_API create_generator (TokenReference seed)
- RandomGenerator PIXELPIPES_API create_generator (int seed)
- OperationReference PIXELPIPES_API make_operation (const std::string key, const TokenList &inputs)
- void PIXELPIPES_API register_operation (const std::string key, OperationConstructor constructor, OperationDescriber describer)
- bool PIXELPIPES_API is_operation_registered (const std::string key)
- Sequence< std::string > PIXELPIPES_API list_operations ()
-
template<typename OperationClass = Operation, typename ...Args>
void register_operation(const std::string key)
-
template<typename ...Args>
OperationReference make_operation(const std::string key, Args&&... args)
- OperationDescription PIXELPIPES_API describe_operation (const std::string key)
- ModuleReference PIXELPIPES_API operation_source (const std::string key)
- OperationReference PIXELPIPES_API create_operation (const std::string key, const TokenList &inputs)
- OperationReference PIXELPIPES_API create_operation (const std::string key, const std::initializer_list< TokenReference > &inputs)
- std::string PIXELPIPES_API operation_name (const OperationReference &)
-
template<typename Run, Run fn_run, EvaluateFunction fn_eval, OperationTrait trait>
void register_operation_auto(const std::string &name)
-
template<typename Run, Run fn_run, EvaluateFunction fn_eval, OperationTrait trait>
void register_operation_manual(const std::string &name)
-
template<typename Operation, typename ...Args>
void register_operation_class(const std::string &name)
-
template<typename T, size_t... S>
TokenReference constant_shape(const TokenList &inputs)
- bool PIXELPIPES_API is_output (OperationReference &op)
- bool PIXELPIPES_API is_conditional (OperationReference &op)
- bool PIXELPIPES_API is_constant (OperationReference &op)
- bool PIXELPIPES_API is_context (OperationReference &op)
- std::string PIXELPIPES_API visualize_pipeline (const Pipeline &pipeline)
- void PIXELPIPES_API type_register_serializer (Type i, std::string_view name, TokenReader reader, TokenWriter writer)
- void PIXELPIPES_API write_pipeline (const Pipeline &pipeline, std::ostream &drain, bool compress=true, bool relocatable=true)
- void PIXELPIPES_API write_pipeline (const Pipeline &pipeline, const std::string &drain, bool compress=true, bool relocatable=true)
- Pipeline PIXELPIPES_API read_pipeline (std::istream &source)
- Pipeline PIXELPIPES_API read_pipeline (const std::string &source)
-
inline void check_error(std::ios &stream)
-
template<>
inline void write_t(std::ostream &drain, bool b)
-
template<>
inline bool read_t(std::istream &source)
-
template<>
inline void write_t(std::ostream &drain, std::string s)
-
inline SizeSequence generate_strides(const Sizes &shape, size_t element)
-
template<>
inline TokenReference wrap(const int v)
-
template<>
inline TokenReference wrap(const short v)
-
template<>
inline TokenReference wrap(const ushort v)
-
template<>
inline TokenReference wrap(const bool v)
-
template<>
inline TokenReference wrap(const char v)
-
template<>
inline TokenReference wrap(const float v)
-
template<typename T>
inline bool _extract_scalar(const TokenReference &v, T *value)
-
template<typename T>
inline TensorReference create_tensor(const Sizes &s)
- TensorReference PIXELPIPES_API create_tensor (Type element, Sizes sizes)
- TensorReference PIXELPIPES_API create_tensor (Shape s)
- void PIXELPIPES_API copy_tensor (const TensorReference &in, const TensorReference &out)
-
template<>
inline TokenReference wrap(const Span<int> v)
-
template<>
inline TokenReference wrap(const Span<float> &v)
-
template<typename T>
inline TokenReference wrap(View<T> v)
-
template<typename T>
inline TokenReference wrap(const Sequence<T> &v)
-
template<>
inline TokenReference wrap(const std::vector<bool> &v)
-
template<>
inline TokenReference wrap(const std::vector<int> &v)
-
template<>
inline TokenReference wrap(const std::vector<float> &v)
-
template<>
inline TokenReference wrap(const std::vector<uchar> &v)
-
template<char>
inline TokenReference wrap(const std::vector<char> &v)
-
template<>
inline TokenReference wrap(const std::vector<short> &v)
-
template<>
inline TokenReference wrap(const std::vector<ushort> &v)
-
template<>
inline TokenReference wrap(const TensorReference &v)
-
inline Size get_size(const TokenReference &token)
-
template<>
inline TokenReference wrap(Size v)
-
inline std::ostream &operator<<(std::ostream &os, const TokenReference &token)
-
template<typename T>
inline TokenReference wrap(T v)
-
template<>
inline TokenReference wrap(const TokenReference v)
- template<typename T> constexpr Type PIXELPIPES_TYPE_API GetType () noexcept
The function that returns the type id.
It uses the pointer to the static data member of a class template to achieve this. Altough the value is not predictible, it’s stable (I hope).
- PIXELPIPES_API const char * type_name (Type t)
- Shape PIXELPIPES_API AnythingShape ()
- EnumerationMap PIXELPIPES_API describe_enumeration (std::string &name)
- void PIXELPIPES_API register_enumeration (const std::string &name, EnumerationMap mapping)
-
template<typename T>
inline void register_enumeration(const std::string &name)
Variables
-
constexpr size_t unknown = ~0L
-
template<typename T>
class Span : public pixelpipes::View<T> Subclassed by pixelpipes::Sequence< std::string >, pixelpipes::Sequence< pixelpipes::Size >, pixelpipes::Sequence< int >, pixelpipes::Sequence< TokenReference >, pixelpipes::Sequence< Type >, pixelpipes::Sequence< size_t >, pixelpipes::Sequence< T >
-
template<typename T>
class Sequence : public pixelpipes::Span<T>
-
class BaseException
Subclassed by pixelpipes::IllegalStateException, pixelpipes::ModuleException, pixelpipes::PipelineException, pixelpipes::SerializationException, pixelpipes::TypeException
-
class IllegalStateException : public pixelpipes::BaseException
-
template<typename Result, typename ...Args>
struct abstract_function
-
template<typename Func, typename Result, typename ...Args>
class concrete_function : public pixelpipes::abstract_function<Result, Args...>
-
template<typename Func>
struct func_filter
-
template<typename signature>
class Function
-
template<typename T>
class View Subclassed by pixelpipes::Span< uchar >, pixelpipes::Span< T >
-
class Formatter
-
class RandomGenerator
-
template<typename C>
class SliceIterator
-
class Buffer : public virtual pixelpipes::Token
Subclassed by pixelpipes::FlatBuffer, pixelpipes::Tensor
-
class FlatBuffer : public pixelpipes::Buffer
-
class String : public pixelpipes::List
-
class StringList : public pixelpipes::List
- #include <buffer.hpp>
String list.
-
struct Point2D
-
struct Rectangle
-
struct Point3D
-
struct View2D
-
struct View3D
-
class ModuleException : public pixelpipes::BaseException
-
class Module
-
class AddDirect
-
class AddModuleInitializer
-
class Operation
Subclassed by pixelpipes::OperationWrapper< Run, fn_run, fn_eval, o_trait, unpack >
-
template<typename Run, Run fn_run, EvaluateFunction fn_eval, OperationTrait o_trait, bool unpack>
class OperationWrapper : public pixelpipes::Operation
-
struct OperationDescription
-
struct OutputDescription
-
class Metadata
-
class Pipeline
-
class PipelineCallback
-
class PipelineException : public pixelpipes::BaseException
Subclassed by pixelpipes::OperationException
-
class OperationException : public pixelpipes::PipelineException
-
class SerializationException : public pixelpipes::BaseException
-
class Serializer
-
class Tensor : public pixelpipes::List, public pixelpipes::Buffer
Subclassed by pixelpipes::ArrayTensor< T, 2 >, pixelpipes::ArrayTensor< T, 1 >, pixelpipes::ArrayTensor< T, N >, pixelpipes::Scalar< T >, pixelpipes::TensorView
-
template<typename T>
class Scalar : public pixelpipes::Tensor
-
template<typename T>
class Vector : public pixelpipes::ArrayTensor<T, 1>
-
template<typename T>
class Matrix : public pixelpipes::ArrayTensor<T, 2>
-
class TensorView : public pixelpipes::Tensor
-
template<typename T, size_t N>
class ArrayTensor : public pixelpipes::Tensor
-
class Token : public virtual details::RTTI, public enable_pointer_from_this<Token>
Subclassed by pixelpipes::Buffer, pixelpipes::ContainerToken< T >, pixelpipes::List, pixelpipes::Placeholder
-
class Placeholder : public pixelpipes::Token
- #include <token.hpp>
Placeholder token is used to represent a token with unknown value, but known shape. It is used in inference phase.
-
template<typename T>
class ContainerToken : public pixelpipes::Token
-
class List : public virtual pixelpipes::Token
Subclassed by pixelpipes::GenericList, pixelpipes::String, pixelpipes::StringList, pixelpipes::Tensor
-
class GenericList : public pixelpipes::List
-
class TypeException : public pixelpipes::BaseException
-
struct Size
-
class Shape
-
namespace details
Typedefs
-
template<typename T>
using base_type = typename std::remove_cv<typename std::remove_reference<T>::type>
Functions
-
template<typename ...T>
tuple_with_base_types<T...> tuple_base_type(std::tuple<T...> const &t)
-
template<class Tuple, class T = std::decay_t<std::tuple_element_t<0, std::decay_t<Tuple>>>>
std::vector<T> to_vector(Tuple &&tuple)
-
template<class F, class Tuple, std::size_t... I>
constexpr decltype(auto) apply_impl(F &&f, TokenList inputs, Tuple t, std::index_sequence<I...>)
-
template<class T, class Tuple, std::size_t... I>
constexpr Pointer<T> make_from_tuple_impl(Tuple &&t, std::index_sequence<I...>)
-
template<typename FuncType, typename VecType, size_t... I, typename Traits = function_traits<FuncType>, typename ReturnT = typename Traits::output>
ReturnT do_call(FuncType func, VecType &args, std::index_sequence<I...>)
-
template<typename FuncType, typename VecType, typename Traits = function_traits<FuncType>, typename ReturnT = typename Traits::output>
ReturnT unpack_caller(FuncType func, VecType &args)
-
template<typename A>
std::tuple extract_args(ArgIterator current, ArgIterator end)
-
template<typename A, typename Arg>
tuple_with_base_types<Arg> extract_args(ArgIterator current, ArgIterator end)
-
template<typename A, typename First, typename Second, typename ...Args>
tuple_with_base_types<First, Second, Args...> extract_args(ArgIterator current, ArgIterator end)
-
template<typename T>
constexpr auto type_name()
Variables
-
constexpr std::string_view _undefined = "unsupported"
-
template<typename T>
-
typedef SliceIterator<View<uchar>> ReadonlySliceIterator