The library infrastructure module

The nuts and bolts that make it all work.

Modules

module Boundary
Handling image boundary extension for filtering.
module Error management
Exception classes and error management functionality.
module Frameworks
Functions that form the basis of most pixel-based processing in DIPlib.
module Iterators
Objects to iterate over images and image lines in different ways.
module Numeric algorithms and constants
Functions and constants to be used in numeric computation, unrelated to images.
module Overloading
Help with instantiating function templates and class templates for different pixel data types.
module Physical dimensions
Support for units, physical quantities and pixel sizes.
module Pixel data types
Types used for image samples (pixels), and related support functionality.
module Random
Pseudo-random generator and probability distributions.
module Saturated arithmetic and casts
These operators operate on single sample values, implementing saturated arithmetic and type casting.

Namespaces

namespace dip::Option
Enumerated options are defined in the namespace dip::Option, unless they are specific to some other sub-namespace.

Classes

class dip::ColorSpaceConverter
Base class for conversion between two color spaces.
class dip::ColorSpaceManager
An object of this class is used to convert images between color spaces.
class dip::Graph
A non-directed, edge-weighted graph.
class dip::LowestCommonAncestorSolver
Solves the lowest common ancestor problem for a tree.
class dip::Kernel
Represents the shape and size of a filtering kernel.
template<typename T>
class dip::DimensionArray
A dynamic array type optimized for few elements.
class dip::ExternalInterface
Support for external interfaces.
class dip::AlignedAllocInterface
ExternalInterface that allocates aligned data.
class dip::CoordinatesComputer
Computes pixel coordinates based on an index or offset.
class dip::Image::Sample
A sample represents a single numeric value in an image, see Image representation.
class dip::Image::Pixel
A pixel represents a set of numeric value in an image, see Image representation.
template<class T>
class dip::Image::CastSample
Derived from dip::Image::Sample, works identically except it implicitly converts to type T.
template<class T>
class dip::Image::CastPixel
Derived from dip::Image::Pixel, works identically except it implicitly converts to type T.
class dip::Image::View::Iterator
View iterator, similar in functionality to dip::GenericImageIterator.
class dip::Image::View
A view represents a subset of samples in an image. It can be assigned to to change those samples.
class dip::Image
Represents an image with all associated information.
class dip::Tensor
Describes the shape of a tensor, but doesn't actually contain tensor data.
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 = intercept + x * slope.
class dip::Metric
Represents a metric to be used to create a dip::NeighborList
class dip::NeighborList
Defines the neighborhood of a pixel as a set of coordinates, with optionally their distance.
class dip::PixelTableOffsets::iterator
An iterator that visits each of the neighborhood's pixels in turn.
class dip::PixelTableOffsets
Represents an arbitrarily-shaped neighborhood (filter support) in an arbitrary number of dimensions.
class dip::PixelTable::iterator
An iterator that visits each of the neighborhood's pixels in turn.
class dip::PixelTable
Represents an arbitrarily-shaped neighborhood (filter support) in an arbitrary number of dimensions.
template<typename IndexType_, typename ValueType_, typename UnionFunction_>
class dip::UnionFind
An STL-like data structure for the union-find algorithm.
template<typename IndexType_>
class dip::SimpleUnionFind
A simplified version of dip::UnionFind that doesn't store any information about the regions, only equivalences.
struct dip::LibraryInformation
Holds information about the DIPlib binary.

Typedefs

using DataSegment = std::shared_ptr<void>
A dip::Image holds a shared pointer to the data segment using this type.
using ImageArray = std::vector<Image>
An array of images.
using ImageRefArray = std::vector<std::reference_wrapper<Image>>
An array of image references.
using ImageConstRefArray = std::vector<std::reference_wrapper<Image const>>
An array of const image references.
using sint = std::ptrdiff_t
An integer type to be used for strides and similar measures.
using uint = std::size_t
An integer type to be used for sizes and the like.
using IntegerArray = DimensionArray<dip::sint>
An array to hold strides, filter sizes, etc.
using UnsignedArray = DimensionArray<dip::uint>
An array to hold dimensions, dimension lists, etc.
using FloatArray = DimensionArray<dip::dfloat>
An array to hold filter parameters.
using BooleanArray = DimensionArray<bool>
An array used as a dimension selector.
using CoordinateArray = std::vector<UnsignedArray>
An array of pixel coordinates.
using FloatCoordinateArray = std::vector<FloatArray>
An array of subpixel coordinates.
using String = std::string
A string, used to specify an option.
using StringArray = std::vector<String>
An array of strings, used to specify an option per dimension.
using StringSet = std::set<String>
A collection of strings, used to specify multiple independent options.
using RangeArray = DimensionArray<Range>
An array of ranges.

