<commit_before>// Copyright (C) 2007 by <NAME>
// <EMAIL>
//
// This file is part of cvBlob.
//
// cvBlob is free software: you can redistribute it and/or modify
// it under the terms of the Lesser GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// cvBlob is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// Lesser GNU General Public License for more details.
//
// You should have received a copy of the Lesser GNU General Public License
// along with cvBlob.  If not, see <http://www.gnu.org/licenses/>.
//

/// \file cvblob.h
/// \brief OpenCV Blob header file.

#ifdef SWIG
%module cvblob
%{
#include "cvblob.h"
    %}
#endif

#ifndef CVBLOB_H
#define CVBLOB_H

#include <iostream>
#include <map>
#include <list>
#include <vector>
#include <limits>
#include <cvBlob/cvblob_export.h>

#if (defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__) || (defined(__APPLE__) & defined(__MACH__)))
#include <cv.h>
#else
#include <opencv/cv.h>
#endif

#ifndef __CV_BEGIN__
#define __CV_BEGIN__ __BEGIN__
#endif
#ifndef __CV_END__
#define __CV_END__ __END__
#endif

#ifdef __cplusplus
extern "C" {
#endif

namespace cvb
{

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Contours

// Chain code:
//        7 0 1
//        6   2
//        5 4 3
#define CV_CHAINCODE_UP		0 ///< Up.
#define CV_CHAINCODE_UP_RIGHT	1 ///< Up and right.
#define CV_CHAINCODE_RIGHT	2 ///< Right.
#define CV_CHAINCODE_DOWN_RIGHT	3 ///< Down and right.
#define CV_CHAINCODE_DOWN	4 ///< Down.
#define CV_CHAINCODE_DOWN_LEFT	5 ///< Down and left.
#define CV_CHAINCODE_LEFT	6 ///< Left.
#define CV_CHAINCODE_UP_LEFT	7 ///< Up and left.

/// \brief Move vectors of chain codes.
/// \see CV_CHAINCODE_UP
/// \see CV_CHAINCODE_UP_LEFT
/// \see CV_CHAINCODE_LEFT
/// \see CV_CHAINCODE_DOWN_LEFT
/// \see CV_CHAINCODE_DOWN
/// \see CV_CHAINCODE_DOWN_RIGHT
/// \see CV_CHAINCODE_RIGHT
/// \see CV_CHAINCODE_UP_RIGHT
const char cvChainCodeMoves[8][2] = { { 0, -1},
                                      { 1, -1},
                                      { 1,  0},
                                      { 1,  1},
                                      { 0,  1},
                                      {-1,  1},
                                      {-1,  0},
                                      {-1, -1}
                                    };

/// \brief Direction.
/// \see CV_CHAINCODE_UP
/// \see CV_CHAINCODE_UP_LEFT
/// \see CV_CHAINCODE_LEFT
/// \see CV_CHAINCODE_DOWN_LEFT
/// \see CV_CHAINCODE_DOWN
/// \see CV_CHAINCODE_DOWN_RIGHT
/// \see CV_CHAINCODE_RIGHT<commit_msg>Add conditional define for cv_rgb, which is not defined for opencv >= 3.4<commit_after>// Copyright (C) 2007 by <NAME>
// <EMAIL>
//
// This file is part of cvBlob.
//
// cvBlob is free software: you can redistribute it and/or modify
// it under the terms of the Lesser GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// cvBlob is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// Lesser GNU General Public License for more details.
//
// You should have received a copy of the Lesser GNU General Public License
// along with cvBlob.  If not, see <http://www.gnu.org/licenses/>.
//

/// \file cvblob.h
/// \brief OpenCV Blob header file.

#ifdef SWIG
%module cvblob
%{
#include "cvblob.h"
    %}
#endif

#ifndef CVBLOB_H
#define CVBLOB_H

#include <iostream>
#include <map>
#include <list>
#include <vector>
#include <limits>
#include <cvBlob/cvblob_export.h>

#if (defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__) || (defined(__APPLE__) & defined(__MACH__)))
#include <cv.h>
#else
#include <opencv/cv.h>
#endif

#ifndef __CV_BEGIN__
#define __CV_BEGIN__ __BEGIN__
#endif
#ifndef __CV_END__
#define __CV_END__ __END__
#endif

#ifdef __cplusplus
extern "C" {
#endif

namespace cvb
{

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Contours

// Chain code:
//        7 0 1
//        6   2
//        5 4 3
#define CV_CHAINCODE_UP		0 ///< Up.
#define CV_CHAINCODE_UP_RIGHT	1 ///< Up and right.
#define CV_CHAINCODE_RIGHT	2 ///< Right.
#define CV_CHAINCODE_DOWN_RIGHT	3 ///< Down and right.
#define CV_CHAINCODE_DOWN	4 ///< Down.
#define CV_CHAINCODE_DOWN_LEFT	5 ///< Down and left.
#define CV_CHAINCODE_LEFT	6 ///< Left.
#define CV_CHAINCODE_UP_LEFT	7 ///< Up and left.

#ifndef CV_RGB
#define CV_RGB(r, g, b) cv::Scalar((b), (g), (r), 0)
#endif

/// \brief Move vectors of chain codes.
/// \see CV_CHAINCODE_UP
/// \see CV_CHAINCODE_UP_LEFT
/// \see CV_CHAINCODE_LEFT
/// \see CV_CHAINCODE_DOWN_LEFT
/// \see CV_CHAINCODE_DOWN
/// \see CV_CHAINCODE_DOWN_RIGHT
/// \see CV_CHAINCODE_RIGHT
/// \see CV_CHAINCODE_UP_RIGHT
const char cvChainCodeMoves[8][2] = { { 0, -1},
                                      { 1, -1},
                                      { 1,  0},
                                      { 1,  1},
                                      { 0,  1},
                                      {-1,  1},
                                      {-1,  0},
                                      {-1, -1}
                                    };

/// \brief Direction.
/// \see CV_CHAINCODE_UP
/// \see CV_CHAINCODE_UP_LEFT
/// \see CV_CHAINCODE_LEFT
/// \see CV_CHAINCODE_DOWN_LEFT
/// \see CV_CHAINCODE_DOWN
/// \see CV_CHAINCODE_DOWN_RIGHT
/// \see CV_CHAINCODE_RIGHT
{'fraction_non_alphanumeric': 0.1550783912747103, 'fraction_numerical': 0.015167007498295842, 'mean_word_length': 1.9315684315684316, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2969439', 'n_tokens_mistral': 1936, 'n_tokens_neox': 1851, 'n_words': 585}