Skip to content

Commit

Permalink
[wip] move ppocr source in projects/ppocr and remove ppocr submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpoelen committed Feb 26, 2024
1 parent 5d9cf50 commit 14b59ac
Show file tree
Hide file tree
Showing 143 changed files with 10,263 additions and 130 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "modules/ppocr"]
path = modules/ppocr
url = ../ppocr.git
1 change: 0 additions & 1 deletion jam/includes.jam
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ for f in
$(REDEMPTION_INCLUDE_PATH)
$(SYSTEM_SRC_PATH)
$(OCR1_INCLUDE_PATH)
$(MLN_INCLUDES_PATH)
$(PPOCR_INCLUDES_PATH)
## configs @{
$(REDEMPTION_CONFIG_PATH)/redemption_src
Expand Down
5 changes: 2 additions & 3 deletions jam/redemption-config.jam
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ REDEMPTION_CONFIG_AUTOGEN_PATH ?= $(REDEMPTION_CONFIG_PATH)/autogen/include ;

OCR1_INCLUDE_PATH ?= $(REDEMPTION_PUBLIC_PATH)/projects/ocr1/include ;

PPOCR_MODULE_PATH ?= $(REDEMPTION_MODULES_SRC_PATH)/ppocr ;
PPOCR_SRC_PATH ?= $(PPOCR_MODULE_PATH)/src ;
PPOCR_MODULE_PATH ?= $(REDEMPTION_PUBLIC_PATH)/projects/ppocr ;
PPOCR_SRC_PATH ?= $(PPOCR_MODULE_PATH) ;

PPOCR_INCLUDES_PATH ?= $(PPOCR_SRC_PATH) ;
MLN_INCLUDES_PATH ?= $(PPOCR_MODULE_PATH)/includes/mln ;

REDEMPTION_SYS_PATH ?= $(REDEMPTION_PUBLIC_PATH)/sys ;
FIXTURES_PATH ?= $(REDEMPTION_PUBLIC_PATH)/tests/includes/fixtures ;
Expand Down
3 changes: 0 additions & 3 deletions jam/redemption-dependencies.jam
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,14 @@ constant LIB_DEPENDENCIES :
<variant>release:<cxxflags>-fvisibility=hidden
<link>shared
<linkflags>-Wl,-Bsymbolic
# $(GCOV_NO_BUILD)
;

EXE_DEPENDENCIES +=
<library>app_path_exe.o
<library>log.o
$(GCOV_NO_BUILD)
;

constant EXE_DEPENDENCIES_NO_SYSLOG :
<library>app_path_exe.o
<library>log_print.o
$(GCOV_NO_BUILD)
;
1 change: 0 additions & 1 deletion modules/ppocr
Submodule ppocr deleted from c35939
57 changes: 57 additions & 0 deletions projects/ppocr/mln/core/contract.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
// Olena is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, version 2 of the License.
//
// Olena 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 GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Olena. If not, see <http://www.gnu.org/licenses/>.
//
// As a special exception, you may use this file as part of a free
// software project without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to produce
// an executable, this file does not by itself cause the resulting
// executable to be covered by the GNU General Public License. This
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.

#ifndef MLN_CORE_CONTRACT_HH
# define MLN_CORE_CONTRACT_HH

/// \file
///
/// Definition of the set of contracts.

# include <cassert>

// Define a preprocessor constant HAS_NDEBUG reflecting the existence
// of NDEBUG, as avised by the section Conditional Compilation of the
// GNU Coding Standards
// (http://www.gnu.org/prep/standards/html_node/Conditional-Compilation.html).
#ifdef NDEBUG
#define HAS_NDEBUG 1
#else
#define HAS_NDEBUG 0
#endif

/// Assertion.
# define mln_assertion(expr) assert(expr)

/// Invariant.
# define mln_invariant(expr) assert(expr)

/// Precondition.
# define mln_precondition(expr) assert(expr)

/// Postcondition.
# define mln_postcondition(expr) assert(expr)

