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
13 changes: 13 additions & 0 deletions docs/2026.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,19 @@ <h5>Renaming</h5>
<h5>Removing</h5>
<ul>
<li>Separate support of SVE extension (ARM/ARM64 platform).</li>
<li>Function SimdFillFrame.</li>
</ul>

<h4>Python wrapper</h4>
<h5>Removing</h5>
<ul>
<li>Function Simd.Lib.FillFrame.</li>
</ul>

<h4>Test framework</h4>
<h5>Removing</h5>
<ul>
<li>Tests for verifying functionality of function FillFrame.</li>
</ul>

<h4>Documentation</h4>
Expand Down
17 changes: 0 additions & 17 deletions py/SimdPy/Simd.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,9 +761,6 @@ def Init(dir = ""):
Lib.__lib.SimdFillBgra.argtypes = [ ctypes.c_void_p, ctypes.c_size_t, ctypes.c_size_t, ctypes.c_size_t, ctypes.c_uint8, ctypes.c_uint8, ctypes.c_uint8, ctypes.c_uint8 ]
Lib.__lib.SimdFillBgra.restype = None

Lib.__lib.SimdFillFrame.argtypes = [ ctypes.c_void_p, ctypes.c_size_t, ctypes.c_size_t, ctypes.c_size_t, ctypes.c_size_t, ctypes.c_size_t, ctypes.c_size_t, ctypes.c_size_t, ctypes.c_size_t, ctypes.c_uint8 ]
Lib.__lib.SimdFillFrame.restype = None


## Gets version of %Simd Library.
# @return A string with version.
Expand Down Expand Up @@ -1799,20 +1796,6 @@ def FillBgr(dst : ctypes.c_void_p, stride: int, width: int, height: int, blue: i
def FillBgra(dst : ctypes.c_void_p, stride: int, width: int, height: int, blue: int, green: int, red: int, alpha: int) :
Lib.__lib.SimdFillBgra(dst, stride, width, height, blue, green, red, alpha)

## Fills pixels outside given rectangle (frame) by given value.
# @param dst - a pointer to pixels data of output image.
# @param stride - a row size of output image in bytes.
# @param width - a width of output image.
# @param height - a height of output image.
# @param pixelSize - a size of the image pixel in bytes.
# @param frameLeft - a left side of a frame.
# @param frameTop - a top side of a frame.
# @param frameRight - a right side of a frame.
# @param frameBottom - a bottom side of a frame.
# @param value - a value to fill image outside of the frame.
def FillFrame(dst : ctypes.c_void_p, stride: int, width: int, height: int, pixelSize: int, frameLeft: int, frameTop: int, frameRight: int, frameBottom: int, value: int) :
Lib.__lib.SimdFillFrame(dst, stride, width, height, pixelSize, frameLeft, frameTop, frameRight, frameBottom, value)


###################################################################################################

Expand Down
1 change: 0 additions & 1 deletion py/SimdPy/Test.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ def ImageReduceTest(args) :
def ImageFillTest(args) :
image = Simd.Image(Simd.PixelFormat.Bgr24, 400, 300)
Simd.Lib.FillBgr(image.Data(), image.Stride(), image.Width(), image.Height(), 0, 128, 255)
Simd.Lib.FillFrame(image.Data(), image.Stride(), image.Width(), image.Height(), image.Format().PixelSize(), 50, 50, 350, 250, 64)
image.Save("Fill.jpg")
bgra = Simd.Image(Simd.PixelFormat.Bgra32, 400, 300)
Simd.Lib.FillBgra(bgra.Data(), bgra.Stride(), bgra.Width(), bgra.Height(), 10, 20, 30, 255)
Expand Down
3 changes: 0 additions & 3 deletions src/Simd/SimdBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,6 @@ namespace Simd

void Fill(uint8_t * dst, size_t stride, size_t width, size_t height, size_t pixelSize, uint8_t value);

void FillFrame(uint8_t * dst, size_t stride, size_t width, size_t height, size_t pixelSize,
size_t frameLeft, size_t frameTop, size_t frameRight, size_t frameBottom, uint8_t value);

void FillBgr(uint8_t * dst, size_t stride, size_t width, size_t height, uint8_t blue, uint8_t green, uint8_t red);

void FillBgra(uint8_t * dst, size_t stride, size_t width, size_t height, uint8_t blue, uint8_t green, uint8_t red, uint8_t alpha);
Expand Down
45 changes: 0 additions & 45 deletions src/Simd/SimdBaseFill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,51 +38,6 @@ namespace Simd
}
}

