diplib/library/types.h file

Defines the basic types used throughout the library. This file is always included through diplib.h. See Support types, Pixel data types.

Namespaces

namespace dip::Option::CmpProp
Namespace to emulate an enumerator, contains values

Classes

template<typename T>
struct dip::IsSampleType
For use with std::enable_if to enable templates only for types that are valid for image samples.
template<typename T>
struct dip::IsNumericType
For use with std::enable_if to enable templates only for types that are numeric types, similar to std::is_arithmetic but also true for complex types. See dip::IsSampleType for usage details.
template<typename T>
struct dip::IsIndexingType
For use with std::enable_if to enable templates only for types that are indexing types, true for signed and unsigned integers. See dip::IsSampleType for usage details.
class dip::bin
Type for samples in a binary image. Can store 0 or 1. Occupies 1 byte.
struct dip::Range
Used in indexing to indicate a regular subset of pixels along one image dimension.
struct dip::RegressionParameters
Represents the result of a 2D regression analysis: \(y = a + bx\) .
struct dip::QuartilesResult
Represents the quartiles, see dip::Quartiles.
class dip::AlignedBuffer
A container used to allocate 32-byte aligned buffers.

Aliases

using dip::Option::CmpPropFlags = dip::detail::Options
Determines which properties to compare. Combines multiple dip::Option::CmpPropEnumerator values, predefined values are in dip::Option::CmpProp.
using dip::sint = std::ptrdiff_t
An integer type to be used for strides and similar measures.
using dip::uint = std::size_t
An integer type to be used for sizes and the like.
using dip::uint8 = std::uint8_t
Type for samples in an 8-bit unsigned integer image; also to be used as single byte for pointer arithmetic
using dip::uint16 = std::uint16_t
Type for samples in a 16-bit unsigned integer image
using dip::uint32 = std::uint32_t
Type for samples in a 32-bit unsigned integer image
using dip::uint64 = std::uint64_t
Type for samples in a 64-bit unsigned integer image
using dip::sint8 = std::int8_t
Type for samples in an 8-bit signed integer image
using dip::sint16 = std::int16_t
Type for samples in a 16-bit signed integer image
using dip::sint32 = std::int32_t
Type for samples in a 32-bit signed integer image
using dip::sint64 = std::int64_t
Type for samples in a 64-bit signed integer image
using dip::sfloat = float
Type for samples in a 32-bit floating point (single-precision) image
using dip::dfloat = double
Type for samples in a 64-bit floating point (double-precision) image
using dip::scomplex = std::complex<sfloat>
Type for samples in a 64-bit complex-valued (single-precision) image
using dip::dcomplex = std::complex<dfloat>
Type for samples in a 128-bit complex-valued (double-precision) image
using dip::LabelType = dip::uint32
Type currently used for all labeled images, see dip::DT_LABEL.
template<typename T>
using dip::FloatType = dip::detail::FloatTypeCalculator
The type to use in calculations when a floating-point type is needed. Matches dip::DataType::SuggestFloat.
template<typename T>
using dip::DoubleType = dip::detail::DoubleTypeCalculator
The double precision floating point type (real or complex) to use when computing large sums of any input type. Matches dip::DataType::SuggestDouble.
template<typename T>
using dip::ComplexType = dip::detail::ComplexTypeCalculator
The type to use in calculations when a complex type is needed. Matches dip::DataType::SuggestComplex.
template<typename T>
using dip::FlexType = dip::detail::FlexTypeCalculator
The type to use in calculations. Matches dip::DataType::SuggestFlex.
template<typename T>
using dip::FlexBinType = dip::detail::FlexBinTypeCalculator
The type to use in calculations. Matches dip::DataType::SuggestFlexBin.
template<typename T>
using dip::AbsType = dip::detail::AbsTypeCalculator
The type to use for the output of abs operations. Matches dip::DataType::SuggestAbs.
template<typename T>
using dip::RealType = dip::detail::RealTypeCalculator
The type to use in calculations when a real-valued type is needed. Matches dip::DataType::SuggestReal.
using dip::IntegerArray = dip::DimensionArray
An array to hold strides, filter sizes, etc.
using dip::UnsignedArray = dip::DimensionArray
An array to hold dimensions, dimension lists, etc.
using dip::FloatArray = dip::DimensionArray
An array to hold filter parameters.
using dip::BooleanArray = dip::DimensionArray
An array used as a dimension selector.
using dip::CoordinateArray = std::vector<UnsignedArray>
An array of pixel coordinates.
using dip::FloatCoordinateArray = std::vector<FloatArray>
An array of subpixel coordinates.
using dip::String = std::string
A string, used to specify an option
using dip::StringArray = std::vector<String>
An array of strings, used to specify an option per dimension
using dip::StringSet = std::set<String>
A collection of strings, used to specify multiple independent options
using dip::RangeArray = dip::DimensionArray
An array of ranges

Enums

