<commit_before>/*=========================================================================

Program:   ORFEO Toolbox
Language:  C++
Date:      $Date$
Version:   $Revision$


Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.


This software is distributed WITHOUT ANY WARRANTY; without even 
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef _otbNonMaxRemovalByDirectionFilter_h
#define _otbNonMaxRemovalByDirectionFilter_h

#include "otbModulusAndDirectionImageToImageFilter.h"
#include "otbBinaryFunctorNeighborhoodImageFilter.h"

#ifndef M_PI
#define M_PI vcl_acos(-1.0)
#endif 

namespace otb
{
namespace Functor
  {
    /** \class NonMaxRemovalByDirectionFunctor
     *  \brief This functor is used by the NonMaxRemovalByDirectionFilter 
     *  \sa NonMaxRemovalByDirectionFilter
     *  \ingroup Functor
     */
    template <class TInput1, class TInput2, class TOutput>
      class NonMaxRemovalByDirectionFunctor
      {
      public:
	NonMaxRemovalByDirectionFunctor() {};
	~NonMaxRemovalByDirectionFunctor() {};
	inline TOutput operator()(const TInput1 & itA, const TInput2 &itB)
	  {
	    if (itA.GetCenterPixel() != 0) 
	      {
		TOutput resp = 0;
		typename TInput1::OffsetType offset1,offset2;
		int neighborhoodNumber;
		if (itB.GetCenterPixel() > 0)
		  {
		    neighborhoodNumber = static_cast<int>(itB.GetCenterPixel()/(M_PI/4)-1);
		  } 
		else 
		  {
		    neighborhoodNumber = static_cast<int>((itB.GetCenterPixel()+M_PI)/(M_PI/4)-1);
		  }
		switch( neighborhoodNumber ) 
		  {
		case 0: 
		  offset1[0] =  1;
		  offset1[1] = -1;
		  offset2[0] = -1;
		  offset2[1] =  1;
		  break;
		case 1:
		  offset1[0] =  1;<commit_msg>Correction code ne compilant pas.<commit_after>/*=========================================================================

Program:   ORFEO Toolbox
Language:  C++
Date:      $Date$
Version:   $Revision$


Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.


This software is distributed WITHOUT ANY WARRANTY; without even 
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef _otbNonMaxRemovalByDirectionFilter_h
#define _otbNonMaxRemovalByDirectionFilter_h

#include "otbModulusAndDirectionImageToImageFilter.h"
#include "otbBinaryFunctorNeighborhoodImageFilter.h"

#ifndef M_PI
#define M_PI vcl_acos(-1.0)
#endif 

namespace otb
{
namespace Functor
  {
    /** \class NonMaxRemovalByDirectionFunctor
     *  \brief This functor is used by the NonMaxRemovalByDirectionFilter 
     *  \sa NonMaxRemovalByDirectionFilter
     *  \ingroup Functor
     */
    template <class TInput1, class TInput2, class TOutput>
      class NonMaxRemovalByDirectionFunctor
      {
      public:
	NonMaxRemovalByDirectionFunctor() {};
	~NonMaxRemovalByDirectionFunctor() {};
	inline TOutput operator()(const TInput1 & itA, const TInput2 &itB)
	  {
	    TOutput resp = 0;
	    if (itA.GetCenterPixel() != 0) 
	      {
		typename TInput1::OffsetType offset1,offset2;
		int neighborhoodNumber;
		if (itB.GetCenterPixel() > 0)
		  {
		    neighborhoodNumber = static_cast<int>(itB.GetCenterPixel()/(M_PI/4)-1);
		  } 
		else 
		  {
		    neighborhoodNumber = static_cast<int>((itB.GetCenterPixel()+M_PI)/(M_PI/4)-1);
		  }
		switch( neighborhoodNumber ) 
		  {
		case 0: 
		  offset1[0] =  1;
		  offset1[1] = -1;
		  offset2[0] = -1;
		  offset2[1] =  1;
		  break;
		case 1:
		  offset1[0] =  1;
{'fraction_non_alphanumeric': 0.1664454473055482, 'fraction_numerical': 0.01752057340058402, 'mean_word_length': 4.017310252996006, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1459858', 'n_tokens_mistral': 1296, 'n_tokens_neox': 1171, 'n_words': 281}