Functions

auto NonOwnedRefToDataSegment(void* ptr) -> DataSegment
This function converts a pointer to a dip::DataSegment that does not own the data pointed to.
auto NonOwnedRefToDataSegment(void const* ptr) -> DataSegment
This function converts a pointer to a dip::DataSegment that does not own the data pointed to.
template<typename T>
void ArrayUseParameter(DimensionArray<T>& array, dip::uint nDims, T defaultValue = {})
Check the length of an array, and extend it if necessary and possible.
auto BooleanFromString(String const& input, String const& trueString, String const& falseString) -> bool
Translates a string input parameter that is meant as a boolean value.
auto StringCompareCaseInsensitive(String const& string1, String const& string2) -> bool
A case-insensitive string comparison, use only with ASCII characters!
void ToLowerCase(String& string)
Convert a string to lower case, use only with ASCII characters!
void ToUpperCase(String& string)
Convert a string to upper case, use only with ASCII characters!
void SetNumberOfThreads(dip::uint nThreads)
Sets the maximum number of threads to be using in computations.
auto GetNumberOfThreads() -> dip::uint
Gets the maximum number of threads that can be used in computations.
template<typename T>
auto operator==(DimensionArray<T> const& lhs, DimensionArray<T> const& rhs) -> bool
Compares two arrays, returns true only if they have the same size and contain the same values.
template<typename T>
auto operator!=(DimensionArray<T> const& lhs, DimensionArray<T> const& rhs) -> bool
Compares two arrays, returns true if they have different size and/or contain different values.
template<typename T>
auto operator>(DimensionArray<T> const& lhs, DimensionArray<T> const& rhs) -> bool
Compares two arrays, returns true only if they have the same size and all lhs elements are larger than all rhs elements.
template<typename T>
auto operator<(DimensionArray<T> const& lhs, DimensionArray<T> const& rhs) -> bool
Compares two arrays, returns true only if they have the same size and all lhs elements are smaller than all rhs elements.
template<typename T>
auto operator>=(DimensionArray<T> const& lhs, DimensionArray<T> const& rhs) -> bool
Compares two arrays, returns true only if they have the same size and all lhs elements are larger or equal than all rhs elements.
template<typename T>
auto operator<=(DimensionArray<T> const& lhs, DimensionArray<T> const& rhs) -> bool
Compares two arrays, returns true only if they have the same size and all lhs elements are smaller or equal than all rhs elements.
template<typename T>
auto operator==(DimensionArray<T> const& lhs, T const& rhs) -> DimensionArray<bool>
Compares an array to a scalar, returns a boolean array.
template<typename T>
auto operator!=(DimensionArray<T> const& lhs, T const& rhs) -> DimensionArray<bool>
Compares an array to a scalar, returns a boolean array.
template<typename T>
auto operator>(DimensionArray<T> const& lhs, T const& rhs) -> DimensionArray<bool>
Compares an array to a scalar, returns a boolean array.
template<typename T>
auto operator<(DimensionArray<T> const& lhs, T const& rhs) -> DimensionArray<bool>
Compares an array to a scalar, returns a boolean array.
template<typename T>
auto operator>=(DimensionArray<T> const& lhs, T const& rhs) -> DimensionArray<bool>
Compares an array to a scalar, returns a boolean array.
template<typename T>
auto operator<=(DimensionArray<T> const& lhs, T const& rhs) -> DimensionArray<bool>
Compares an array to a scalar, returns a boolean array.
template<typename T>
auto operator<<(std::ostream& os, DimensionArray<T> const& array) -> std::ostream&
Writes the array to a stream.
template<typename T>
void sortIndices(DimensionArray<typename DimensionArray<T>::size_type>& indices, DimensionArray<T> const& data)
Sorts the indices array with indices into the data array, from smallest to largest. The sort is stable.
template<typename T>
auto SquareDistance(DimensionArray<T> const& v1, DimensionArray<T> const& v2) -> double
Computes the Square Euclidean distance between two points.
template<typename T>
auto Distance(DimensionArray<T> const& v1, DimensionArray<T> const& v2) -> double
Computes the Square Euclidean distance between two points.
auto operator<<(std::ostream& os, Image const& img) -> std::ostream&
You can output a dip::Image to std::cout or any other stream. Some information about the image is printed.
auto Alias(Image const& img1, Image const& img2) -> bool
Calls img1.Aliases( img2 ). See dip::Image::Aliases.
void DefineROI(Image const& src, Image& dest, UnsignedArray origin = {}, UnsignedArray sizes = {}, UnsignedArray spacing = {})
Makes a new image object pointing to same pixel data as src, but with different origin, strides and size.
void Copy(Image const& src, Image& dest)
Copies samples over from src to dest, identical to the dip::Image::Copy method.
void Copy(Image::View const& src, Image& dest)
Copies samples over from src to dest, identical to the dip::Image::Copy method.
void Copy(Image const& src, Image::View& dest)
Copies samples over from src to dest, identical to the dip::Image::View::Copy method.
void Copy(Image::View const& src, Image::View& dest)
Copies samples over from src to dest, identical to the dip::Image::View::Copy method.
void CopyFrom(Image const& src, Image& dest, Image const& srcMask)
Copies the pixels selected by srcMask in src over to dest. dest will be a 1D image.
void CopyFrom(Image const& src, Image& dest, IntegerArray const& srcOffsets)
Copies the pixels selected by srcOffsets over from src to dest. dest will be a 1D image.
void CopyTo(Image const& src, Image& dest, Image const& destMask)
Copies all pixels from src over to the pixels selected by destMask in dest. dest must be forged.
void CopyTo(Image const& src, Image& dest, IntegerArray const& destOffsets)
Copies all pixels from src over to the pixels selected by destOffsets in dest. dest must be forged.
void ExpandTensor(Image const& src, Image& dest)
Copies samples over from src to dest, expanding the tensor so it's a standard, column-major matrix.
void Convert(Image const& src, Image& dest, dip::DataType dt)
Copies samples over from src to dest, with data type conversion.
auto CreateImageRefArray(ImageArray& imar) -> ImageRefArray
Creates a dip::ImageRefArray from a dip::ImageArray.
auto CreateImageConstRefArray(ImageArray const& imar) -> ImageConstRefArray
Creates a dip::ImageConstRefArray from a dip::ImageArray.
auto operator<<(std::ostream& os, Image::Sample const& sample) -> std::ostream&
You can output a dip::Image::Sample to std::cout or any other stream. It is printed like any numeric value of the same type.
auto operator+(Image::Pixel const& lhs, Image::Pixel const& rhs) -> Image::Pixel
Arithmetic operator, element-wise.
auto operator-(Image::Pixel const& lhs, Image::Pixel const& rhs) -> Image::Pixel
Arithmetic operator, element-wise.
auto operator*(Image::Pixel const& lhs, Image::Pixel const& rhs) -> Image::Pixel
Arithmetic operator, tensor multiplication.
auto operator/(Image::Pixel const& lhs, Image::Pixel const& rhs) -> Image::Pixel
Arithmetic operator, element-wise.
auto operator%(Image::Pixel const& lhs, Image::Pixel const& rhs) -> Image::Pixel
Arithmetic operator, element-wise.
auto operator&(Image::Pixel const& lhs, Image::Pixel const& rhs) -> Image::Pixel
Bit-wise operator, element-wise.
auto operator|(Image::Pixel const& lhs, Image::Pixel const& rhs) -> Image::Pixel
Bit-wise operator, element-wise.
auto operator^(Image::Pixel const& lhs, Image::Pixel const& rhs) -> Image::Pixel
Bit-wise operator, element-wise.
auto operator-(Image::Pixel const& in) -> Image::Pixel
Unary operator, element-wise.
auto operator~(Image::Pixel const& in) -> Image::Pixel
Bit-wise unary operator operator.
auto operator!(Image::Pixel const& in) -> Image::Pixel
Boolean unary operator, element-wise.
auto operator==(Image::Pixel const& lhs, Image::Pixel const& rhs) -> bool
Comparison operator, can only be true if the two pixels have compatible number of tensor elements.
template<typename T, typename = std::enable_if_t<IsNumericType<T>::value>>
auto operator!=(Image::Pixel const& lhs, T const& rhs) -> bool
Comparison operator, equivalent to !(lhs==rhs).
auto operator<(Image::Pixel const& lhs, Image::Pixel const& rhs) -> bool
Comparison operator, can only be true if the two pixels have compatible number of tensor elements.
auto operator>(Image::Pixel const& lhs, Image::Pixel const& rhs) -> bool
Comparison operator, can only be true if the two pixels have compatible number of tensor elements.
auto operator<=(Image::Pixel const& lhs, Image::Pixel const& rhs) -> bool
Comparison operator, can only be true if the two pixels have compatible number of tensor elements.
auto operator>=(Image::Pixel const& lhs, Image::Pixel const& rhs) -> bool
Comparison operator, can only be true if the two pixels have compatible number of tensor elements.
auto operator<<(std::ostream& os, Image::Pixel const& pixel) -> std::ostream&
You can output a dip::Image::Pixel to std::cout or any other stream. It is printed as a sequence of values, prepended with "Pixel with values:".
auto operator<<(std::ostream& os, Tensor const& tensor) -> std::ostream&
Prints information about the tensor.