enum class dip::Option::ThrowException: uint8{ DONT_THROW, DO_THROW }
Some functions that check for a condition optionally throw an exception if that condition is not met.
enum class dip::Option::AllowSingletonExpansion: uint8{ DONT_ALLOW, DO_ALLOW }
The function dip::Image::CheckIsMask takes this option to control how sizes are compared.
enum class dip::Option::AcceptDataTypeChange: uint8{ DONT_ALLOW, DO_ALLOW }
The function dip::Image::ReForge takes this option to control how to handle protected images.
enum class dip::Option::CropLocation: uint8{ CENTER, MIRROR_CENTER, TOP_LEFT, BOTTOM_RIGHT }
The function dip::Image::Crop takes this option to control which pixels are taken.
enum class dip::Option::CmpPropEnumerator: uint8{ DataType, Dimensionality, Sizes, Strides, TensorShape, TensorElements, TensorStride, ColorSpace, PixelSize }
Determines which properties to compare.

Functions

template<typename TPI, <SFINAE> = 0>
auto dip::CastLabelType(TPI label) -> dip::LabelType
Casting any unsigned integer type to dip::LabelType. Throws if value is too large.
template<typename TPI, <SFINAE> = 0>
auto dip::PixelIsInfinity(TPI ) -> bool
A templated function to check for positive infinity, which works also for integer types (always returning false)
template<typename TPI, <SFINAE> = 0>
auto dip::PixelIsMinusInfinity(TPI ) -> bool
A templated function to check for negative infinity, which works also for integer types (always returning false)
template<typename T>
void dip::ArrayUseParameter(dip::DimensionArray& array, dip::uint nDims, T defaultValue = {})
Check the length of an array, and extend it if necessary and possible.
auto dip::BooleanFromString(dip::String const& input, dip::String const& trueString, dip::String const& falseString) -> bool
Translates a string input parameter that is meant as a boolean value.
auto dip::StringCompareCaseInsensitive(dip::String const& string1, dip::String const& string2) -> bool
A case-insensitive string comparison, use only with ASCII characters!
void dip::ToLowerCase(dip::String& string)
Convert a string to lower case, use only with ASCII characters!
void dip::ToUpperCase(dip::String& string)
Convert a string to upper case, use only with ASCII characters!

Operators

auto dip::operator<<(std::ostream& os, dip::bin const& v) -> std::ostream&
Writes the value as a bool to a stream.
auto dip::operator<<(std::ostream& os, dip::Range const& range) -> std::ostream&
Display a range as “{start, stop, step}”.

Variables

dip::Option::CmpPropFlags const dip::Option::CmpProp::DataType constexpr
dip::Option::CmpPropEnumerator::DataType.
dip::Option::CmpPropFlags const dip::Option::CmpProp::Dimensionality constexpr
dip::Option::CmpPropEnumerator::Dimensionality.
dip::Option::CmpPropFlags const dip::Option::CmpProp::Sizes constexpr
dip::Option::CmpPropEnumerator::Sizes.
dip::Option::CmpPropFlags const dip::Option::CmpProp::Strides constexpr
dip::Option::CmpPropEnumerator::Strides.
dip::Option::CmpPropFlags const dip::Option::CmpProp::TensorShape constexpr
dip::Option::CmpPropEnumerator::TensorShape.
dip::Option::CmpPropFlags const dip::Option::CmpProp::TensorElements constexpr
dip::Option::CmpPropEnumerator::TensorElements.
dip::Option::CmpPropFlags const dip::Option::CmpProp::TensorStride constexpr
dip::Option::CmpPropEnumerator::TensorStride.
dip::Option::CmpPropFlags const dip::Option::CmpProp::ColorSpace constexpr
dip::Option::CmpPropEnumerator::ColorSpace.
dip::Option::CmpPropFlags const dip::Option::CmpProp::PixelSize constexpr
dip::Option::CmpPropEnumerator::PixelSize.
dip::Option::CmpPropFlags const dip::Option::CmpProp::AllSizes constexpr
dip::Option::CmpProp::Sizes + dip::Option::CmpProp::TensorElements.
dip::Option::CmpPropFlags const dip::Option::CmpProp::Samples constexpr
dip::Option::CmpProp::DataType + dip::Option::CmpProp::Sizes + dip::Option::CmpProp::TensorElements.
dip::Option::CmpPropFlags const dip::Option::CmpProp::Shape constexpr
dip::Option::CmpProp::DataType + dip::Option::CmpProp::Sizes + dip::Option::CmpProp::TensorShape.
dip::Option::CmpPropFlags const dip::Option::CmpProp::Full constexpr
dip::Option::CmpProp::Shape + dip::Option::CmpProp::Strides + dip::Option::CmpProp::TensorStride.
dip::Option::CmpPropFlags const dip::Option::CmpProp::All constexpr
dip::Option::CmpProp::Shape + dip::Option::CmpProp::ColorSpace + dip::Option::CmpProp::PixelSize.

Macros

#define DIP_DECLARE_OPTIONS
Declare a type used to pass enumerated options to a function or class.