#endif // ! MLN_CORE_CONTRACT_HH
51 changes: 51 additions & 0 deletions projects/ppocr/mln/core/def/coord.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
// Olena is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, version 2 of the License.
//
// Olena 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 GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Olena. If not, see <http://www.gnu.org/licenses/>.
//
// As a special exception, you may use this file as part of a free
// software project without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to produce
// an executable, this file does not by itself cause the resulting
// executable to be covered by the GNU General Public License. This
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.

#ifndef MLN_CORE_DEF_COORD_HH
# define MLN_CORE_DEF_COORD_HH

/*! \file
*
* \brief Definition of the default coordinate type.
*/


namespace mln
{

namespace def
{


/// Definition of the default coordinate type: 'short'.
typedef short coord;


} // end of namespace mln::def

} // end of namespace mln


#endif // ! MLN_CORE_DEF_COORD_HH
152 changes: 152 additions & 0 deletions projects/ppocr/mln/core/point.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
// coordopyright (coord) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
// Olena is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, version 2 of the License.
//
// Olena is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERcoordHANTABILITY or FITNESS FOR A PARTIcoordULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Olena. If not, see <http://www.gnu.org/licenses/>.
//
// As a special exception, you may use this file as part of a free
// software project without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to produce
// an executable, this file does not by itself cause the resulting
// executable to be covered by the GNU General Public License. This
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.

#ifndef MLN_coordORE_POINT_HH
# define MLN_coordORE_POINT_HH

/// \file
///
/// \brief Definition of the generic point2d class mln::point2d.
///

# include <mln/core/contract.hh>
# include <mln/core/def/coord.hh>

# include <limits>
# include <ostream>

namespace mln
{

struct point2d
{
/// \var dim
/// Dimension of the space.
/// \invariant dim > 0
enum { dim = 2 };

/// coordoordinate associated type.
typedef ::mln::def::coord coord;

/// Read-only access to the \p i-th coordinate value.
/// \param[in] i The coordinate index.
/// \pre \p i < \c dim
const coord& operator[](unsigned i) const
{
mln_precondition(i < dim);
return this->coord_[i];
}

/// Read-write access to the \p i-th coordinate value.
/// \param[in] i The coordinate index.
/// \pre \p i < \c dim
coord& operator[](unsigned i)
{
mln_precondition(i < dim);
return this->coord_[i];
}

/// coordonstructor without argument.
point2d()
{
}

point2d(coord prow, coord pcol)
{
coord_[0] = prow;
coord_[1] = pcol;
}

/// Point with all coordinates set to the maximum value.
static point2d plus_infty()
{
return point2d(std::numeric_limits<coord>::max(), std::numeric_limits<coord>::max());
}

/// Point with all coordinates set to the mininum value.
static point2d minus_infty()
{
return point2d(std::numeric_limits<coord>::min(), std::numeric_limits<coord>::min());
}

const coord& row() const
{
return this->coord_[0];
}

coord& row()
{
return this->coord_[0];
}

const coord& col() const
{
return this->coord_[1];
}

coord& col()
{
return this->coord_[1];
}

protected:
coord coord_[dim];
};

/// Equality comparison between a couple of grid point2d \p lhs
/// and \p rhs.
/*!
* \param[in] lhs A first grid point2d.
* \param[in] rhs A second grid point2d.
*
* \pre Both \p lhs and \p rhs have to be defined on the same
* topology; otherwise this test does not compile.
*
* \return True if both grid point2ds have the same
* coordinates, otherwise false.
*/
inline
bool operator==(const point2d& lhs, const point2d& rhs)
{
return lhs.row() == rhs.row() && lhs.col() == rhs.col();
}

/// Print a grid point2d \p p into the output stream \p ostr.
/*! \param[in,out] ostr An output stream.
* \param[in] p A grid point2d.
*
* \return The modified output stream \p ostr.
*/
inline
std::ostream& operator<<(std::ostream& ostr, const point2d& p)
{
return ostr << '(' << p[0] << ',' << p[1] << ')';
}

} // end of namespace mln


#endif // ! MLN_coordORE_POINT_HH
Loading

0 comments on commit 14b59ac

Please sign in to comment.