boostorg / gil

Boost.GIL - Generic Image Library | Requires C++14 since Boost 1.80
https://boostorg.github.io/gil
Boost Software License 1.0
179 stars 163 forks source link

Bicubic sampler #588

Open Scramjet911 opened 3 years ago

Scramjet911 commented 3 years ago

Description

This PR adds a bicubic sampler in the gil image resizing algorithms. It also adds another static_for_each() method with 5 sources for easier manipulation of the sampler. The overflow of the pixel values are checked inside the cubic_interpolate function. This is not optimum, but doing it after all cubic calculations is causing overflow errors in the output. I would like to know of better ways to do this..

Also I haven't written testcases for the new static_for_each() method.

Closes #576

References

Tasklist

codecov[bot] commented 3 years ago

Codecov Report

Merging #588 (b81d3cc) into develop (bc3a6c0) will increase coverage by 0.59%. The diff coverage is 99.32%.

@@             Coverage Diff             @@
##           develop     #588      +/-   ##
===========================================
+ Coverage    78.72%   79.31%   +0.59%     
===========================================
  Files          118      118              
  Lines         5034     5183     +149     
===========================================
+ Hits          3963     4111     +148     
- Misses        1071     1072       +1     
Sayan-Chaudhuri commented 3 years ago

@Scramjet911 Can you kindly mention how do these tests work? What is the function Boost.test.Eq? I wish to learn about these tests

Sayan-Chaudhuri commented 3 years ago

Also,how do you design the test cases?

Scramjet911 commented 3 years ago

@Scramjet911 Can you kindly mention how do these tests work? What is the function Boost.test.Eq? I wish to learn about these tests

Boost.test.eq checks for the equality of the pixel values. The tests are basically instantiating an image with some pixels and then resizing it and testing the values of the pixels of the resized image.

lpranam commented 3 years ago

@Sayan-Chaudhuri a simple google search will help you "boost tests" or "boost lightweight test"

https://www.boost.org/doc/libs/1_75_0/libs/core/doc/html/core/lightweight_test.html

Sayan-Chaudhuri commented 3 years ago

@lpranam Thanks.