"git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "ae831144800fab4b4f9f3f7c02d690f63af77ac2"
Commit c7813163 authored by Davis King's avatar Davis King
Browse files

merged

parents a9e1c9e4 27274c17
......@@ -190,21 +190,29 @@ if (NOT TARGET dlib)
set (dlib_needed_libraries ${pthreadlib})
if (NOT DLIB_NO_GUI_SUPPORT)
find_library(xlib X11)
# Make sure X11 is in the include path. Note that we look for
# Xlocale.h rather than Xlib.h because it avoids finding a partial
# copy of the X11 headers on systems with anaconda installed.
find_path(xlib_path Xlocale.h
PATHS
/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include
/opt/local/include
PATH_SUFFIXES X11
)
if (xlib AND xlib_path)
get_filename_component(x11_path ${xlib_path} PATH CACHE)
include_directories(${x11_path})
set(dlib_needed_libraries ${dlib_needed_libraries} ${xlib} )
find_package(X11 QUIET)
if (X11_FOUND)
include_directories(${X11_INCLUDE_DIR})
set (dlib_needed_libraries ${dlib_needed_libraries} ${X11_LIBRARIES})
else()
find_library(xlib X11)
# Make sure X11 is in the include path. Note that we look for
# Xlocale.h rather than Xlib.h because it avoids finding a partial
# copy of the X11 headers on systems with anaconda installed.
find_path(xlib_path Xlocale.h
PATHS
/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include
/opt/local/include
PATH_SUFFIXES X11
)
if (xlib AND xlib_path)
get_filename_component(x11_path ${xlib_path} PATH CACHE)
include_directories(${x11_path})
set(dlib_needed_libraries ${dlib_needed_libraries} ${xlib} )
set(X11_FOUND 1)
endif()
endif()
if (NOT X11_FOUND)
message(" *****************************************************************************")
message(" *** DLIB GUI SUPPORT DISABLED BECAUSE X11 DEVELOPMENT LIBRARIES NOT FOUND ***")
message(" *** Make sure XQuartz is installed if you want GUI support. ***")
......
// Copyright (C) 2003 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifdef DLIB_ALL_SOURCE_END
#include "dlib_basic_cpp_build_tutorial.txt"
#endif
#ifndef DLIB_ALGs_
#define DLIB_ALGs_
......
......@@ -3,6 +3,10 @@
#ifndef DLIB_ALL_SOURCe_
#define DLIB_ALL_SOURCe_
#if defined(DLIB_ALGs_) || defined(DLIB_PLATFORm_)
#include "../dlib_basic_cpp_build_tutorial.txt"
#endif
// ISO C++ code
#include "../base64/base64_kernel_1.cpp"
#include "../bigint/bigint_kernel_1.cpp"
......@@ -80,5 +84,8 @@
#endif // DLIB_ISO_CPP_ONLY
#define DLIB_ALL_SOURCE_END
#endif // DLIB_ALL_SOURCe_
// Copyright (C) 2011 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifdef DLIB_ALL_SOURCE_END
#include "dlib_basic_cpp_build_tutorial.txt"
#endif
#ifndef DLIB_BRIdGE_
#define DLIB_BRIdGE_
......
#error "Don't write #include <dlib/all/source.cpp> in your code."
/*
In C++, it is generally an error to #include .cpp files. This is because it
can lead to what are called multiply defined symbol errors. Therefore, you
should compile dlib/all/source.cpp into your application just like you would
compile any other .cpp file.
If you are using Visual Studio you add .cpp files to your application using
the solution explorer window. Specifically, right click on Source Files,
then select Add -> Existing Item and select the .cpp files you want to add.
For general information on compiling dlib see http://dlib.net/compile.html
*/
// Copyright (C) 2005 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifdef DLIB_ALL_SOURCE_END
#include "dlib_basic_cpp_build_tutorial.txt"
#endif
#ifndef DLIB_GUI_WIDGETs_
#define DLIB_GUI_WIDGETs_
......
// Copyright (C) 2006 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifdef DLIB_ALL_SOURCE_END
#include "dlib_basic_cpp_build_tutorial.txt"
#endif
#ifndef DLIB_IMAGe_IO_
#define DLIB_IMAGe_IO_
......
......@@ -9,6 +9,7 @@
#include "jpeg_loader.h"
#include "image_loader.h"
#include <fstream>
#include <sstream>
namespace dlib
{
......@@ -71,15 +72,37 @@ namespace dlib
if (im_type == image_file_type::JPG)
{
throw image_load_error("Unable to load image in file " + file_name + ".\n" +
"You must #define DLIB_JPEG_SUPPORT and link to libjpeg to read JPEG files.\n" +
"Do this by following the instructions at http://dlib.net/compile.html.");
std::ostringstream sout;
sout << "Unable to load image in file " + file_name + ".\n" +
"You must #define DLIB_JPEG_SUPPORT and link to libjpeg to read JPEG files.\n" +
"Do this by following the instructions at http://dlib.net/compile.html.\n\n";
#ifdef _MSC_VER
sout << "Note that you must cause DLIB_JPEG_SUPPORT to be defined for your entire project.\n";
sout << "So don't #define it in one file, add it to the C/C++->Preprocessor->Preprocessor Definitions\n";
sout << "field in Visual Studio's Property Pages window so it takes effect for your entire application.";
#else
sout << "Note that you must cause DLIB_JPEG_SUPPORT to be defined for your entire project.\n";
sout << "So don't #define it in one file, use a compiler switch like -DDLIB_JPEG_SUPPORT\n";
sout << "so it takes effect for your entire application.";
#endif
throw image_load_error(sout.str());
}
else if (im_type == image_file_type::PNG)
{
throw image_load_error("Unable to load image in file " + file_name + ".\n" +
"You must #define DLIB_PNG_SUPPORT and link to libpng to read PNG files.\n" +
"Do this by following the instructions at http://dlib.net/compile.html.");
std::ostringstream sout;
sout << "Unable to load image in file " + file_name + ".\n" +
"You must #define DLIB_PNG_SUPPORT and link to libpng to read PNG files.\n" +
"Do this by following the instructions at http://dlib.net/compile.html.\n\n";
#ifdef _MSC_VER
sout << "Note that you must cause DLIB_PNG_SUPPORT to be defined for your entire project.\n";
sout << "So don't #define it in one file, add it to the C/C++->Preprocessor->Preprocessor Definitions\n";
sout << "field in Visual Studio's Property Pages window so it takes effect for your entire application.\n";
#else
sout << "Note that you must cause DLIB_PNG_SUPPORT to be defined for your entire project.\n";
sout << "So don't #define it in one file, use a compiler switch like -DDLIB_PNG_SUPPORT\n";
sout << "so it takes effect for your entire application.";
#endif
throw image_load_error(sout.str());
}
else
{
......
// Copyright (C) 2011 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifdef DLIB_ALL_SOURCE_END
#include "dlib_basic_cpp_build_tutorial.txt"
#endif
#ifndef DLIB_IMAGE_PROCESSInG_H_h_
#define DLIB_IMAGE_PROCESSInG_H_h_
......
// Copyright (C) 2006 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifdef DLIB_ALL_SOURCE_END
#include "dlib_basic_cpp_build_tutorial.txt"
#endif
#ifndef DLIB_IMAGE_TRANSFORMs_
#define DLIB_IMAGE_TRANSFORMs_
......
......@@ -20,6 +20,14 @@ set(MATLAB_LIB_FOLDERS
"${MATLAB_HOME}/extern/lib/win64/microsoft"
"${MATLAB_HOME}/bin/glnxa64"
)
# If there is a MATLAB_HOME environment variable then look there as well.
if (DEFINED ENV{MATLAB_HOME})
set(MATLAB_LIB_FOLDERS
"$ENV{MATLAB_HOME}/extern/lib/win64/microsoft"
"$ENV{MATLAB_HOME}/bin/glnxa64"
${MATLAB_LIB_FOLDERS}
)
endif()
# Find the MATLAB libraries that need to get linked into the mex file
if (WIN32)
find_library(MATLAB_MEX_LIBRARY libmex PATHS ${MATLAB_LIB_FOLDERS} )
......@@ -31,14 +39,18 @@ else()
find_library(MATLAB_ENG_LIBRARY eng PATHS ${MATLAB_LIB_FOLDERS} )
endif()
set(MATLAB_LIBRARIES ${MATLAB_MEX_LIBRARY} ${MATLAB_MX_LIBRARY} ${MATLAB_ENG_LIBRARY})
INCLUDE_DIRECTORIES("${MATLAB_HOME}/extern/include")
# Figure out the path to MATLAB's mex.h so we can add it to the include search path.
find_path(mex_header_path mex.h
PATHS "$ENV{MATLAB_HOME}/extern/include"
"${MATLAB_HOME}/extern/include"
)
INCLUDE_DIRECTORIES(${mex_header_path})
# Determine the path to cmake_mex_wrapper file so we can add it to the include search path..
string(REGEX REPLACE "cmake_mex_wrapper$" "" dlib_matlab_binding_path ${CMAKE_CURRENT_LIST_FILE})
INCLUDE_DIRECTORIES("${dlib_matlab_binding_path}")
# Determine the path to dlib so we can add it to the include search path.
string(REGEX REPLACE "cmake_mex_wrapper$" "" dlib_path ${CMAKE_CURRENT_LIST_FILE})
INCLUDE_DIRECTORIES(${dlib_path}/../..)
# Also add dlib to the include search path
INCLUDE_DIRECTORIES(${dlib_matlab_binding_path}/../..)
ADD_DEFINITIONS(-DMATLAB_MEX_FILE)
......
// Copyright (C) 2009 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifdef DLIB_ALL_SOURCE_END
#include "dlib_basic_cpp_build_tutorial.txt"
#endif
#ifndef DLIB_OPEnCV_HEADER
#define DLIB_OPEnCV_HEADER
......
// Copyright (C) 2006 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifdef DLIB_ALL_SOURCE_END
#include "dlib_basic_cpp_build_tutorial.txt"
#endif
#ifndef DLIB_PLATFORm_
#define DLIB_PLATFORm_
......
......@@ -10,6 +10,12 @@
#include "../algs.h"
#include "shared_ptr_abstract.h"
// Don't warn about the use of std::auto_ptr in this file. There is a pragma at the end of
// this file that re-enables the warning.
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
namespace dlib
{
......@@ -521,5 +527,9 @@ namespace dlib
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif // DLIB_SHARED_PTr_
......@@ -11,6 +11,13 @@
#include "shared_ptr_thread_safe_abstract.h"
#include "../threads/threads_kernel.h"
// Don't warn about the use of std::auto_ptr in this file. There is a pragma at the end of
// this file that re-enables the warning.
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
namespace dlib
{
......@@ -257,7 +264,6 @@ namespace dlib
}
}
template<typename Y>
explicit shared_ptr_thread_safe(
std::auto_ptr<Y>& r
......@@ -491,6 +497,10 @@ namespace dlib
// ----------------------------------------------------------------------------------------
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
}
#endif // DLIB_SHARED_THREAD_SAFE_PTr_
......
// Copyright (C) 2007 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifdef DLIB_ALL_SOURCE_END
#include "dlib_basic_cpp_build_tutorial.txt"
#endif
#ifndef DLIB_SVm_HEADER
#define DLIB_SVm_HEADER
......
// Copyright (C) 2008 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifdef DLIB_ALL_SOURCE_END
#include "dlib_basic_cpp_build_tutorial.txt"
#endif
#ifndef DLIB_SVm_THREADED_HEADER
#define DLIB_SVm_THREADED_HEADER
......
// Copyright (C) 2003 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifdef DLIB_ALL_SOURCE_END
#include "dlib_basic_cpp_build_tutorial.txt"
#endif
#ifndef DLIB_THREADs_
#define DLIB_THREADs_
......
......@@ -4,6 +4,7 @@
#define DLIB_VECTORSTReAMh_
#include "vectorstream/vectorstream.h"
#include "vectorstream/unserialize.h"
#endif // DLIB_VECTORSTReAMh_
......
// Copyright (C) 2016 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_uNSERIALIZE_Hh_
#define DLIB_uNSERIALIZE_Hh_
#include "unserialize_abstract.h"
#include "../serialize.h"
#include "../algs.h"
#include "vectorstream.h"
namespace dlib
{
class unserialize : public std::istream
{
class mystreambuf : public std::streambuf
{
typedef std::vector<char>::size_type size_type;
size_type read_pos; // buffer[read_pos] == next byte to read from buffer
public:
std::vector<char> buffer;
std::istream& str;
template <typename T>
mystreambuf(
const T& item,
std::istream& str_
) :
read_pos(0),
str(str_)
{
// put the item into our buffer.
vectorstream vstr(buffer);
serialize(item, vstr);
}
// ------------------------ INPUT FUNCTIONS ------------------------
int_type underflow(
)
{
if (read_pos < buffer.size())
return static_cast<unsigned char>(buffer[read_pos]);
else
return str.peek();
}
int_type uflow(
)
{
if (read_pos < buffer.size())
return static_cast<unsigned char>(buffer[read_pos++]);
else
return str.get();
}
std::streamsize xsgetn (
char* s,
std::streamsize n
)
{
if (read_pos < buffer.size())
{
const size_type num = std::min<size_type>(n, buffer.size()-read_pos);
std::memcpy(s, &buffer[read_pos], num);
read_pos += num;
return num;
}
else
{
return str.rdbuf()->sgetn(s,n);
}
return 0;
}
};
public:
template <typename T>
unserialize (
const T& item,
std::istream& str
) :
std::istream(&buf),
buf(item, str)
{}
private:
mystreambuf buf;
};
}
#endif // DLIB_uNSERIALIZE_Hh_
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment