Skip to content

Commit

Permalink
style: Remove trailing space characters (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
striezel committed Apr 26, 2022
1 parent caf92fa commit 4f83beb
Show file tree
Hide file tree
Showing 40 changed files with 170 additions and 171 deletions.
4 changes: 2 additions & 2 deletions example/adaptive_threshold.cpp
Expand Up @@ -29,13 +29,13 @@ int main()

boost::gil::threshold_adaptive(const_view(img), view(img_out), 11, threshold_adaptive_method::mean, threshold_direction::regular, 2);
write_view("out-threshold-adaptive-mean.png", view(img_out), png_tag{});

boost::gil::threshold_adaptive(const_view(img), view(img_out), 11, threshold_adaptive_method::mean, threshold_direction::inverse, 2);
write_view("out-threshold-adaptive-mean-inv.png", view(img_out), png_tag{});

boost::gil::threshold_adaptive(const_view(img), view(img_out), 7, threshold_adaptive_method::gaussian, threshold_direction::regular, 2);
write_view("out-threshold-adaptive-gaussian.png", view(img_out), png_tag{});

boost::gil::threshold_adaptive(const_view(img), view(img_out), 11, threshold_adaptive_method::gaussian, threshold_direction::inverse, 2);
write_view("out-threshold-adaptive-gaussian-inv.png", view(img_out), png_tag{});

Expand Down
4 changes: 2 additions & 2 deletions example/harris.cpp
Expand Up @@ -161,11 +161,11 @@ int main(int argc, char* argv[])

gil::rgb8_image_t input_image;

gil::read_image(argv[1], input_image, gil::png_tag{});
gil::read_image(argv[1], input_image, gil::png_tag{});
auto original_image = input_image;
auto original_view = gil::view(original_image);
auto input_view = gil::view(input_image);
auto grayscaled = to_grayscale(input_view);
auto grayscaled = to_grayscale(input_view);
gil::gray8_image_t smoothed_image(grayscaled.dimensions());
auto smoothed = gil::view(smoothed_image);
apply_gaussian_blur(gil::view(grayscaled), smoothed);
Expand Down
10 changes: 5 additions & 5 deletions example/hessian.cpp
@@ -1,9 +1,9 @@
//
//
// Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//

#include <boost/gil/image.hpp>
Expand Down
2 changes: 1 addition & 1 deletion example/histogram.cpp
Expand Up @@ -45,7 +45,7 @@ int main()
true // Use specified limits if this is true (default is false)
);

// Normalize the histogram
// Normalize the histogram
h.normalize();

// Get a cumulative histogram from the histogram
Expand Down
14 changes: 7 additions & 7 deletions example/histogram_equalization.cpp
@@ -1,10 +1,10 @@
//
//
// Copyright 2020 Debabrata Mandal <mandaldebabrata123@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//

