40#ifndef H_IMAGE_ALGOS_MORPHO_MATH_H
41#define H_IMAGE_ALGOS_MORPHO_MATH_H
65 base_mem_ = source_->base_mem();
66 width_ = source_->width();
87 (xrel +
int(width_) * yrel) *
int(bytes_per_pixel_)
89 radius_ = std::max(radius_,
index_t(std::abs(xrel)));
90 radius_ = std::max(radius_,
index_t(std::abs(yrel)));
110 int pixel_base = ((x + int(width_) * y) *
int(bytes_per_pixel_));
112 base_mem_ + pixel_base, target_img->
base_mem() + pixel_base
122 size_t bytes_per_pixel_;
162 size_t bytes_per_pixel_;
163 size_t bytes_per_line_;
Memory::pointer base_mem() const
Gets the base memory.
size_t bytes_per_pixel() const
Gets the number of bytes per pixel.
Implements morphological operators for images.
void dilate(index_t nb_iterations=1)
Computes a dilation with a default structuring element.
~MorphoMath()
MorphoMath destructor;.
MorphoMath(Image *target)
MorphoMath constructor.
void dilate(const StructuringElement &elt, index_t nb_iterations=1)
Computes a dilation.
A structuring element, that is the definition of neighborhood used by a morphological operation.
void convolve(Memory::byte *from, Memory::byte *to) const
Computes the convolution at a given memory location.
void convolve(int x, int y, Image *target_img) const
Computes the convolution at a given pixel.
void add_neighbor(int xrel, int yrel)
Adds a neighbor to this structuting element.
index_t radius() const
Gets the radius.
StructuringElement(Image *source)
StructuringElement constructor.
Vector with aligned memory allocation.
Common include file, providing basic definitions. Should be included before anything else by all head...
unsigned char byte
Unsigned byte type.
Global Vorpaline namespace.
geo_index_t index_t
The type for storing and manipulating indices.