ddt 1.2.1
Loading...
Searching...
No Matches
imageMath.hpp File Reference

Image arithmetical function declaration. This file is part of the DDT Image Handling Library and provides functions to perform arithmetical computations on CPL images. More...

#include <vector>
#include <cpl.h>

Go to the source code of this file.

Functions

bool AddCplImages (cpl_image *image1, const cpl_image *image2)
 
cpl_image * AddCplImagesCreate (const cpl_image *image1, const cpl_image *image2)
 
bool AddScalarCplImage (cpl_image *image, double scalar)
 
cpl_image * AddScalarCplImageCreate (const cpl_image *image, double scalar)
 
bool SubtractCplImages (cpl_image *image1, const cpl_image *image2)
 
cpl_image * SubtractCplImagesCreate (const cpl_image *image1, const cpl_image *image2)
 
bool SubtractScalarCplImage (cpl_image *image, double scalar)
 
cpl_image * SubtractScalarCplImageCreate (const cpl_image *image, double scalar)
 
bool MultiplyCplImages (cpl_image *image1, const cpl_image *image2)
 
cpl_image * MultiplyCplImagesCreate (const cpl_image *image1, const cpl_image *image2)
 
bool MultiplyScalarCplImage (cpl_image *image, double scalar)
 
cpl_image * MultiplyScalarCplImageCreate (const cpl_image *image, double scalar)
 
bool DivideCplImages (cpl_image *image1, const cpl_image *image2)
 
cpl_image * DivideCplImagesCreate (const cpl_image *image1, const cpl_image *image2)
 
bool DivideScalarCplImage (cpl_image *image, double scalar)
 
cpl_image * DivideScalarCplImageCreate (const cpl_image *image, double scalar)
 

Detailed Description

Image arithmetical function declaration. This file is part of the DDT Image Handling Library and provides functions to perform arithmetical computations on CPL images.

Author
Christoph Bortlisz, CGI
Since
2020/07/29

Function Documentation

◆ AddCplImages()

bool AddCplImages ( cpl_image * image1,
const cpl_image * image2 )

This file is part of the DDT Image Handling Library and provides functions to perform arithmetical computations on CPL images.. Add two images. The result will be stored in the first image, which will be modified according to the result of the operation

Parameters
image1first CPL image object, will also contain the result of the addition
image2second CPL image object
Returns
bool indicating success of addition; the operation will fail in case that the images have different sizes or if one has a complex image type, while the other one has not

◆ AddCplImagesCreate()

cpl_image * AddCplImagesCreate ( const cpl_image * image1,
const cpl_image * image2 )

Add two images. This function returns the newly created image. It supports images with different types. The returned image has the type of the first passed image.

Parameters
image1first CPL image object
image2second CPL image object
Returns
cpl_image the newly created image, or NULL on failure; the operation will fail in case that the images have different sizes or if one has a complex image type, while the other one has not

◆ AddScalarCplImage()

bool AddScalarCplImage ( cpl_image * image,
double scalar )

Add scalar to CPL image. The result will be stored in the provided image.

Parameters
imageCPL image object, will also contain the result of the addition
scalarthe number to be added elementwise to the CPL image
Returns
bool indicating success of addition

◆ AddScalarCplImageCreate()

cpl_image * AddScalarCplImageCreate ( const cpl_image * image,
double scalar )

Add scalar to CPL image. This function returns a newly created image containing the result of the addition.

Parameters
imageCPL image object
scalarthe number to be added elementwise to the CPL image
Returns
cpl_image the newly created image, or NULL on failure

◆ DivideCplImages()

bool DivideCplImages ( cpl_image * image1,
const cpl_image * image2 )

Divide two images. The result will be stored in the first image, which will be modified according to the result of the operation

Parameters
image1first CPL image object, will also contain the result of the division
image2second CPL image object
Returns
bool indicating success of division; the operation will fail in case that the images have different sizes, if one has a complex image type, while the other one has not or if all pixels in the divisor image are zero

◆ DivideCplImagesCreate()

cpl_image * DivideCplImagesCreate ( const cpl_image * image1,
const cpl_image * image2 )

Divide two images. This function returns the newly created image. It supports images with different types. The returned image has the type of the first passed image.

