Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a89f31c9 authored by CAILLEAU Ronan's avatar CAILLEAU Ronan :clown:
Browse files

Added operator=(value) to image to be able to fill and image with a value.

parent db05973d
No related branches found
No related tags found
2 merge requests!34Added operator=(value) to image to be able to fill and image with a value.,!33Develop
Pipeline #223284 passed
......@@ -280,6 +280,8 @@ namespace sibr
*/
Image& operator=(Image&& other) noexcept;
Image& fill(Pixel const& value);
/**
\copydoc IImage::load
*/
......@@ -757,6 +759,12 @@ namespace sibr
return *this;
}
template <typename T_Type, unsigned int T_NumComp>
Image<T_Type, T_NumComp>& Image<T_Type, T_NumComp>::fill(Pixel const& value) {
std::fill(_pixels.begin<Pixel>(), _pixels.end<Pixel>(), value);
return *this;
}
template<typename T_Type, unsigned int T_NumComp>
const void* Image<T_Type, T_NumComp>::data(void) const {
SIBR_ASSERT(_pixels.isContinuous() == true); // if not true, you don't want to use this function
......
  • Author Maintainer

    Actually, the function's name is fill(value) instead of operator=(value).

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment