diplib/library/operators.h file

Declares the overloaded arithmetic, logical and comparison operators for dip::Image. This file is always included through diplib.h. See Arithmetic operators, Comparison operators.

Contents

Functions

void dip::Add(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out, dip::DataType dt)
Adds two images, sample-wise, with singleton expansion, and using saturated arithmetic.
void dip::Subtract(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out, dip::DataType dt)
Subtracts two images, sample-wise, with singleton expansion, and using saturated arithmetic.
void dip::Multiply(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out, dip::DataType dt)
Multiplies two images, pixel-wise, with singleton expansion, and using saturated arithmetic.
void dip::MultiplySampleWise(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out, dip::DataType dt)
Multiplies two images, sample-wise, with singleton expansion, and using saturated arithmetic.
void dip::MultiplyConjugate(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out, dip::DataType dt)
Multiplies two images with complex conjugation, sample-wise, with singleton expansion.
void dip::Divide(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out, dip::DataType dt)
Divides two images, sample-wise, with singleton expansion.
void dip::SafeDivide(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out, dip::DataType dt)
Divides two images, sample-wise, with singleton expansion. Tests for division by zero, filling in 0 instead.
void dip::Modulo(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out, dip::DataType dt)
Computes the modulo of two images, sample-wise, with singleton expansion.
void dip::Power(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out, dip::DataType dt)
Elevates lhs to the power of rhs, sample-wise, with singleton expansion.
void dip::Invert(dip::Image const& in, dip::Image& out)
Inverts each sample of the input image, yielding an image of the same type.
void dip::And(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out)
Bit-wise AND of two integer images, or logical AND of two binary images, sample-wise, with singleton expansion.
void dip::Or(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out)
Bit-wise OR of two integer images, or logical OR of two binary images, sample-wise, with singleton expansion.
void dip::Xor(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out)
Bit-wise XOR of two integer images, or logical XOR of two binary images, sample-wise, with singleton expansion.
void dip::Not(dip::Image const& in, dip::Image& out)
Bit-wise NOT of an integer image, or logical NOT of a binary image, sample-wise.
void dip::Equal(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out)
Equality comparison, sample-wise, with singleton expansion.
void dip::NotEqual(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out)
Inequality comparison, sample-wise, with singleton expansion.
void dip::Lesser(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out)
Inequality comparison, sample-wise, with singleton expansion.
void dip::Greater(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out)
Inequality comparison, sample-wise, with singleton expansion.
void dip::NotGreater(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out)
Inequality comparison, sample-wise, with singleton expansion.
void dip::NotLesser(dip::Image const& lhs, dip::Image const& rhs, dip::Image& out)
Inequality comparison, sample-wise, with singleton expansion.
void dip::InRange(dip::Image const& in, dip::Image const& lhs, dip::Image const& rhs, dip::Image& out)
In-range ternary comparison, sample-wise, with singleton expansion.
void dip::OutOfRange(dip::Image const& in, dip::Image const& lhs, dip::Image const& rhs, dip::Image& out)
Out-of-range ternary comparison, sample-wise, with singleton expansion.

Operators

template<typename T1, typename T2, typename <SFINAE> = T1>
auto dip::operator+(T1 const& lhs, T2 const& rhs) -> dip::Image
Arithmetic operator, calls dip::Add.
template<typename T1, typename T2, typename <SFINAE> = T1>
auto dip::operator-(T1 const& lhs, T2 const& rhs) -> dip::Image
Arithmetic operator, calls dip::Subtract.
template<typename T1, typename T2, typename <SFINAE> = T1>
auto dip::operator*(T1 const& lhs, T2 const& rhs) -> dip::Image
Arithmetic operator, calls dip::Multiply.
template<typename T1, typename T2, typename <SFINAE> = T1>
auto dip::operator/(T1 const& lhs, T2 const& rhs) -> dip::Image
Arithmetic operator, calls dip::Divide.
template<typename T1, typename T2, typename <SFINAE> = T1>
auto dip::operator%(T1 const& lhs, T2 const& rhs) -> dip::Image
Arithmetic operator, calls dip::Modulo.
template<typename T>
auto dip::operator&(dip::Image const& lhs, T const& rhs) -> dip::Image
Bit-wise and logical operator, calls dip::And.
template<typename T>
auto dip::operator|(dip::Image const& lhs, T const& rhs) -> dip::Image
Bit-wise and logical operator, calls dip::Or.
template<typename T>
auto dip::operator^(dip::Image const& lhs, T const& rhs) -> dip::Image
Bit-wise and logical operator, calls dip::Xor.
auto dip::operator+(dip::Image const& in) -> dip::Image
Unary operator, converts binary image to dip::DT_UINT, leaves other images unchanged.
auto dip::operator-(dip::Image const& in) -> dip::Image
Unary operator, calls dip::Invert.
auto dip::operator~(dip::Image const& in) -> dip::Image
Bit-wise and logical unary operator, calls dip::Not.
auto dip::operator!(dip::Image const& in) -> dip::Image
Logical unary operator. The input is converted to a binary image, then calls dip::Invert.
template<typename T>
auto dip::operator+=(dip::Image& lhs, T const& rhs) -> dip::Image&
Compound assignment operator, calls dip::Add.
template<typename T>
auto dip::operator-=(dip::Image& lhs, T const& rhs) -> dip::Image&
Compound assignment operator, calls dip::Subtract.
template<typename T>
auto dip::operator*=(dip::Image& lhs, T const& rhs) -> dip::Image&
Compound assignment operator, calls dip::Multiply.
template<typename T>
auto dip::operator/=(dip::Image& lhs, T const& rhs) -> dip::Image&
Compound assignment operator, calls dip::Divide.
template<typename T>
auto dip::operator%=(dip::Image& lhs, T const& rhs) -> dip::Image&
Compound assignment operator, calls dip::Modulo.
template<typename T>
auto dip::operator&=(dip::Image& lhs, T const& rhs) -> dip::Image&
Bit-wise compound assignment operator, calls dip::And.
template<typename T>
auto dip::operator|=(dip::Image& lhs, T const& rhs) -> dip::Image&
Bit-wise compound assignment operator, calls dip::Or.
template<typename T>
auto dip::operator^=(dip::Image& lhs, T const& rhs) -> dip::Image&
Bit-wise compound assignment operator, calls dip::Xor.
template<typename T>
auto dip::operator==(dip::Image const& lhs, T const& rhs) -> dip::Image
Comparison operator, calls dip::Equal.
template<typename T>
auto dip::operator!=(dip::Image const& lhs, T const& rhs) -> dip::Image
Comparison operator, calls dip::NotEqual.
template<typename T>
auto dip::operator<(dip::Image const& lhs, T const& rhs) -> dip::Image
Comparison operator, calls dip::Lesser.
template<typename T>
auto dip::operator>(dip::Image const& lhs, T const& rhs) -> dip::Image
Comparison operator, calls dip::Greater.
template<typename T>
auto dip::operator<=(dip::Image const& lhs, T const& rhs) -> dip::Image
Comparison operator, calls dip::NotGreater.
template<typename T>
auto dip::operator>=(dip::Image const& lhs, T const& rhs) -> dip::Image
Comparison operator, calls dip::NotLesser.