Parameters
image1first CPL image object
image2second CPL image object
Returns
cpl_image the newly created image, or NULL on failure; the operation will fail in case that the images have different sizes, if one has a complex image type, while the other one has not or if all pixels in the divisor image are zero

◆ DivideScalarCplImage()

bool DivideScalarCplImage ( cpl_image * image,
double scalar )

Divide CPL image with scalar. The result will be stored in the provided image. The scalar value has to be non-zero, otherwise an error will be returned

Parameters
imageCPL image object, will also contain the result of the division
scalarthe number to divide the CPL image elementwise with
Returns
bool indicating success of division

◆ DivideScalarCplImageCreate()

cpl_image * DivideScalarCplImageCreate ( const cpl_image * image,
double scalar )

Divide CPL image with scalar. This function returns a newly created image containing the result of the division. The scalar value has to be non-zero, otherwise an error will be returned

Parameters
imageCPL image object
scalarthe number to divide the CPL image elementwise with
Returns
cpl_image the newly created image, or NULL on failure

◆ MultiplyCplImages()

bool MultiplyCplImages ( cpl_image * image1,
const cpl_image * image2 )

Multiply two images. The result will be stored in the first image, which will be modified according to the result of the operation

Parameters
image1first CPL image object, will also contain the result of the multiplication
image2second CPL image object
Returns
bool indicating success of multiplication; the operation will fail in case that the images have different sizes or if one has a complex image type, while the other one has not

◆ MultiplyCplImagesCreate()

cpl_image * MultiplyCplImagesCreate ( const cpl_image * image1,
const cpl_image * image2 )

Multiply two images. This function returns the newly created image. It supports images with different types. The returned image has the type of the first passed image.

Parameters
image1first CPL image object
image2second CPL image object
Returns
cpl_image the newly created image, or NULL on failure; the operation will fail in case that the images have different sizes or if one has a complex image type, while the other one has not

◆ MultiplyScalarCplImage()

bool MultiplyScalarCplImage ( cpl_image * image,
double scalar )

Multiply scalar with CPL image. The result will be stored in the provided image.

Parameters
imageCPL image object, will also contain the result of the multiplication
scalarthe number to be multiplied elementwise with the CPL image
Returns
bool indicating success of multiplication

◆ MultiplyScalarCplImageCreate()

cpl_image * MultiplyScalarCplImageCreate ( const cpl_image * image,
double scalar )

Multiply scalar with CPL image. This function returns a newly created image containing the result of the multiplication.

Parameters
imageCPL image object
scalarthe number to be multiplied elementwise with the CPL image
Returns
cpl_image the newly created image, or NULL on failure

◆ SubtractCplImages()

bool SubtractCplImages ( cpl_image * image1,
const cpl_image * image2 )

Subtract two images. The result will be stored in the first image, which will be modified according to the result of the operation

Parameters
image1first CPL image object, will also contain the result of the subtraction
image2second CPL image object
Returns
bool indicating success of subtraction; the operation will fail in case that the images have different sizes or if one has a complex image type, while the other one has not

◆ SubtractCplImagesCreate()

cpl_image * SubtractCplImagesCreate ( const cpl_image * image1,
const cpl_image * image2 )

Subtract two images. This function returns the newly created image. It supports images with different types. The returned image has the type of the first passed image.

Parameters
image1first CPL image object
image2second CPL image object
Returns
cpl_image the newly created image, or NULL on failure; the operation will fail in case that the images have different sizes or if one has a complex image type, while the other one has not

◆ SubtractScalarCplImage()

bool SubtractScalarCplImage ( cpl_image * image,
double scalar )

Subtract scalar from CPL image. The result will be stored in the provided image.

Parameters
imageCPL image object, will also contain the result of the subtraction
scalarthe number to be subtracted elementwise from the CPL image
Returns
bool indicating success of subtraction

◆ SubtractScalarCplImageCreate()

cpl_image * SubtractScalarCplImageCreate ( const cpl_image * image,
double scalar )

Subtract scalar from CPL image. This function returns a newly created image containing the result of the subtraction.

Parameters
imageCPL image object
scalarthe number to be subtracted elementwise from the CPL image
Returns
cpl_image the newly created image, or NULL on failure