Variables

const LibraryInformation libraryInformation
Constant that holds information about the DIPlib binary.

Typedef documentation

using DataSegment = std::shared_ptr<void>
#include <diplib.h>

A dip::Image holds a shared pointer to the data segment using this type.

using ImageArray = std::vector<Image>
#include <diplib.h>

An array of images.

using ImageRefArray = std::vector<std::reference_wrapper<Image>>
#include <diplib.h>

An array of image references.

using ImageConstRefArray = std::vector<std::reference_wrapper<Image const>>
#include <diplib.h>

An array of const image references.

using sint = std::ptrdiff_t
#include <diplib.h>

An integer type to be used for strides and similar measures.

using uint = std::size_t
#include <diplib.h>

An integer type to be used for sizes and the like.

using IntegerArray = DimensionArray<dip::sint>
#include <diplib.h>

An array to hold strides, filter sizes, etc.

using UnsignedArray = DimensionArray<dip::uint>
#include <diplib.h>

An array to hold dimensions, dimension lists, etc.

using FloatArray = DimensionArray<dip::dfloat>
#include <diplib.h>

An array to hold filter parameters.

using BooleanArray = DimensionArray<bool>
#include <diplib.h>

An array used as a dimension selector.

using CoordinateArray = std::vector<UnsignedArray>
#include <diplib.h>

An array of pixel coordinates.

using FloatCoordinateArray = std::vector<FloatArray>
#include <diplib.h>

An array of subpixel coordinates.

using String = std::string
#include <diplib.h>

A string, used to specify an option.

using StringArray = std::vector<String>
#include <diplib.h>

An array of strings, used to specify an option per dimension.

using StringSet = std::set<String>
#include <diplib.h>

A collection of strings, used to specify multiple independent options.

using RangeArray = DimensionArray<Range>
#include <diplib.h>

An array of ranges.

Function documentation

DataSegment NonOwnedRefToDataSegment(void* ptr)
#include <diplib.h>

This function converts a pointer to a dip::DataSegment that does not own the data pointed to.

DataSegment NonOwnedRefToDataSegment(void const* ptr)
#include <diplib.h>

This function converts a pointer to a dip::DataSegment that does not own the data pointed to.

#include <diplib.h>
template<typename T>
void ArrayUseParameter(DimensionArray<T>& array, dip::uint nDims, T defaultValue = {})

Check the length of an array, and extend it if necessary and possible.

This function is used where a function's input parameter is an array that is supposed to match the image dimensionality nDims. The user can give an array of that length, or an array with a single value, which will be used for all dimensions, or an empty array, in which case the default value defaultValue will be used for all dimensions.