void FillFrame(uint8_t * dst, size_t stride, size_t width, size_t height, size_t pixelSize,
size_t frameLeft, size_t frameTop, size_t frameRight, size_t frameBottom, uint8_t value)
{
if (frameTop)
{
size_t offset = 0;
size_t size = width*pixelSize;
for (size_t row = 0; row < frameTop; ++row)
{
memset(dst + offset, value, size);
offset += stride;
}
}
if (height - frameBottom)
{
size_t offset = frameBottom*stride;
size_t size = width*pixelSize;
for (size_t row = frameBottom; row < height; ++row)
{
memset(dst + offset, value, size);
offset += stride;
}
}
if (frameLeft)
{
size_t offset = frameTop*stride;
size_t size = frameLeft*pixelSize;
for (size_t row = frameTop; row < frameBottom; ++row)
{
memset(dst + offset, value, size);
offset += stride;
}
}
if (width - frameRight)
{
size_t offset = frameTop*stride + frameRight*pixelSize;
size_t size = (width - frameRight)*pixelSize;
for (size_t row = frameTop; row < frameBottom; ++row)
{
memset(dst + offset, value, size);
offset += stride;
}
}
}

SIMD_INLINE uint64_t Fill64(uint8_t a, uint8_t b, uint8_t c)
{
#ifdef SIMD_BIG_ENDIAN
Expand Down
7 changes: 0 additions & 7 deletions src/Simd/SimdLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2530,13 +2530,6 @@ SIMD_API void SimdFill(uint8_t * dst, size_t stride, size_t width, size_t height
Base::Fill(dst, stride, width, height, pixelSize, value);
}

SIMD_API void SimdFillFrame(uint8_t * dst, size_t stride, size_t width, size_t height, size_t pixelSize,
size_t frameLeft, size_t frameTop, size_t frameRight, size_t frameBottom, uint8_t value)
{
SIMD_EMPTY();
Base::FillFrame(dst, stride, width, height, pixelSize, frameLeft, frameTop, frameRight, frameBottom, value);
}

SIMD_API void SimdFillBgr(uint8_t * dst, size_t stride, size_t width, size_t height, uint8_t blue, uint8_t green, uint8_t red)
{
SIMD_EMPTY();
Expand Down
27 changes: 0 additions & 27 deletions src/Simd/SimdLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -3631,33 +3631,6 @@ extern "C"
*/
SIMD_API void SimdFill(uint8_t * dst, size_t stride, size_t width, size_t height, size_t pixelSize, uint8_t value);

/*! @ingroup filling

\fn void SimdFillFrame(uint8_t * dst, size_t stride, size_t width, size_t height, size_t pixelSize, size_t frameLeft, size_t frameTop, size_t frameRight, size_t frameBottom, uint8_t value);

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

The function fills four areas: rows above frameTop, rows below frameBottom, columns before
frameLeft inside frame vertical range, and columns after frameRight inside frame vertical range.
The rectangle [frameLeft, frameRight) x [frameTop, frameBottom) is left unchanged.
Frame coordinates must satisfy frameLeft <= frameRight <= width and frameTop <= frameBottom <= height.

\note This function has a C++ wrapper Simd::FillFrame(View<A>& dst, const Rectangle<ptrdiff_t> & frame, uint8_t value).

\param [out] dst - a pointer to pixels data of destination image.
\param [in] stride - a row size of the dst image (in bytes).
\param [in] width - an image width (in pixels).
\param [in] height - an image height (in pixels).
\param [in] pixelSize - a size of one image pixel (in bytes).
\param [in] frameLeft - a left side of the inner frame.
\param [in] frameTop - a top side of the inner frame.
\param [in] frameRight - a right side of the inner frame.
\param [in] frameBottom - a bottom side of the inner frame.
\param [in] value - a byte value to fill image pixel data outside of the frame.
*/
SIMD_API void SimdFillFrame(uint8_t * dst, size_t stride, size_t width, size_t height, size_t pixelSize,
size_t frameLeft, size_t frameTop, size_t frameRight, size_t frameBottom, uint8_t value);

/*! @ingroup filling

\fn void SimdFillBgr(uint8_t * dst, size_t stride, size_t width, size_t height, uint8_t blue, uint8_t green, uint8_t red);
Expand Down
1 change: 0 additions & 1 deletion src/Test/Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ namespace Test
TEST_ADD_GROUP_0S(FontDraw);

TEST_ADD_GROUP_A0(Fill);
TEST_ADD_GROUP_A0(FillFrame);
TEST_ADD_GROUP_A0(FillBgra);
TEST_ADD_GROUP_A0(FillBgr);
TEST_ADD_GROUP_A0(FillPixel);
Expand Down
83 changes: 0 additions & 83 deletions src/Test/TestFill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,89 +103,6 @@ namespace Test

//---------------------------------------------------------------------------------------------

namespace
{
struct FuncF
{
typedef void(*FuncPtr)(uint8_t * dst, size_t stride, size_t width, size_t height, size_t pixelSize,
size_t frameLeft, size_t frameTop, size_t frameRight, size_t frameBottom, uint8_t value);

FuncPtr func;
String description;

FuncF(const FuncPtr & f, const String & d) : func(f), description(d) {}

void Call(View & dst, const Rect & frame, uint8_t value) const
{
TEST_PERFORMANCE_TEST(description);
func(dst.data, dst.stride, dst.width, dst.height, dst.PixelSize(),
frame.left, frame.top, frame.right, frame.bottom, value);
}
};
}

#define FUNC_F(function) \
FuncF(function, std::string(#function))

bool FillFrameAutoTest(View::Format format, int width, int height, const FuncF & f1, const FuncF & f2)
{
bool result = true;

TEST_LOG_SS(Info, "Test " << f1.description << " & " << f2.description << " [" << width << ", " << height << "].");

uint8_t value = Random(256);
Rect frame(width * 1 / 15, height * 2 / 15, width * 11 / 15, height * 12 / 15);

View d1(width, height, format, NULL, TEST_ALIGN(width));
View d2(width, height, format, NULL, TEST_ALIGN(width));
Simd::Fill(d1, 0);
Simd::Fill(d2, 0);

TEST_EXECUTE_AT_LEAST_MIN_TIME(f1.Call(d1, frame, value));

TEST_EXECUTE_AT_LEAST_MIN_TIME(f2.Call(d2, frame, value));

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;
}

bool FillFrameAutoTest(const FuncF & f1, const FuncF & f2)
{
bool result = true;

for (View::Format format = View::Gray8; format <= View::BayerBggr; format = View::Format(format + 1))
{
if (format == View::Float || format == View::Double)
continue;

FuncF f1c = FuncF(f1.func, f1.description + ColorDescription(format));
FuncF f2c = FuncF(f2.func, f2.description + ColorDescription(format));

result = result && FillFrameAutoTest(format, W, H, f1c, f2c);
result = result && FillFrameAutoTest(format, W + O, H - O, f1c, f2c);
}

return result;
}

bool FillFrameAutoTest(const Options & options)
{
bool result = true;

if (TestBase(options))
result = result && FillFrameAutoTest(FUNC_F(Simd::Base::FillFrame), FUNC_F(SimdFillFrame));

return result;
}

//---------------------------------------------------------------------------------------------

namespace
{
struct FuncBgra
Expand Down