Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/2026.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ <h5>Improving</h5>
<li>SVE2 optimizations of function GetObjectMoments.</li>
<li>SVE2 optimizations of function DescrIntCosineDistance.</li>
<li>SVE2 optimizations of function DescrIntCosineDistancesMxNa.</li>
<li>C++ wrapper Simd::FillFrame.</li>
</ul>
<h5>Renaming</h5>
<ul>
Expand Down
4 changes: 2 additions & 2 deletions docs/help/group__filling.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions src/Simd/SimdLib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1958,22 +1958,25 @@ namespace Simd

\short Fills image pixel data outside of the given inner frame with the given 8-bit value.

The function fills four areas: rows above frame.top, rows at or below frame.bottom, columns before
The function fills four areas by calling Simd::Fill for the corresponding image regions:
rows above frame.top, rows at or below frame.bottom, columns before
frame.left inside the frame vertical range, and columns at or after frame.right inside the frame vertical range.
The rectangle [\a frame.left, \a frame.right) x [\a frame.top, \a frame.bottom) is left unchanged.
Frame coordinates must satisfy 0 <= frame.left <= frame.right <= dst.width and
0 <= frame.top <= frame.bottom <= dst.height.

\note This function is a C++ wrapper for function ::SimdFillFrame.
\note This function is implemented on the base of function Simd::Fill.

\param [out] dst - a destination image.
\param [in] frame - a rectangle defining the untouched interior region.
\param [in] value - a byte value to fill image pixel data outside of the frame.
*/
template<template<class> class A> SIMD_INLINE void FillFrame(View<A>& dst, const Rectangle<ptrdiff_t> & frame, uint8_t value)
{
SimdFillFrame(dst.data, dst.stride, dst.width, dst.height, dst.PixelSize(),
frame.left, frame.top, frame.right, frame.bottom, value);
Fill(dst.Region(0, 0, dst.width, frame.top).Ref(), value);
Fill(dst.Region(0, frame.bottom, dst.width, dst.height).Ref(), value);
Fill(dst.Region(0, frame.top, frame.left, frame.bottom).Ref(), value);
Fill(dst.Region(frame.right, frame.top, dst.width, frame.bottom).Ref(), value);
}

/*! @ingroup filling
Expand Down
5 changes: 5 additions & 0 deletions src/Test/TestFill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ namespace Test

result = result && Compare(d1, d2, 0, true, 32);

View d3(width, height, format, NULL, TEST_ALIGN(width));
Simd::Fill(d3, 0);
Simd::FillFrame(d3, frame, value);
result = result && Compare(d1, d3, 0, true, 32);

return result;
}

Expand Down