Skip to content

Commit

Permalink
Fix Boost guidelines violations (boostorg#378)
Browse files Browse the repository at this point in the history
Add copyright notice.
Add protection from the min/max macro.

Closes boostorg#376
  • Loading branch information
miralshah365 authored and mloskot committed Aug 9, 2019
1 parent 9e76b8b commit f6c502b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions include/boost/gil/extension/numeric/convolve.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//
// Copyright 2005-2007 Adobe Systems Incorporated
// Copyright 2019 Miral Shah <miralshah2211@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
Expand Down
2 changes: 2 additions & 0 deletions include/boost/gil/extension/numeric/kernel.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//
// Copyright 2005-2007 Adobe Systems Incorporated
// Copyright 2019 Miral Shah <miralshah2211@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
//

#ifndef BOOST_GIL_EXTENSION_NUMERIC_KERNEL_HPP
#define BOOST_GIL_EXTENSION_NUMERIC_KERNEL_HPP

Expand Down
8 changes: 4 additions & 4 deletions include/boost/gil/image_processing/threshold.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void threshold_binary(
//deciding output channel type and creating functor
using result_channel_t = typename channel_type<DstView>::type;

result_channel_t max_value = std::numeric_limits<result_channel_t>::max();
result_channel_t max_value = (std::numeric_limits<result_channel_t>::max)();
threshold_binary(src_view, dst_view, threshold_value, max_value, direction);
}

Expand Down Expand Up @@ -230,8 +230,8 @@ void otsu_impl(SrcView const& src_view, DstView const& dst_view, threshold_direc
std::array<std::size_t, 256> histogram{};
//initial value of min is set to maximum possible value to compare histogram data
//initial value of max is set to minimum possible value to compare histogram data
auto min = std::numeric_limits<source_channel_t>::max(),
max = std::numeric_limits<source_channel_t>::min();
auto min = (std::numeric_limits<source_channel_t>::max)(),
max = (std::numeric_limits<source_channel_t>::min)();

if (sizeof(source_channel_t) > 1 || std::is_signed<source_channel_t>::value)
{
Expand Down Expand Up @@ -445,7 +445,7 @@ void threshold_adaptive
//deciding output channel type and creating functor
typedef typename channel_type<DstView>::type result_channel_t;

result_channel_t max_value = std::numeric_limits<result_channel_t>::max();
result_channel_t max_value = (std::numeric_limits<result_channel_t>::max)();

threshold_adaptive(src_view, dst_view, max_value, kernel_size, method, direction, constant);
}
Expand Down
1 change: 1 addition & 0 deletions test/extension/numeric/kernel.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//
// Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
// Copyright 2019 Miral Shah <miralshah2211@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
Expand Down

0 comments on commit f6c502b

Please sign in to comment.