bool BooleanFromString(String const& input, String const& trueString, String const& falseString)
#include <diplib.h>

Translates a string input parameter that is meant as a boolean value.

bool StringCompareCaseInsensitive(String const& string1, String const& string2)
#include <diplib.h>

A case-insensitive string comparison, use only with ASCII characters!

void ToLowerCase(String& string)
#include <diplib.h>

Convert a string to lower case, use only with ASCII characters!

void ToUpperCase(String& string)
#include <diplib.h>

Convert a string to upper case, use only with ASCII characters!

void SetNumberOfThreads(dip::uint nThreads)

Sets the maximum number of threads to be using in computations.

The default maximum number of threads is given by the OMP_NUM_THREADS environment variable if set, or the number of CPU cores otherwise.

Note that parallelized algorithms only spawn multiple threads for the computation if the amount of work to be done is large enough to compensate for the overhead of spawning threads.

If nThreads is 1, disables multithreading within DIPlib. Usually it is more beneficial to manage multithreading at a higher level, for example by processing multiple images at the same time. If yo do so, set nThreads to 1.

If nThreads is 0, resets the maximum number of threads to the default value.

If DIPlib was compiled without OpenMP support, this function does nothing.

dip::uint GetNumberOfThreads()

Gets the maximum number of threads that can be used in computations.

Returns the value given in the last call to dip::SetNumberOfThreads, or the default maximum value if that function was never called.

If DIPlib was compiled without OpenMP support, this function always returns 1.

#include <diplib.h>
template<typename T>
bool operator==(DimensionArray<T> const& lhs, DimensionArray<T> const& rhs)

Compares two arrays, returns true only if they have the same size and contain the same values.

#include <diplib.h>
template<typename T>
bool operator!=(DimensionArray<T> const& lhs, DimensionArray<T> const& rhs)

Compares two arrays, returns true if they have different size and/or contain different values.

#include <diplib.h>
template<typename T>
bool operator>(DimensionArray<T> const& lhs, DimensionArray<T> const& rhs)

Compares two arrays, returns true only if they have the same size and all lhs elements are larger than all rhs elements.

#include <diplib.h>
template<typename T>
bool operator<(DimensionArray<T> const& lhs, DimensionArray<T> const& rhs)

Compares two arrays, returns true only if they have the same size and all lhs elements are smaller than all rhs elements.

#include <diplib.h>
template<typename T>
bool operator>=(DimensionArray<T> const& lhs, DimensionArray<T> const& rhs)

Compares two arrays, returns true only if they have the same size and all lhs elements are larger or equal than all rhs elements.

#include <diplib.h>
template<typename T>
bool operator<=(DimensionArray<T> const& lhs, DimensionArray<T> const& rhs)

Compares two arrays, returns true only if they have the same size and all lhs elements are smaller or equal than all rhs elements.

#include <diplib.h>
template<typename T>
DimensionArray<bool> operator==(DimensionArray<T> const& lhs, T const& rhs)

Compares an array to a scalar, returns a boolean array.

#include <diplib.h>
template<typename T>
DimensionArray<bool> operator!=(DimensionArray<T> const& lhs, T const& rhs)

Compares an array to a scalar, returns a boolean array.

#include <diplib.h>
template<typename T>
DimensionArray<bool> operator>(DimensionArray<T> const& lhs, T const& rhs)

Compares an array to a scalar, returns a boolean array.

#include <diplib.h>
template<typename T>
DimensionArray<bool> operator<(DimensionArray<T> const& lhs, T const& rhs)

Compares an array to a scalar, returns a boolean array.

#include <diplib.h>
template<typename T>
DimensionArray<bool> operator>=(DimensionArray<T> const& lhs, T const& rhs)

Compares an array to a scalar, returns a boolean array.

#include <diplib.h>
template<typename T>
DimensionArray<bool> operator<=(DimensionArray<T> const& lhs, T const& rhs)

Compares an array to a scalar, returns a boolean array.