#include <boost/gil.hpp>
#include <boost/gil/extension/io/png.hpp>
Expand All @@ -22,7 +22,7 @@ using namespace boost::gil;
int main()
{
gray8_image_t img;

read_image("test_adaptive.png", img, png_tag{});
gray8_image_t img_out(img.dimensions());

Expand Down
10 changes: 5 additions & 5 deletions example/hvstack.hpp
@@ -1,9 +1,9 @@
//
//
// // Copyright 2021 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//

#include "boost/gil/image_view_factory.hpp"
Expand Down
2 changes: 1 addition & 1 deletion example/morphology.cpp
Expand Up @@ -48,7 +48,7 @@ int main(int argc, char** argv)
// User has to enter atleast one operation and they can enter maximum 8
// operations considering binary conversion to be an
// operation.Output_image_template argument is the common component which
// will be added in names of all output images followed by a hyphen and
// will be added in names of all output images followed by a hyphen and
// the operation name.
// Example :
// ./example_morphology morphology_original.png out black_hat top_hat
Expand Down
4 changes: 2 additions & 2 deletions example/rasterizer_ellipse.cpp
Expand Up @@ -24,12 +24,12 @@ namespace gil = boost::gil;

int main()
{
// Syntax for usage :-
// Syntax for usage :-
// auto rasterizer = gil::midpoint_elliptical_rasterizer{};
// rasterizer(img_view, colour, center, semi-axes_length);
// Where
// img_view : gil view of the image on which ellipse is to be drawn.
// colour : Vector containing channel intensity values for img_view. Number of colours
// colour : Vector containing channel intensity values for img_view. Number of colours
// provided must be equal to the number of channels present in img_view.
// center : Array containing positive integer x co-ordinate and y co-ordinate of the center
// respectively.
Expand Down
2 changes: 1 addition & 1 deletion example/rasterizer_line.cpp
Expand Up @@ -17,7 +17,7 @@ namespace gil = boost::gil;
// Demonstrates the use of a rasterizer to generate an image of a line
// The various rasterizers available are defined in include/boost/gil/rasterization/circle.hpp,
// include/boost/gil/rasterization/ellipse.hpp and include/boost/gil/rasterization/line.hpp
// The rasterizer used implements the Bresenham's line algorithm.
// The rasterizer used implements the Bresenham's line algorithm.
// Multiple images are created, all of the same size, but with areas of different sizes passed to the rasterizer, resulting in different lines.
// See also:
// rasterizer_circle.cpp - Demonstrates the use of a rasterizer to generate an image of a circle
Expand Down
2 changes: 1 addition & 1 deletion example/threshold.cpp
Expand Up @@ -21,7 +21,7 @@ using namespace boost::gil;
// - threshold and regular: truncates the pixels whose values are greater than the threshold
// - threshold and inverse: truncates the pixels whose values are less than the threshold
// - zero and regular: zeroes the pixels whose values are less than the threshold
// - zero and inverse: zeroes the pixels whose values are greater than the threshold
// - zero and inverse: zeroes the pixels whose values are greater than the threshold
// See also:
// adaptive_threshold.cpp - Adaptive thresholding

Expand Down
2 changes: 1 addition & 1 deletion include/boost/gil/color_base.hpp
Expand Up @@ -309,7 +309,7 @@ struct homogeneous_color_base<Element, Layout, 4>
homogeneous_color_base() : v0_{}, v1_{}, v2_{}, v3_{} {}

explicit homogeneous_color_base(Element v) : v0_(v), v1_(v), v2_(v), v3_(v) {}

homogeneous_color_base(Element v0, Element v1, Element v2, Element v3)
: v0_(v0), v1_(v1), v2_(v2), v3_(v3)
{}
Expand Down
4 changes: 2 additions & 2 deletions include/boost/gil/extension/dynamic_image/any_image.hpp
Expand Up @@ -90,13 +90,13 @@ class any_image : public variant2::variant<Images...>
{
using parent_t = variant2::variant<Images...>;

public:
public:
using view_t = mp11::mp_rename<detail::images_get_views_t<any_image>, any_image_view>;
using const_view_t = mp11::mp_rename<detail::images_get_const_views_t<any_image>, any_image_view>;
using x_coord_t = std::ptrdiff_t;
using y_coord_t = std::ptrdiff_t;
using point_t = point<std::ptrdiff_t>;

using parent_t::parent_t;

any_image& operator=(any_image const& img)
Expand Down
Expand Up @@ -76,7 +76,7 @@ class any_image_view : public variant2::variant<Views...>
{
using parent_t = variant2::variant<Views...>;

public:
public:
using const_t = detail::views_get_const_t<any_image_view>;
using x_coord_t = std::ptrdiff_t;
using y_coord_t = std::ptrdiff_t;
Expand Down
2 changes: 1 addition & 1 deletion include/boost/gil/extension/histogram/std.hpp
Expand Up @@ -25,7 +25,7 @@ namespace boost { namespace gil {
//////////////////////////////////////////////////////////
/// Histogram extension for STL container
//////////////////////////////////////////////////////////
/// \defgroup Histogram - STL Containers
/// \defgroup Histogram - STL Containers
/// \brief Collection of functions to provide histogram support in GIL using Standard
/// Template Library Containers
/// The conversion from Boost.GIL images to compatible histograms are provided. The supported
Expand Down
34 changes: 17 additions & 17 deletions include/boost/gil/extension/numeric/affine.hpp
Expand Up @@ -108,47 +108,47 @@ boost::gil::matrix3x2<T> inverse(boost::gil::matrix3x2<T> m)
return res;
}

/// \fn gil::matrix3x2 center_rotate
/// \fn gil::matrix3x2 center_rotate
/// \tparam T Data type for source image dimensions
/// \tparam F Data type for angle through which image is to be rotated
/// @param dims dimensions of source image
/// @param rads angle through which image is to be rotated
/// @return A transformation matrix for rotating the source image about its center
/// \brief rotates an image from its center point
/// using consecutive affine transformations.
template<typename T, typename F>
template<typename T, typename F>
boost::gil::matrix3x2<F> center_rotate(boost::gil::point<T> dims,F rads)
{
{
const F PI = F(3.141592653589793238);
const F c_theta = std::abs(std::cos(rads));
const F s_theta = std::abs(std::sin(rads));

// Bound checks for angle rads
while(rads + PI < 0)
{
rads = rads + PI;
while(rads + PI < 0)
{
rads = rads + PI;
}

while(rads > PI)
{
rads = rads - PI;
while(rads > PI)
{
rads = rads - PI;
}

// Basic Rotation Matrix
boost::gil::matrix3x2<F> rotate = boost::gil::matrix3x2<F>::get_rotate(rads);

// Find distance for translating the image into view
boost::gil::matrix3x2<F> translation(0,0,0,0,0,0);
if(rads > 0)
{
translation.b = s_theta;
if(rads > 0)
{
translation.b = s_theta;
}
else
{
else
{
translation.c = s_theta;
}

if(std::abs(rads) > PI/2)
if(std::abs(rads) > PI/2)
{
translation.a = c_theta;
translation.d = c_theta;
Expand All @@ -165,7 +165,7 @@ boost::gil::matrix3x2<F> center_rotate(boost::gil::point<T> dims,F rads)
s_theta * dims.x / dims.y + c_theta
);

return scale * translate * rotate;
return scale * translate * rotate;
}

}} // namespace boost::gil
Expand Down
30 changes: 15 additions & 15 deletions include/boost/gil/histogram.hpp
Expand Up @@ -60,12 +60,12 @@ inline typename std::enable_if<Index != sizeof...(T), void>::type
}

/// \ingroup Histogram-Helpers
/// \brief Functor provided for the hashing of tuples.
/// The following approach makes use hash_combine from
/// boost::container_hash. Although there is a direct hashing
/// \brief Functor provided for the hashing of tuples.
/// The following approach makes use hash_combine from
/// boost::container_hash. Although there is a direct hashing
/// available for tuples, this approach will ease adopting in
/// future to a std::hash_combine. In case std::hash extends
/// support to tuples this functor as well as the helper
/// support to tuples this functor as well as the helper
/// implementation hash_tuple_impl can be removed.
///
template <typename... T>
Expand Down Expand Up @@ -115,7 +115,7 @@ bool tuple_compare(Tuple const& t1, Tuple const& t2, boost::mp11::index_sequence
}

/// \ingroup Histogram-Helpers
/// \brief Compares 2 tuples and outputs t1 <= t2
/// \brief Compares 2 tuples and outputs t1 <= t2
/// Comparison is not in a lexicographic manner but on every element of the tuple hence
/// (2, 2) > (1, 3) evaluates to false
///
Expand Down Expand Up @@ -199,13 +199,13 @@ struct filler<1>
/// \brief Default histogram class provided by boost::gil.
///
/// The class inherits over the std::unordered_map provided by STL. A complete example/tutorial
/// of how to use the class resides in the docs.
/// of how to use the class resides in the docs.
/// Simple calling syntax for a 3D dimensional histogram :
/// \code
/// histogram<int, int , int> h;
/// h(1, 1, 1) = 0;
/// \endcode
/// This is just a starter to what all can be achieved with it, refer to the docs for the
/// This is just a starter to what all can be achieved with it, refer to the docs for the
/// full demo.
///
template <typename... T>
Expand Down Expand Up @@ -237,7 +237,7 @@ class histogram : public std::unordered_map<std::tuple<T...>, double, detail::ha
return base_t::operator[](key);
}

/// \brief Checks if 2 histograms are equal. Ignores type, and checks if
/// \brief Checks if 2 histograms are equal. Ignores type, and checks if
/// the keys (after type casting) match.
template <typename OtherType>
bool equals(OtherType const& otherhist) const
Expand All @@ -258,7 +258,7 @@ class histogram : public std::unordered_map<std::tuple<T...>, double, detail::ha
});
return check;
}

/// \brief Checks if the histogram class is compatible to be used with
/// a GIL image type
static constexpr bool is_pixel_compatible()
Expand Down Expand Up @@ -502,7 +502,7 @@ class histogram : public std::unordered_map<std::tuple<T...>, double, detail::ha
return sub_h;
}

/// \brief Normalize this histogram class
/// \brief Normalize this histogram class
void normalize()
{
double sum = 0.0;
Expand Down Expand Up @@ -593,7 +593,7 @@ class histogram : public std::unordered_map<std::tuple<T...>, double, detail::ha
/// \ingroup Histogram Algorithms
/// \tparam SrcView Input image view
/// \tparam Container Input histogram container
/// \brief Overload this function to provide support for boost::gil::histogram or
/// \brief Overload this function to provide support for boost::gil::histogram or
/// any other external histogram
///
/// Example :
Expand All @@ -618,7 +618,7 @@ void fill_histogram(SrcView const&, Container&);
/// @param lower Input Lower limit on the values in histogram (default numeric_limit::min() on axes)
/// @param upper Input Upper limit on the values in histogram (default numeric_limit::max() on axes)
/// @param setlimits Input Use specified limits if this is true (default is false)
/// \brief Overload version of fill_histogram
/// \brief Overload version of fill_histogram
///
/// Takes a third argument to determine whether to clear container before filling.
/// For eg, when there is a need to accumulate the histograms do
Expand All @@ -643,11 +643,11 @@ void fill_histogram(
{
if (!accumulate)
hist.clear();

detail::filler<histogram<T...>::dimension()> f;
if (!sparsefill)
f(hist, lower, upper, bin_width);

hist.template fill<Dimensions...>(srcview, bin_width, applymask, mask, lower, upper, setlimits);
}

Expand All @@ -673,7 +673,7 @@ histogram<T...> cumulative_histogram(histogram<T...> const& hist)
static_assert(
boost::mp11::mp_all_of<check_list, boost::mp11::mp_to_bool>::value,
"Cumulative histogram not possible of this type");

using histogram_t = histogram<T...>;
using pair_t = std::pair<typename histogram_t::key_type, typename histogram_t::mapped_type>;
using value_t = typename histogram_t::value_type;
Expand Down

0 comments on commit 4f83beb

Please sign in to comment.