#include <diplib.h>
template<typename T>
std::ostream& operator<<(std::ostream& os, DimensionArray<T> const& array)

Writes the array to a stream.

#include <diplib.h>
template<typename T>
void sortIndices(DimensionArray<typename DimensionArray<T>::size_type>& indices, DimensionArray<T> const& data)

Sorts the indices array with indices into the data array, from smallest to largest. The sort is stable.

#include <diplib.h>
template<typename T>
double SquareDistance(DimensionArray<T> const& v1, DimensionArray<T> const& v2)

Computes the Square Euclidean distance between two points.

#include <diplib.h>
template<typename T>
double Distance(DimensionArray<T> const& v1, DimensionArray<T> const& v2)

Computes the Square Euclidean distance between two points.

std::ostream& operator<<(std::ostream& os, Image const& img)
#include <diplib.h>

You can output a dip::Image to std::cout or any other stream. Some information about the image is printed.

bool Alias(Image const& img1, Image const& img2)
#include <diplib.h>

Calls img1.Aliases( img2 ). See dip::Image::Aliases.

void DefineROI(Image const& src, Image& dest, UnsignedArray origin = {}, UnsignedArray sizes = {}, UnsignedArray spacing = {})
#include <diplib.h>

Makes a new image object pointing to same pixel data as src, but with different origin, strides and size.

This function does the same as dip::Image::At, but allows for more flexible defaults: If origin, sizes or spacing have only one value, that value is repeated for each dimension. For empty arrays, origin defaults to all zeros, sizes to src.Sizes() - origin, and spacing to all ones. These defaults make it easy to crop pixels from one side of the image, to subsample the image, etc. For example, the following code subsamples by a factor 2 in each dimension:

DefineROI( src, dest, {}, {}, { 2 } );

void Copy(Image const& src, Image& dest)
#include <diplib.h>

Copies samples over from src to dest, identical to the dip::Image::Copy method.

void Copy(Image::View const& src, Image& dest)
#include <diplib.h>

Copies samples over from src to dest, identical to the dip::Image::Copy method.

void Copy(Image const& src, Image::View& dest)
#include <diplib.h>

Copies samples over from src to dest, identical to the dip::Image::View::Copy method.

void Copy(Image::View const& src, Image::View& dest)
#include <diplib.h>

Copies samples over from src to dest, identical to the dip::Image::View::Copy method.

void CopyFrom(Image const& src, Image& dest, Image const& srcMask)
#include <diplib.h>

Copies the pixels selected by srcMask in src over to dest. dest will be a 1D image.

If dest is already forged and has the right number of pixels and tensor elements, it will not be reforged. In this case, the copy will apply data type conversion, where values are clipped to the target range and/or truncated, as applicable, and complex values are converted to non-complex values by taking the absolute value.

void CopyFrom(Image const& src, Image& dest, IntegerArray const& srcOffsets)
#include <diplib.h>

Copies the pixels selected by srcOffsets over from src to dest. dest will be a 1D image.

If dest is already forged and has the right number of pixels and tensor elements, it will not be reforged. In this case, the copy will apply data type conversion, where values are clipped to the target range and/or truncated, as applicable, and complex values are converted to non-complex values by taking the absolute value.

void CopyTo(Image const& src, Image& dest, Image const& destMask)
#include <diplib.h>

Copies all pixels from src over to the pixels selected by destMask in dest. dest must be forged.

void CopyTo(Image const& src, Image& dest, IntegerArray const& destOffsets)
#include <diplib.h>

Copies all pixels from src over to the pixels selected by destOffsets in dest. dest must be forged.

void ExpandTensor(Image const& src, Image& dest)
#include <diplib.h>

Copies samples over from src to dest, expanding the tensor so it's a standard, column-major matrix.

If the tensor representation in src is one of those that do not save symmetric or zero values, to save space, a new data segment will be allocated for dest, where the tensor representation is a column-major matrix (dest will have dip::Tensor::HasNormalOrder be true). Otherwise, dest will share the data segment with src. This function simplifies manipulating tensors by normalizing their storage.

void Convert(Image const& src, Image& dest, dip::DataType dt)
#include <diplib.h>

Copies samples over from src to dest, with data type conversion.

If dest is forged, has the same size as number of tensor elements as src, and has data type dt, then its data segment is reused. If src and dest are the same object, its dip::Image::Convert method is called instead.

The data type conversion clips values to the target range and/or truncates them, as applicable. Complex values are converted to non-complex values by taking the absolute value.

ImageRefArray CreateImageRefArray(ImageArray& imar)
#include <diplib.h>

Creates a dip::ImageRefArray from a dip::ImageArray.

ImageConstRefArray CreateImageConstRefArray(ImageArray const& imar)
#include <diplib.h>

Creates a dip::ImageConstRefArray from a dip::ImageArray.

std::ostream& operator<<(std::ostream& os, Image::Sample const& sample)
#include <diplib.h>

You can output a dip::Image::Sample to std::cout or any other stream. It is printed like any numeric value of the same type.

Image::Pixel operator+(Image::Pixel const& lhs, Image::Pixel const& rhs)
#include <diplib.h>

Arithmetic operator, element-wise.

Image::Pixel operator-(Image::Pixel const& lhs, Image::Pixel const& rhs)
#include <diplib.h>

Arithmetic operator, element-wise.

Image::Pixel operator*(Image::Pixel const& lhs, Image::Pixel const& rhs)
#include <diplib.h>

Arithmetic operator, tensor multiplication.

Image::Pixel operator/(Image::Pixel const& lhs, Image::Pixel const& rhs)
#include <diplib.h>

Arithmetic operator, element-wise.

Image::Pixel operator%(Image::Pixel const& lhs, Image::Pixel const& rhs)
#include <diplib.h>

Arithmetic operator, element-wise.

Image::Pixel operator&(Image::Pixel const& lhs, Image::Pixel const& rhs)
#include <diplib.h>

Bit-wise operator, element-wise.

Image::Pixel operator|(Image::Pixel const& lhs, Image::Pixel const& rhs)
#include <diplib.h>

Bit-wise operator, element-wise.

Image::Pixel operator^(Image::Pixel const& lhs, Image::Pixel const& rhs)
#include <diplib.h>

Bit-wise operator, element-wise.

Image::Pixel operator-(Image::Pixel const& in)
#include <diplib.h>

Unary operator, element-wise.

Image::Pixel operator~(Image::Pixel const& in)
#include <diplib.h>

Bit-wise unary operator operator.

Image::Pixel operator!(Image::Pixel const& in)
#include <diplib.h>

Boolean unary operator, element-wise.

bool operator==(Image::Pixel const& lhs, Image::Pixel const& rhs)
#include <diplib.h>

Comparison operator, can only be true if the two pixels have compatible number of tensor elements.

#include <diplib.h>
template<typename T, typename = std::enable_if_t<IsNumericType<T>::value>>
bool operator!=(Image::Pixel const& lhs, T const& rhs)

Comparison operator, equivalent to !(lhs==rhs).

bool operator<(Image::Pixel const& lhs, Image::Pixel const& rhs)
#include <diplib.h>

Comparison operator, can only be true if the two pixels have compatible number of tensor elements.

bool operator>(Image::Pixel const& lhs, Image::Pixel const& rhs)
#include <diplib.h>

Comparison operator, can only be true if the two pixels have compatible number of tensor elements.

bool operator<=(Image::Pixel const& lhs, Image::Pixel const& rhs)
#include <diplib.h>

Comparison operator, can only be true if the two pixels have compatible number of tensor elements.

bool operator>=(Image::Pixel const& lhs, Image::Pixel const& rhs)
#include <diplib.h>

Comparison operator, can only be true if the two pixels have compatible number of tensor elements.

std::ostream& operator<<(std::ostream& os, Image::Pixel const& pixel)
#include <diplib.h>

You can output a dip::Image::Pixel to std::cout or any other stream. It is printed as a sequence of values, prepended with "Pixel with values:".

std::ostream& operator<<(std::ostream& os, Tensor const& tensor)
#include <diplib.h>

Prints information about the tensor.

Variable documentation

const LibraryInformation libraryInformation
#include <diplib.h>

Constant that holds information about the DIPlib binary.