id
int64 0
755k
| file_name
stringlengths 3
109
| file_path
stringlengths 13
185
| content
stringlengths 31
9.38M
| size
int64 31
9.38M
| language
stringclasses 1
value | extension
stringclasses 11
values | total_lines
int64 1
340k
| avg_line_length
float64 2.18
149k
| max_line_length
int64 7
2.22M
| alphanum_fraction
float64 0
1
| repo_name
stringlengths 6
65
| repo_stars
int64 100
47.3k
| repo_forks
int64 0
12k
| repo_open_issues
int64 0
3.4k
| repo_license
stringclasses 9
values | repo_extraction_date
stringclasses 92
values | exact_duplicates_redpajama
bool 2
classes | near_duplicates_redpajama
bool 2
classes | exact_duplicates_githubcode
bool 2
classes | exact_duplicates_stackv2
bool 1
class | exact_duplicates_stackv1
bool 2
classes | near_duplicates_githubcode
bool 2
classes | near_duplicates_stackv1
bool 2
classes | near_duplicates_stackv2
bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27,209
|
color_gradient.hpp
|
openMVG_openMVG/src/openMVG/graphics/color_gradient.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2019 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_GRAPHICS_COLOR_GRADIENT_HPP
#define OPENMVG_GRAPHICS_COLOR_GRADIENT_HPP
#include <algorithm>
#include <vector>
namespace openMVG
{
namespace graphics
{
// Port made from http://www.andrewnoske.com/wiki/Code_-_heatmaps_and_color_gradients
// - Use c++11 style
// - Add multiple possible color gradient initialization
//
// --------------------
// How to use the code:
// --------------------
// 1. Create the object and configure the color gradient
// --------------------
// Color_Gradient heatMapGradient(Color_Gradient::k2BlueRedHeatMap());
// // Re-Initialize to use a gradient based on 5 colors
// //heatMapGradient = Color_Gradient(Color_Gradient::k5ColorHeatMap());
// --------------------
// 2. Get the color corresponding to the % range you want
// --------------------
// float r,g,b;
// const float interpolated_ratio = .5f;
// heatMapGradient.getColor(interpolated_ratio, r, g, b);
// // [r,g,b] are in the range [0, 1]
//
class Color_Gradient
{
public:
struct Color_Point // Internal class used to store colors at different points in the gradient.
{
float r, g, b; // Red, green and blue values of our color.
float val; // Position of our color along the gradient (between 0 and 1).
Color_Point(float red, float green, float blue, float value)
: r(red), g(green), b(blue), val(value) {}
};
using Color_Points = std::vector<Color_Point>;
//-- Places a 5 color heatmap gradient into the "color" vector:
static const Color_Points k5ColorHeatMap()
{
return
{
{0, 0, 1, 0.0f}, // Blue
{0, 1, 1, 0.25f}, // Cyan
{0, 1, 0, 0.5f}, // Green
{1, 1, 0, 0.75f}, // Yellow
{1, 0, 0, 1.0f} // Red
};
}
//-- Places a 2 color heatmap gradient (Blue to Red):
static const Color_Points k2BlueRedHeatMap()
{
return
{
{0, 0, 1, 0.0f}, // Blue
{1, 0, 0, 1.0f} // Red
};
}
private:
Color_Points color_map; // An array of color points in ascending value
public:
//-- Default constructor:
explicit Color_Gradient(const Color_Points & rhs_color = k5ColorHeatMap())
: color_map(rhs_color) {}
//-- Inputs a (value) between 0 and 1 and outputs the (red), (green) and (blue)
//-- values representing that position in the gradient.
void getColor
(
const float value,
float & red,
float & green,
float & blue
) const
{
if (color_map.empty())
return;
for (int i = 0; i < color_map.size(); ++i)
{
const Color_Point &currC = color_map[i];
if (value < currC.val)
{
const Color_Point &prevC = color_map[ std::max(0, i-1) ];
const float valueDiff = (prevC.val - currC.val);
const float fractBetween = (valueDiff==0) ? 0 : (value - currC.val) / valueDiff;
red = (prevC.r - currC.r) * fractBetween + currC.r;
green = (prevC.g - currC.g) * fractBetween + currC.g;
blue = (prevC.b - currC.b) * fractBetween + currC.b;
return;
}
}
red = color_map.back().r;
green = color_map.back().g;
blue = color_map.back().b;
return;
}
};
} // namespace graphics
} // namespace openMVG
#endif // OPENMVG_GRAPHICS_COLOR_GRADIENT_HPP
| 3,567
|
C++
|
.h
| 106
| 29.981132
| 97
| 0.621661
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| true
| false
| true
| false
|
27,222
|
progressinterface.hpp
|
openMVG_openMVG/src/openMVG/system/progressinterface.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (C) 2017 Pierre Moulon
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_SYSTEM_PROGRESS_HPP
#define OPENMVG_SYSTEM_PROGRESS_HPP
#include <atomic>
#include <cstdint>
#include <string>
namespace openMVG {
namespace system {
//
// Class to keep track of the progress of a task.
// 1. Set the number of expected steps
// 2. Increment the number of completed step on the go
// 3. Ask for pourcentage along the process.
// Example:
// const std::uint32_t kExpectedCount = 300;
// ProgressInterface progress(kExpectedCount);
// for (std::uint32_t i = 0; i < kExpectedCount; ++i)
// {
// std::cout << progress.Percent() << " ";
// ++progress;
// }
//
class ProgressInterface {
public:
/** @brief Standard constructor
* @param[in] expected_count The number of step of the process
**/
explicit ProgressInterface(const std::uint32_t expected_count = 1) noexcept
{
Restart(expected_count);
}
/// Destructor
virtual ~ProgressInterface() = default;
/** @brief Initializer of the ProgressInterface class
* @param[in] expected_count The number of step of the process
* @param[in] msg an optional status message
* @return void if the progress class can be initialized, else it return false
**/
virtual void Restart(const std::uint32_t expected_count, const std::string& msg = {})
{
count_ = 0;
expected_count_ = expected_count;
}
/** @brief Indicator if the current operation should be aborted.
* @return Return true if the process has been canceled by the user.
**/
virtual bool hasBeenCanceled()const { return false; }
/**
* @brief Post-Increment operator
* @param[in] increment the number of step that we want to increment the internal step counter
* @return the value of the internal count => count()
**/
virtual std::uint32_t operator+=(const std::uint32_t increment)
{
count_ += increment;
return count_;
}
/**
* @brief Pre-Increment operator
* @return the value of count_
**/
virtual std::uint32_t operator++()
{
return operator+=(1);
}
/** @brief A dummy progress reporter. Does nothing.
**/
static ProgressInterface& dummy()
{
static ProgressInterface null;
return null;
}
/**
* @brief Get the percent progress of the process
* @return The percentage of the progress
**/
int Percent() const
{
return static_cast<int>(count_ / static_cast<float>(expected_count_) * 100.f + 0.5f);
}
//--
//-- Accessor
//--
/**
* @brief Get the internal count step
* @return The current progress value
**/
std::uint32_t count() const { return count_; }
/**
* @brief Get the value of expected_count_
* @return The value of expected_count_
**/
std::uint32_t expected_count() const { return expected_count_; }
protected:
/// Number of expected number of steps
std::uint32_t expected_count_;
/// Tracking of the number of completed steps => count_ will evolve in [0, expected_count_]
std::atomic<std::uint32_t> count_;
};
} // namespace system
} // namespace openMVG
#endif // OPENMVG_SYSTEM_PROGRESS_HPP
| 3,346
|
C++
|
.h
| 106
| 28.59434
| 96
| 0.69491
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,224
|
logger.hpp
|
openMVG_openMVG/src/openMVG/system/logger.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (C) 2017 Pierre Moulon
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_SYSTEM_LOGGER_HPP
#define OPENMVG_SYSTEM_LOGGER_HPP
#include <iostream>
#include <sstream>
#include <string>
namespace openMVG {
namespace system {
namespace logger {
enum class ELogMode : unsigned char
{
VERBOSITY_INFO = 0,
VERBOSITY_WARNING,
VERBOSITY_ERROR
};
// Configure a default severity for the logger
static ELogMode logger_severity = ELogMode::VERBOSITY_INFO;
inline std::string ELogModeToString(const ELogMode & log_mode)
{
switch (log_mode)
{
case ELogMode::VERBOSITY_INFO:
return {"INFO: "};
case ELogMode::VERBOSITY_WARNING:
return {"WARNING: "};
case ELogMode::VERBOSITY_ERROR:
return {"ERROR: "};
default:
return {"UNKNOWN: "};
}
return {"UNKNOWN: "};
}
class StreamMessageLogger
{
private:
std::ostringstream ostream_;
public:
StreamMessageLogger() = default;
//--
// Make this class non copyable
StreamMessageLogger( const StreamMessageLogger & other ) = delete; // non construction-copyable
StreamMessageLogger & operator=( const StreamMessageLogger & ) = delete; // non copyable
~StreamMessageLogger()
{
ostream_ << '\n';
// Output the contents of the stream (cerr by default)
std::cerr << ostream_.str();
}
std::ostringstream & ostream() { return ostream_; }
StreamMessageLogger & setMessage(
ELogMode mode = ELogMode::VERBOSITY_INFO,
const std::string & file = "",
const std::string & line = "",
const std::string & message = "")
{
ostream_
<< ELogModeToString(mode)
<< '['<< file << ':' << line << "] "
<< message;
return *this;
}
};
class NullBuffer : public std::streambuf
{
public:
void operator&(const std::ostream &s) { }
};
// strips filepath to get filename (part after / or \ if any)
inline const char* filename(const char* path)
{
for (auto ptr = path; *ptr; ++ptr)
{
if (*ptr == '/' || *ptr == '\\')
{
path = ptr + 1;
}
}
return path;
}
} // namespace logger
} // namespace system
} // namespace openMVG
#define OPENMVG_LOG(MODE) \
(MODE < openMVG::system::logger::logger_severity)\
? (void) 0\
: openMVG::system::logger::NullBuffer() &\
openMVG::system::logger::StreamMessageLogger().setMessage(\
MODE,\
openMVG::system::logger::filename(__FILE__),\
std::to_string(__LINE__)).ostream()
#define OPENMVG_LOG_IF(MODE, condition) \
((MODE) < openMVG::system::logger::logger_severity || !(condition))? (void) 0\
: openMVG::system::logger::NullBuffer() &\
openMVG::system::logger::StreamMessageLogger().setMessage(\
MODE,\
openMVG::system::logger::filename(__FILE__),\
std::to_string(__LINE__)).ostream()
#define OPENMVG_LOG_INFO OPENMVG_LOG(openMVG::system::logger::ELogMode::VERBOSITY_INFO)
#define OPENMVG_LOG_WARNING OPENMVG_LOG(openMVG::system::logger::ELogMode::VERBOSITY_WARNING)
#define OPENMVG_LOG_ERROR OPENMVG_LOG(openMVG::system::logger::ELogMode::VERBOSITY_ERROR)
#define OPENMVG_LOG_INFO_IF(condition) OPENMVG_LOG_IF(openMVG::system::logger::ELogMode::VERBOSITY_INFO, condition)
#define OPENMVG_LOG_WARNING_IF(condition) OPENMVG_LOG_IF(openMVG::system::logger::ELogMode::VERBOSITY_WARNING, condition)
#define OPENMVG_LOG_ERROR_IF(condition) OPENMVG_LOG_IF(openMVG::system::logger::ELogMode::VERBOSITY_ERROR, condition)
#endif // OPENMVG_SYSTEM_LOGGER_HPP
| 3,706
|
C++
|
.h
| 108
| 30.833333
| 121
| 0.690263
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,225
|
loggerprogress.hpp
|
openMVG_openMVG/src/openMVG/system/loggerprogress.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (C) 2017 Pierre Moulon
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_SYSTEM_LOGPROGRESS_HPP
#define OPENMVG_SYSTEM_LOGPROGRESS_HPP
#include <openMVG/system/progressinterface.hpp>
#include <openMVG/system/logger.hpp>
#include <mutex>
namespace openMVG {
namespace system {
// Typical usage
// LoggerProgress progress(100, "My Task name", kModuloDisplay);
// for (int i = 0; i < 100; ++i) {
// ++progress; // Will log directly to the LOG interface something like [My Task name] 10%
// }
//
// If you want to have a fine control over the LOG you can use
// progress.increment(1) that return a string. The string is empty if there is not need to display progress update:
// (progress status modulo condition not meet)
// for (int i = 0; i < 100; ++i) {
// const bool is_display_required = progress.Increment(1);
// LOG_IF(INFO, is_display_required) << progress.PercentString(); // here the logger will write the actual code line number and file
// }
class LoggerProgress : public ProgressInterface {
public:
/** @brief Constructor
* @param[in] expected_count The number of step of the process
* @param[in] msg an optional status message that acts as the task name
* @param[in] modulo_percentage Indicate how often you want to display the progress status. Value must be in ]0;100[
**/
LoggerProgress(
const std::uint32_t expected_count=1,
const std::string& msg = {},
const int modulo_percentage = 10) noexcept
: ProgressInterface(expected_count),
msg_(""),
previously_displayed_percentage_(0),
modulo_percentage_(modulo_percentage)
{
if (modulo_percentage < 1 || modulo_percentage >= 100)
OPENMVG_LOG_ERROR << "modulo_percentage must be within the range ]0;100[.";
Restart(expected_count, msg);
}
/** @brief Initializer of the LoggerProgress class
* @param[in] expected_count The number of step of the process
* @param[in] msg an optional status message
* @return true if the progress class can be initialized, else it return false
**/
void Restart(const std::uint32_t expected_count, const std::string& msg = {}) override
{
ProgressInterface::Restart(expected_count);
msg_ = msg.empty() ? "" : "[" + msg + "]";
}
/**
* @brief Post-Increment operator (Display the progress status only if needed)
* @param[in] increment the number of step that we want to increment the internal step counter
* @return the value of the internal count => count()
**/
inline std::uint32_t operator+=(const std::uint32_t increment) override
{
std::lock_guard<std::mutex> lock(mutex_);
const auto res = ProgressInterface::operator+=(increment);
const auto percentage = Percent();
// Check if we need to display the progress status or not
if (percentage % modulo_percentage_ == 0 && previously_displayed_percentage_ != percentage) {
OPENMVG_LOG_INFO << PercentString();
previously_displayed_percentage_ = percentage;
}
return res;
}
/**
* @brief Increment operator (Return the progress status only if needed)
* @param[in] increment the number of step that we want to increment the internal step counter
* @return true if the progress status must be displayed. Else it is not necessary to display it
**/
inline bool Increment(const int increment = 1)
{
std::ostringstream os;
std::lock_guard<std::mutex> lock(mutex_);
ProgressInterface::operator+=(increment);
const auto percentage = Percent();
// Check if we need to display this progress status or not
if (percentage % modulo_percentage_ == 0 && previously_displayed_percentage_ != percentage) {
previously_displayed_percentage_ = percentage;
return true;
}
return false;
}
/**
* @brief Pre-Increment operator (Display the progress status only if needed)
* @return the value of the internal count => count()
**/
inline std::uint32_t operator++() override
{
return this->operator+=(1);
}
/// Return the percentage of process as a string of type "[msg_] X%"
inline std::string PercentString() const
{
return msg_ + " " + std::to_string(Percent()) + "%";
}
private:
/// Store the task name
std::string msg_;
/// Store the previously displayed value: used in order to avoid the same percentage displayed many time
int previously_displayed_percentage_;
/// Store how many percent we need to display the progress status
int modulo_percentage_;
/// Mutex used to sync status update of the various internal variable
std::mutex mutex_;
};
} // namespace system
} // namespace openMVG
#endif // OPENMVG_SYSTEM_LOGPROGRESS_HPP
| 4,914
|
C++
|
.h
| 116
| 38.724138
| 134
| 0.706128
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,241
|
pairwiseAdjacencyDisplay.hpp
|
openMVG_openMVG/src/openMVG/matching/pairwiseAdjacencyDisplay.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2012, 2013 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_PAIRWISE_ADJACENCY_DISPLAY_HPP
#define OPENMVG_PAIRWISE_ADJACENCY_DISPLAY_HPP
#include <string>
#include "openMVG/matching/indMatch.hpp"
#include "openMVG/graphics/color_gradient.hpp"
#include "openMVG/vector_graphics/svgDrawer.hpp"
namespace openMVG {
namespace matching {
/// Display pair wises matches as an Adjacency matrix in svg format
void PairWiseMatchingToAdjacencyMatrixSVG
(
const size_t NbImages,
const matching::PairWiseMatches & map_Matches,
const std::string & sOutName
)
{
if ( !map_Matches.empty())
{
// Set the coloring gradient interface
graphics::Color_Gradient heatMapGradient(graphics::Color_Gradient::k2BlueRedHeatMap());
float max_match_count = 0;
for (const auto & match_it : map_Matches)
{
max_match_count = std::max(max_match_count, static_cast<float>(match_it.second.size()));
}
const float scaleFactor = 5.0f;
svg::svgDrawer svgStream((NbImages+3)*5, (NbImages+3)*5);
// Go along all possible pair
for (size_t I = 0; I < NbImages; ++I) {
for (size_t J = 0; J < NbImages; ++J) {
// If the pair have matches display a blue boxes at I,J position.
auto iterSearch = map_Matches.find({I,J});
if (iterSearch != map_Matches.end() && !iterSearch->second.empty())
{
// Display as a tooltip: (IndexI, IndexJ NbMatches)
std::ostringstream os;
os << "(" << J << "," << I << " " << iterSearch->second.size() <<")";
float r,g,b;
heatMapGradient.getColor(iterSearch->second.size() / max_match_count, r, g, b);
std::ostringstream os_color;
os_color << "rgb(" << int(r * 255) << "," << int(g * 255) << "," << int(b * 255) << ")";
svgStream << svg::drawSquare(J*scaleFactor, I*scaleFactor, scaleFactor/2.0f,
svg::svgAttributes().fill(os_color.str()).noStroke());
} // HINT : THINK ABOUT OPACITY [0.4 -> 1.0] TO EXPRESS MATCH COUNT
}
}
// Display axes with 0 -> NbImages annotation : _|
std::ostringstream osNbImages;
osNbImages << NbImages;
svgStream << svg::drawText((NbImages+1)*scaleFactor, scaleFactor, scaleFactor, "0", "black");
svgStream << svg::drawText((NbImages+1)*scaleFactor,
(NbImages)*scaleFactor - scaleFactor, scaleFactor, osNbImages.str(), "black");
svgStream << svg::drawLine((NbImages+1)*scaleFactor, 2*scaleFactor,
(NbImages+1)*scaleFactor, (NbImages)*scaleFactor - 2*scaleFactor,
svg::svgAttributes().stroke("black", 1.0));
svgStream << svg::drawText(scaleFactor, (NbImages+1)*scaleFactor, scaleFactor, "0", "black");
svgStream << svg::drawText((NbImages)*scaleFactor - scaleFactor,
(NbImages+1)*scaleFactor, scaleFactor, osNbImages.str(), "black");
svgStream << svg::drawLine(2*scaleFactor, (NbImages+1)*scaleFactor,
(NbImages)*scaleFactor - 2*scaleFactor, (NbImages+1)*scaleFactor,
svg::svgAttributes().stroke("black", 1.0));
std::ofstream svgFileStream( sOutName);
svgFileStream << svgStream.closeSvgFile().str();
}
}
} // namespace matching
} // namespace openMVG
#endif // OPENMVG_PAIRWISE_ADJACENCY_DISPLAY_HPP
| 3,488
|
C++
|
.h
| 73
| 42.684932
| 99
| 0.671664
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,244
|
metric_hnsw.hpp
|
openMVG_openMVG/src/openMVG/matching/metric_hnsw.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2020 Romain JANVIER
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MATCHING_METRIC_HNSW_HPP
#define OPENMVG_MATCHING_METRIC_HNSW_HPP
#include "openMVG/matching/metric_hamming.hpp"
#include "third_party/hnswlib/hnswlib.h"
/*
* This file define specialized HNSW kernels for differents metrics/spaces
*/
namespace openMVG {
namespace matching {
namespace custom_hnsw{
template <typename U>
static unsigned int HammingKernel(const void * pVect1, const void * pVect2, const void * qty_ptr)
{
constexpr openMVG::matching::Hamming<U> hamming{};
const U *a = static_cast<const U *>(pVect1);
const U *b = static_cast<const U *>(pVect2);
return hamming(a, b,*(static_cast<const size_t*>(qty_ptr)));
}
template <typename U>
class HammingSpace : public hnswlib::SpaceInterface<unsigned int>
{
hnswlib::DISTFUNC<unsigned int> fstdistfunc_;
size_t data_size_;
size_t dim_;
public:
explicit HammingSpace(size_t dim):
fstdistfunc_(HammingKernel<U>), dim_(dim), data_size_(dim * sizeof(U)) {}
~HammingSpace() {}
size_t get_data_size() override
{
return data_size_;
}
hnswlib::DISTFUNC<unsigned int> get_dist_func() override
{
return fstdistfunc_;
}
void *get_dist_func_param() override
{
return &dim_;
}
};
static int L1Kernel(const void * pVect1, const void * pVect2, const void * qty_ptr)
{
constexpr L1<uint8_t> metricL1{};
const uint8_t *a = static_cast<const uint8_t *>(pVect1); // we are sure this was an uint8
const uint8_t *b = static_cast<const uint8_t *>(pVect2);
return metricL1(a, b,*(static_cast<const size_t*>(qty_ptr)));
}
class L1SpaceInteger : public hnswlib::SpaceInterface<int>
{
hnswlib::DISTFUNC<int> fstdistfunc_;
size_t data_size_;
size_t dim_;
public:
explicit L1SpaceInteger(size_t dim):
fstdistfunc_(L1Kernel), dim_(dim), data_size_(dim * sizeof(uint8_t))
{}
~L1SpaceInteger() {}
size_t get_data_size() override
{
return data_size_;
}
hnswlib::DISTFUNC<int> get_dist_func() override
{
return fstdistfunc_;
}
void *get_dist_func_param() override
{
return &dim_;
}
};
} // namespace custom_hnsw
} // namespace matching
} // namespace openMVG
#endif // OPENMVG_MATCHING_METRIC_HNSW_HPP
| 2,486
|
C++
|
.h
| 80
| 28.4625
| 98
| 0.718357
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,247
|
matcher_hnsw.hpp
|
openMVG_openMVG/src/openMVG/matching/matcher_hnsw.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2019 Romain Janvier and Pierre Moulon
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MATCHING_MATCHER_HNSW_HPP
#define OPENMVG_MATCHING_MATCHER_HNSW_HPP
#include <memory>
#ifdef OPENMVG_USE_OPENMP
#include <omp.h>
#endif
#include <typeindex>
#include <vector>
#include "openMVG/matching/matching_interface.hpp"
#include "openMVG/matching/metric.hpp"
#include "openMVG/matching/metric_hnsw.hpp"
#include "third_party/hnswlib/hnswlib.h"
using namespace hnswlib;
namespace openMVG {
namespace matching {
enum HNSWMETRIC {
L2_HNSW,
L1_HNSW,
HAMMING_HNSW
};
// By default compute square(L2 distance).
template <typename Scalar = float, typename Metric = L2<Scalar>, HNSWMETRIC MetricType = HNSWMETRIC::L2_HNSW>
class HNSWMatcher: public ArrayMatcher<Scalar, Metric>
{
public:
using DistanceType = typename Metric::ResultType;
HNSWMatcher() = default;
virtual ~HNSWMatcher()= default;
/**
* Build the matching structure
*
* \param[in] dataset Input data.
* \param[in] nbRows The number of component.
* \param[in] dimension Length of the data contained in the dataset.
*
* \return True if success.
*/
bool Build
(
const Scalar * dataset,
int nbRows,
int dimension
) override
{
HNSW_metric_.reset();
HNSW_matcher_.reset();
if (nbRows < 1)
{
return false;
}
dimension_ = dimension;
const std::type_index distance_type(typeid(DistanceType));
// Here this is tricky since there is no specialization
switch (MetricType)
{
case HNSWMETRIC::L1_HNSW:
if (distance_type == typeid(int)) {
HNSW_metric_.reset(dynamic_cast<SpaceInterface<DistanceType> *>(new custom_hnsw::L1SpaceInteger(dimension)));
}
break;
case HNSWMETRIC::L2_HNSW:
if (distance_type == typeid(int)) {
HNSW_metric_.reset(dynamic_cast<SpaceInterface<DistanceType> *>(new L2SpaceI(dimension)));
} else
if (distance_type == typeid(float)) {
HNSW_metric_.reset(dynamic_cast<SpaceInterface<DistanceType> *>(new L2Space(dimension)));
}
break;
case HNSWMETRIC::HAMMING_HNSW:
if (distance_type == typeid(unsigned int)) {
HNSW_metric_.reset(dynamic_cast<SpaceInterface<DistanceType> *>(new custom_hnsw::HammingSpace<uint8_t>(dimension)));
}
break;
}
if (!HNSW_metric_) {
OPENMVG_LOG_ERROR << "HNSW matcher: this type of distance is not handled yet";
return false;
}
HNSW_matcher_.reset(new HierarchicalNSW<DistanceType>(HNSW_metric_.get(), nbRows, 16, 100));
// add a first point...
HNSW_matcher_->addPoint(static_cast<const void *>(dataset), static_cast<size_t>(0));
//...and the others in parallel
#ifdef OPENMVG_USE_OPENMP
#pragma omp parallel for
#endif
for (int vector_id = 1; vector_id < nbRows; ++vector_id) {
HNSW_matcher_->addPoint(static_cast<const void *>(dataset + dimension * vector_id), static_cast<size_t>(vector_id));
}
return true;
};
/**
* Search the nearest Neighbor of the scalar array query.
*
* \param[in] query The query array.
* \param[out] indice The indice of array in the dataset that.
* have been computed as the nearest array.
* \param[out] distance The distance between the two arrays.
*
* \return True if success.
*/
bool SearchNeighbour
(
const Scalar * query,
int * indice,
DistanceType * distance
) override
{
if (!HNSW_matcher_)
return false;
HNSW_matcher_->setEf(16); //here we stay conservative but it could probably be lowered in this case (first NN)
const auto result = HNSW_matcher_->searchKnn(query, 1).top();
*indice = result.second;
*distance = result.first;
return true;
}
/**
* Search the N nearest Neighbor of the scalar array query.
*
* \param[in] query The query array.
* \param[in] nbQuery The number of query rows.
* \param[out] indices The corresponding (query, neighbor) indices.
* \param[out] distances The distances between the matched arrays.
* \param[in] NN The number of maximal neighbor that will be searched.
*
* \return True if success.
*/
bool SearchNeighbours
(
const Scalar * query, int nbQuery,
IndMatches * pvec_indices,
std::vector<DistanceType> * pvec_distances,
size_t NN
) override
{
if (!HNSW_matcher_)
return false;
// EfSearch parameter could not be < NN.
// -
// For vectors with dimensionality of approx. 64-128 and for 2 NNs,
// EfSearch = 16 produces good results in conjunction with other parameters fixed in this file (EfConstruct = 16, M = 100).
// But nothing has been evaluated on our side for lower / higher dimensionality and for a higher number of NNs.
// So for now and for NN > 2, EfSearch is fixed to 2 * NNs without a good a priori knowledge.
// A good value for EfSearch could really depends on the two other parameters (EfConstruct / M).
if (NN <= 2) {
HNSW_matcher_->setEf(16);
} else {
HNSW_matcher_->setEf(std::max(NN*2, static_cast<size_t>(nbQuery)));
}
pvec_indices->resize(nbQuery * NN);
pvec_distances->resize(nbQuery * NN);
#ifdef OPENMVG_USE_OPENMP
#pragma omp parallel for
#endif
for (int query_id = 0; query_id < nbQuery; query_id++) {
auto result = HNSW_matcher_->searchKnn(static_cast<const void *>(query + dimension_ * query_id), NN);
size_t result_id = NN - 1;
while(!result.empty())
{
const auto & res = result.top();
const size_t match_id = query_id * NN + result_id;
pvec_indices->operator[](match_id) = {static_cast<IndexT>(query_id), static_cast<IndexT>(res.second)};
pvec_distances->operator[](match_id) = res.first;
result.pop();
result_id--;
}
}
return true;
};
private:
int dimension_;
std::unique_ptr<SpaceInterface<DistanceType>> HNSW_metric_;
std::unique_ptr<HierarchicalNSW<DistanceType>> HNSW_matcher_;
};
} // namespace matching
} // namespace openMVG
#endif // OPENMVG_MATCHING_MATCHER_HNSW_HPP
| 6,399
|
C++
|
.h
| 181
| 30.878453
| 127
| 0.676623
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,281
|
E_ACRobust_Angular.hpp
|
openMVG_openMVG/src/openMVG/matching_image_collection/E_ACRobust_Angular.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2017 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MATCHING_IMAGE_COLLECTION_E_SPHERICAL_ACROBUST_ANGULAR_HPP
#define OPENMVG_MATCHING_IMAGE_COLLECTION_E_SPHERICAL_ACROBUST_ANGULAR_HPP
#include <limits>
#include <type_traits>
#include <utility>
#include <vector>
#include "openMVG/cameras/Camera_Intrinsics.hpp"
#include "openMVG/matching/indMatch.hpp"
#include "openMVG/matching_image_collection/Geometric_Filter_utils.hpp"
#include "openMVG/multiview/essential.hpp"
#include "openMVG/multiview/motion_from_essential.hpp"
#include "openMVG/multiview/solver_essential_eight_point.hpp"
#include "openMVG/multiview/solver_essential_three_point.hpp"
#include "openMVG/robust_estimation/robust_estimator_ACRansac.hpp"
#include "openMVG/robust_estimation/robust_estimator_ACRansacKernelAdaptator.hpp"
#include "openMVG/sfm/sfm_data.hpp"
#include "openMVG/system/logger.hpp"
namespace openMVG { namespace sfm { struct Regions_Provider; } }
namespace openMVG {
namespace matching_image_collection {
template <bool isUprightEssentialMatrix = false>
//-- A contrario essential matrix estimation template functor used for filter pair of putative correspondences
struct GeometricFilter_ESphericalMatrix_AC_Angular
{
GeometricFilter_ESphericalMatrix_AC_Angular(
const double precision_upper_bound,
const size_t iteration)
: m_precision_upper_bound(precision_upper_bound),
m_stIteration(iteration),
m_E(Mat3::Identity()),
m_precision_upper_bound_robust(std::numeric_limits<double>::infinity())
{
};
/// Robust fitting of the ESSENTIAL matrix
template<typename Regions_or_Features_ProviderT>
bool Robust_estimation(
const sfm::SfM_Data * sfm_data,
const std::shared_ptr<Regions_or_Features_ProviderT> & regions_provider,
const Pair pairIndex,
const matching::IndMatches & vec_PutativeMatches,
matching::IndMatches & geometric_inliers)
{
using namespace openMVG;
using namespace openMVG::robust;
geometric_inliers.clear();
// Get back corresponding view index
const IndexT iIndex = pairIndex.first;
const IndexT jIndex = pairIndex.second;
//--
// Reject pair with missing Intrinsic information
//--
const sfm::View
* view_I = sfm_data->views.at(iIndex).get(),
* view_J = sfm_data->views.at(jIndex).get();
// Check that valid cameras can be retrieved for the pair of views
const cameras::IntrinsicBase
* cam_I =
sfm_data->GetIntrinsics().count(view_I->id_intrinsic) ?
sfm_data->GetIntrinsics().at(view_I->id_intrinsic).get() : nullptr,
* cam_J =
sfm_data->GetIntrinsics().count(view_J->id_intrinsic) ?
sfm_data->GetIntrinsics().at(view_J->id_intrinsic).get() : nullptr;
if (!cam_I || !cam_J)
{
OPENMVG_LOG_WARNING << "Skip this pair. No intrinsic information: "
<< '(' << iIndex << ',' << jIndex << ')';
return false;
}
//--
// Get corresponding point regions arrays
//--
Mat2X xI,xJ;
MatchesPairToMat(pairIndex, vec_PutativeMatches, sfm_data, regions_provider, xI, xJ);
const Mat3X
xI_bearing_vector = (*cam_I)(xI),
xJ_bearing_vector = (*cam_J)(xJ);
//--
// Robust estimation
//--
// Define the AContrario angular error adaptor
typedef openMVG::robust::ACKernelAdaptor_AngularRadianError<
typename std::conditional<isUprightEssentialMatrix,
// Use the 3 point solver in order to estimate E (Upright)
openMVG::essential::kernel::ThreePointUprightRelativePoseSolver,
// Use the 8 point solver in order to estimate E
openMVG::EightPointRelativePoseSolver>::type,
openMVG::AngularError,
Mat3>
KernelType;
KernelType kernel(xI_bearing_vector, xJ_bearing_vector);
// Robustly estimate the Essential matrix with A Contrario ransac
const double upper_bound_precision =
(m_precision_upper_bound != std::numeric_limits<double>::infinity())?
D2R(m_precision_upper_bound) : std::numeric_limits<double>::infinity();
std::vector<uint32_t> vec_inliers;
const auto ac_ransac_output =
ACRANSAC(kernel, vec_inliers, m_stIteration, &m_E, upper_bound_precision);
const double & threshold = ac_ransac_output.first;
// Decompose the essential matrix and keep the best solution (if any)
{
geometry::Pose3 relative_pose;
std::vector<uint32_t> inliers_indexes;
std::vector<Vec3> inliers_X;
if (RelativePoseFromEssential(
xI_bearing_vector, xJ_bearing_vector,
m_E, vec_inliers,
&relative_pose, &inliers_indexes, &inliers_X))
{
m_relativePose = relative_pose;
vec_inliers = inliers_indexes;
}
else
{
vec_inliers.clear();
}
}
if (vec_inliers.size() > KernelType::MINIMUM_SAMPLES * 2.5)
{
m_precision_upper_bound_robust = ac_ransac_output.first;
// update geometric_inliers
geometric_inliers.reserve(vec_inliers.size());
for (const size_t & index : vec_inliers)
{
geometric_inliers.push_back( vec_PutativeMatches[index] );
}
return true;
}
else
{
vec_inliers.clear();
return false;
}
}
bool Geometry_guided_matching
(
const sfm::SfM_Data * sfm_data,
const std::shared_ptr<sfm::Regions_Provider> & regions_provider,
const Pair pairIndex,
const double dDistanceRatio,
matching::IndMatches & matches
)
{
OPENMVG_LOG_ERROR << "Not yet implemented";
return false;
}
// upper_bound precision used for robust estimation
double m_precision_upper_bound = std::numeric_limits<double>::infinity();
// maximal number of iteration for robust estimation
size_t m_stIteration = 1024;
//
//-- Stored data
Mat3 m_E;
geometry::Pose3 m_relativePose;
double m_precision_upper_bound_robust;
};
} // namespace matching_image_collection
} // namespace openMVG
#endif // OPENMVG_MATCHING_IMAGE_COLLECTION_E_SPHERICAL_ACROBUST_ANGULAR_HPP
| 6,313
|
C++
|
.h
| 163
| 33.668712
| 110
| 0.704345
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,282
|
Vlad.hpp
|
openMVG_openMVG/src/openMVG/matching_image_collection/Vlad.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2020 Pierre MOULON, Romain JANVIER
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MATCHING_IMAGE_COLLECTION_VLAD_HPP
#define OPENMVG_MATCHING_IMAGE_COLLECTION_VLAD_HPP
#include "openMVG/matching_image_collection/VladBase.hpp"
#include "openMVG/clustering/kmeans.hpp"
#include "openMVG/features/descriptor.hpp"
#include "openMVG/matching/regions_matcher.hpp"
namespace openMVG {
template<typename RegionTypeT>
class VLAD : public VLADBase
{
public:
DescriptorVector RegionsToCodebook(
const std::vector<IndexT>& view_ids,
std::shared_ptr<sfm::Regions_Provider> learning_regions_provider
) override
{
using ScalarT = typename RegionTypeT::DescriptorT::bin_type;
using ConstMatrixRef =
Eigen::Map<const Eigen::Matrix<ScalarT, Eigen::Dynamic, Eigen::Dynamic,
Eigen::RowMajor>>;
DescriptorVector descriptor_array;
const size_t base_descriptor_length =
learning_regions_provider->getRegionsType()->DescriptorLength();
for (const auto &view_id : view_ids) {
const auto ®ions = learning_regions_provider->get(view_id);
RegionTypeT *cast_centroid_regions =
dynamic_cast<RegionTypeT *>(regions.get());
const ScalarT *tab =
reinterpret_cast<const ScalarT *>(cast_centroid_regions->DescriptorRawData());
ConstMatrixRef descriptors(tab, cast_centroid_regions->RegionCount(),
base_descriptor_length);
for (int region_id = 0; region_id < cast_centroid_regions->RegionCount(); ++region_id) {
descriptor_array.emplace_back(
descriptors.row(region_id).template cast<typename DescriptorType::Scalar>());
}
}
return descriptor_array;
}
DescriptorVector BuildCodebook(
const DescriptorVector& descriptor_array,
const int codebook_size = 128,
const int max_nb_iteration = 25) override
{
DescriptorVector codebook;
std::vector<uint32_t> vec_ids;
const clustering::KMeansInitType k_mean_init_type =
clustering::KMeansInitType::
KMEANS_INIT_RANDOM; // Kmean PP is way too slow vs. Random init (even
// if PP is better for corner cases)
const bool do_progress_display = max_nb_iteration != std::numeric_limits<uint32_t>::max();
system::LoggerProgress progress;
clustering::KMeans(
descriptor_array,
vec_ids,
codebook,
codebook_size,
max_nb_iteration,
k_mean_init_type,
&progress);
return codebook;
}
// Utility function
void CodebookToRegions(
std::unique_ptr<features::Regions>& centroid_regions,
const DescriptorVector& codebook
) const override
{
RegionTypeT *cast_centroid_regions =
dynamic_cast<RegionTypeT *>(centroid_regions.get());
cast_centroid_regions->Descriptors().reserve(codebook.size());
cast_centroid_regions->Features().resize(codebook.size());
for (const auto ¢roid : codebook) {
cast_centroid_regions->Descriptors().emplace_back(
centroid.template cast<typename RegionTypeT::DescriptorT::bin_type>());
}
// Note: We ignore filling feature data since we don't need them
}
VladMatrixType ComputeVLADEmbedding(
const std::vector<IndexT>& view_ids,
std::unique_ptr<features::Regions>& centroid_regions, // The codebook
std::shared_ptr<sfm::Regions_Provider> embedding_regions_provider,
const VLAD_NORMALIZATION vlad_normalization_type =
VLAD_NORMALIZATION::RESIDUAL_NORMALIZATION_PWR_LAW)
override
{
system::LoggerProgress progress;
const size_t codebook_size = centroid_regions->RegionCount();
const size_t base_descriptor_length =
embedding_regions_provider->getRegionsType()->DescriptorLength();
const size_t vlad_descriptor_length = base_descriptor_length * codebook_size;
VladMatrixType mat_vlad_descriptors =
VladMatrixType::Zero(vlad_descriptor_length, view_ids.size());
// For each image (regions), compute its VLAD representation
const RegionTypeT *cast_centroid_regions =
dynamic_cast<RegionTypeT *>(centroid_regions.get());
Vec vlad_desc(vlad_descriptor_length);
progress.Restart(
view_ids.size(), "- VLAD Embedding... -");
for (const auto &view_id : view_ids) {
vlad_desc.setZero();
const auto &query_regions = embedding_regions_provider->get(view_id);
// Retrieve indexes (match descriptors to centroids)
matching::IndMatches centroid_to_descriptor_associations;
matching::Match(matching::EMatcherType::BRUTE_FORCE_L2, *centroid_regions,
*query_regions, centroid_to_descriptor_associations);
const RegionTypeT *cast_query_regions =
dynamic_cast<RegionTypeT *>(query_regions.get());
// Accumulation of residual to the centroid
for (const auto centroid_id_and_descriptor_list :
centroid_to_descriptor_associations) {
const auto centroid_id = centroid_id_and_descriptor_list.i_;
const auto descriptor_id = centroid_id_and_descriptor_list.j_;
const auto residual =
cast_query_regions->Descriptors()[descriptor_id].template cast<double>() -
cast_centroid_regions->Descriptors()[centroid_id].template cast<double>();
switch (vlad_normalization_type) {
case VLAD_NORMALIZATION::RESIDUAL_NORMALIZATION_PWR_LAW: {
const auto norm_residual = residual.normalized();
vlad_desc.segment(centroid_id * base_descriptor_length,
base_descriptor_length) += residual;
}
break;
default:
vlad_desc.segment(centroid_id * base_descriptor_length,
base_descriptor_length) += residual;
}
}
// per descriptor normalization
for (int centroid_id = 0; centroid_id < codebook_size; ++centroid_id) {
auto local_vlad = vlad_desc.segment(centroid_id * base_descriptor_length,
base_descriptor_length);
switch (vlad_normalization_type) {
case VLAD_NORMALIZATION::INTRA_NORMALIZATION:
local_vlad.normalize();
break;
case VLAD_NORMALIZATION::SIGNED_SQUARE_ROOTING:
local_vlad =
local_vlad.array().sign() * local_vlad.array().abs().sqrt();
break;
case VLAD_NORMALIZATION::RESIDUAL_NORMALIZATION_PWR_LAW:
local_vlad =
local_vlad.array().sign() * local_vlad.array().abs().pow(0.2);
break;
}
}
// if(max_feats > 0) TODO(RJ): center adaptation for All About VLAD
// Global L2 normalization, it is used by all variants of VLAD
vlad_desc.normalize();
// Insert the vector into the matrix
mat_vlad_descriptors.col(view_id) =
vlad_desc.cast<VladMatrixType::Scalar>();
++progress;
}
return mat_vlad_descriptors;
}
};
} // namespace openMVG
#endif // OPENMVG_MATCHING_IMAGE_COLLECTION_VLAD_HPP
| 7,327
|
C++
|
.h
| 163
| 37.153374
| 94
| 0.673489
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,283
|
VladBase.hpp
|
openMVG_openMVG/src/openMVG/matching_image_collection/VladBase.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2020 Pierre MOULON, Romain JANVIER
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MATCHING_IMAGE_COLLECTION_VLADBASE_HPP
#define OPENMVG_MATCHING_IMAGE_COLLECTION_VLADBASE_HPP
#include "openMVG/sfm/pipelines/sfm_regions_provider.hpp"
namespace openMVG {
// Vector of Locally Aggregated Descriptors (VLAD) possible vector normalization
enum class VLAD_NORMALIZATION : uint8_t {
SIGNED_SQUARE_ROOTING =
0, // [1] Element wise power law normalization with alpha = 0.5 (SSR)
INTRA_NORMALIZATION, // [2] cluster wise L2 normalization, the so called
// "intra normalization"
RESIDUAL_NORMALIZATION_PWR_LAW // [3] Per residual L2 normalization (RN)
// followed by and element wise power law
// normalization with alpha = 0.2
};
// An implementation of Vector of Locally Aggregated Descriptors (VLAD) encoding
//
// [1]
// "Aggregating local descriptors into compact codes". H. Jegou, F.
// Perronnin, M. Douze, J. Sanchez, and P. Perez., C. Schmid. PAMI, 2012.
// [2]
// "All About VLAD". R. Arandjelovic and A. Zisserman. CVPR 2013.
// [3]
// "Revisiting the VLAD image representation". J. Delhumeau, P.H. Gosselin, H.
// Jégou, P. and Pérez. ACM Multimedia 2013.
class VLADBase
{
public:
using KmeanInternalType = float;
using VladInternalType = float;
using DescriptorType = Eigen::Matrix<KmeanInternalType, Eigen::Dynamic, 1>;
using DescriptorVector = std::vector<DescriptorType>;
// VLADs
using VladMatrixType =
Eigen::Matrix<VladInternalType, Eigen::Dynamic, Eigen::Dynamic>;
// IO
// Convert Regions to a contiguous feature vector
virtual DescriptorVector RegionsToCodebook(
const std::vector<IndexT>& view_ids,
std::shared_ptr<sfm::Regions_Provider> learning_regions_provider
) = 0;
// IO
// Convert a codebook to feature regions
virtual void CodebookToRegions(
std::unique_ptr<features::Regions>& centroid_regions,
const DescriptorVector& codebook
) const = 0;
// Build a codebook from a selection of descriptors
virtual DescriptorVector BuildCodebook(
const DescriptorVector& descriptor_array,
const int codebook_size = 128,
const int max_nb_iteration = 25) = 0;
// Compute the VLAD representation of each "image" given the codebook
// and its associated image descriptors
virtual VladMatrixType ComputeVLADEmbedding(
const std::vector<IndexT>& view_ids,
std::unique_ptr<features::Regions>& centroid_regions, // The codebook
std::shared_ptr<sfm::Regions_Provider> embedding_regions_provider,
const VLAD_NORMALIZATION vlad_normalization_type =
VLAD_NORMALIZATION::RESIDUAL_NORMALIZATION_PWR_LAW) = 0;
};
} // namespace openMVG
#endif // OPENMVG_MATCHING_IMAGE_COLLECTION_VLADBASE_HPP
| 3,072
|
C++
|
.h
| 67
| 41.597015
| 80
| 0.72849
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,287
|
Retrieval_Helpers.hpp
|
openMVG_openMVG/src/openMVG/matching_image_collection/Retrieval_Helpers.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2020 Pierre MOULON.
// Copyright (c) 2020 Romain JANVIER.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_RETRIEVAL_HELPERS_HPP
#define OPENMVG_RETRIEVAL_HELPERS_HPP
#include <string>
namespace openMVG {
namespace retrieval {
template <class Order>
using IndexedPairwiseSimilarity =
std::map<IndexT, std::map<double, IndexT, Order>>;
template <class Order>
inline bool savePairwiseSimilarityScores(
const std::string &sFileName,
const IndexedPairwiseSimilarity<Order> &simScores) {
std::ofstream outStream(sFileName.c_str());
if (!outStream.is_open()) {
std::cerr << std::endl
<< "Pairwise Similarity: Impossible to open the output specified "
"file: \""
<< sFileName << "\"." << std::endl;
return false;
}
for (const auto &cur_view : simScores) {
for (const auto &cur_pairwise_scores : cur_view.second) {
outStream << cur_view.first << ' ' << cur_pairwise_scores.second << ' '
<< cur_pairwise_scores.first << '\n';
}
}
const bool bOk = !outStream.bad();
outStream.close();
return bOk;
}
template <class Order>
inline bool loadPairwiseSimilarityScores(
const std::string &sFileName, IndexedPairwiseSimilarity<Order> &simScores) {
std::ifstream inStream(sFileName.c_str());
if (!inStream.is_open()) {
std::cerr << std::endl
<< "Pairwise Similarity: Impossible to open the input specified "
"file: \""
<< sFileName << "\"." << std::endl;
return false;
}
std::string sValue;
std::vector<std::string> vec_str;
while (std::getline(inStream, sValue)) {
stl::split(sValue, ' ', vec_str);
if (vec_str.size() != 3) {
std::cerr << "Pairwise Similarity: Invalid input file: \"" << sFileName
<< "\"." << std::endl;
return false;
}
IndexT i = 0, j = 0;
double score = 0.;
try {
i = static_cast<IndexT>(std::stoul(vec_str[0]));
j = std::stoul(vec_str[1]);
score = std::stod(vec_str[2]);
} catch (const std::exception &exp) {
return false;
}
if (i == j) continue;
simScores[i].insert({score, j});
}
inStream.close();
return true;
}
} // namespace retrieval
} // namespace openMVG
#endif // OPENMVG_RETRIEVAL_HELPERS_HPP
| 2,564
|
C++
|
.h
| 74
| 29.702703
| 80
| 0.639742
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,312
|
regions_scale_sort.hpp
|
openMVG_openMVG/src/openMVG/features/regions_scale_sort.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2019 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_FEATURES_REGIONS_SCALE_SORT_HPP
#define OPENMVG_FEATURES_REGIONS_SCALE_SORT_HPP
#include <numeric> // std::iota
#include <algorithm> // std::sort
namespace openMVG {
namespace features {
/// Get the reordering indexes of the feature according the feature scale
/// reordered by increasing scale.
template <typename T>
std::vector<size_t> sort_indexes_by_scale(const std::vector<T> &v) {
// initialize original index locations
std::vector<size_t> idx(v.size());
std::iota(idx.begin(), idx.end(), 0);
// sort indexes based on comparing scale values of the features in v
std::sort(idx.begin(), idx.end(),
[&v](size_t i1, size_t i2) {return v[i1].scale() < v[i2].scale();});
return idx;
}
/// Sort the features and descriptor according the scale of the feature
/// A `keep_count` filter can be used to select only the feature with the largest scale
template
<
typename FeatT,
typename DescsT
>
bool SortAndSelectByRegionScale
(
std::vector<FeatT> & feats,
DescsT & descs,
int keep_count = -1
)
{
return false;
}
/// SortAndSelectByRegionScale specialization for the SIOPointFeature type.
template
<
typename FeatT,
typename DescsT
>
bool SortAndSelectByRegionScale
(
std::vector<SIOPointFeature> & feats,
DescsT & descs,
int keep_count = -1
)
{
// Reorder features and descriptors
// a. get the re-ordering sequence
// b. apply the re-ordering sequence
const std::vector<size_t> re_ordering = sort_indexes_by_scale(feats);
auto feats_reordered = feats;
auto descs_reordered = descs;
for (size_t i = 0; i < re_ordering.size(); ++i)
{
feats_reordered[i] = feats[re_ordering[i]];
descs_reordered[i] = descs[re_ordering[i]];
}
// Keep only the regions with the largest scale:
{
const int region_to_keep =
(keep_count == -1) ?
feats_reordered.size() :
std::min(keep_count, static_cast<int>(feats_reordered.size()));
auto start_feat_it = std::prev(feats_reordered.end(), region_to_keep);
feats.assign(start_feat_it, feats_reordered.end());
auto start_desc_it = std::prev(descs_reordered.end(), region_to_keep);
descs.assign(start_desc_it, descs_reordered.end());
}
return true;
}
} // namespace features
} // namespace openMVG
#endif // OPENMVG_FEATURES_REGIONS_SCALE_SORT_HPP
| 2,633
|
C++
|
.h
| 79
| 30.734177
| 87
| 0.7162
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,334
|
svgElement.hpp
|
openMVG_openMVG/src/openMVG/vector_graphics/svgElement.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2019 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef SVG_ELEMENT_HPP
#define SVG_ELEMENT_HPP
#include <iterator>
#include <sstream>
#include <string>
namespace svg {
//
// Collection of functions to add ability to describe SVG element
// see https://developer.mozilla.org/en-US/docs/Web/SVG/Element
//
///Circle draw -> x,y position and radius
static std::string drawCircle(float cx, float cy, float r, const svgAttributes & style)
{
std::ostringstream os;
os << "<circle cx=\"" << cx << "\"" << " cy=\"" << cy << "\""
<< " r=\"" << r << "\""
<< style.getSvgStream() + (style.bTooltip() ? "</circle>" : "/>\n");
return os.str();
}
///Line draw -> start and end point
static std::string drawLine(float ax, float ay, float bx, float by, const svgAttributes & style)
{
std::ostringstream os;
os <<
"<polyline points=\""<< ax << "," << ay << "," << bx << "," << by <<"\""
<< style.getSvgStream() + (style.bTooltip() ? "</polyline>" : "/>\n");
return os.str();
}
///Reference to an image (path must be relative to the svg file)
static std::string drawImage(const std::string & simagePath, int W, int H,
int posx = 0, int posy = 0, float opacity =1.f)
{
std::ostringstream os;
os <<
"<image x=\""<< posx << "\"" << " y=\""<< posy << "\""
<< " width=\""<< W << "px\"" << " height=\""<< H << "px\""
<< " opacity=\""<< opacity << "\""
<< " xlink:href=\"" << simagePath << "\"" << "/>\n";
return os.str();
}
///Circle draw -> x,y position and width and height
static std::string drawRectangle(float cx, float cy, float W, float H,
const svgAttributes & style)
{
std::ostringstream os;
os << "<rect x=\"" << cx << "\""
<< " y=\"" << cy << "\""
<< " width=\"" << W << "\""
<< " height=\"" << H << "\""
<< style.getSvgStream() + (style.bTooltip() ? "</rect>" : "/>\n");
return os.str();
}
///Square draw -> x,y position and size
static std::string drawSquare(float cx, float cy, float W,
const svgAttributes & style)
{
return drawRectangle(cx, cy, W, W, style);
}
///Text display -> x,y position, font size
static std::string drawText(float cx, float cy, float fontSize = 1.0f,
const std::string & stext = "", const std::string & scol = "")
{
std::ostringstream os;
os << "<text" << " x=\"" << cx << "\"" << " y=\"" << cy << "\""
<< " font-size=\"" << fontSize << "\"";
if (!scol.empty())
os << " fill=\"" << scol << "\"";
os << ">" << stext << "</text>\n";
return os.str();
}
// Draw a polyline for point data saved in non contiguous format
// X and Y data are saved in two different container
template< typename DataInputIteratorX, typename DataInputIteratorY>
static std::string drawPolyline(DataInputIteratorX xStart, DataInputIteratorX xEnd,
DataInputIteratorY yStart, DataInputIteratorY yEnd,
const svgAttributes & style)
{
std::ostringstream os;
os << "<polyline points=\"";
DataInputIteratorY itery = yStart;
for (DataInputIteratorX iterx = xStart;
iterx != xEnd;
std::advance(iterx, 1), std::advance(itery, 1))
{
os << *iterx << ',' << *itery << ' ';
}
os << "\"" << style.getSvgStream() + (style.bTooltip() ? "</polyline>" : "/>\n");
return os.str();
}
// Draw a polyline for point data saved in contiguous format (x0,y0,x1,y1,...)
template< typename DataInputIteratorXY>
static std::string drawPolyline(DataInputIteratorXY points,
const svgAttributes & style)
{
std::ostringstream os;
os << "<polyline points=\"";
std::copy(points.cbegin(), points.cend(),
std::ostream_iterator<typename DataInputIteratorXY::value_type>(os, ","));
os << "\""
<< style.getSvgStream() + (style.bTooltip() ? "</polyline>" : "/>\n");
return os.str();
}
} // namespace svg
#endif // SVG_ELEMENT_HPP
| 4,025
|
C++
|
.h
| 109
| 34.302752
| 96
| 0.62115
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,335
|
svgDrawer.hpp
|
openMVG_openMVG/src/openMVG/vector_graphics/svgDrawer.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2011, 2012, 2013, 2019 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef SVG_DRAWER_HPP
#define SVG_DRAWER_HPP
#include "svgAttributes.hpp"
#include "svgElement.hpp"
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
namespace svg {
//
// Helper class to stream SVG element to a stream/string
// See https://developer.mozilla.org/en-US/docs/Web/SVG
//
/// Class to handle concatenation of SVG elements and export of the XML content to a file.
/// Classic usage:
/// svgDrawer svg_surface;
/// svg_surface << drawCircle(1, 1, 0.5);
// Then export "svgDrawer.closeSvgFile().str()" to a .svg file.
class svgDrawer{
public:
///Constructor
svgDrawer(const size_t width = 0, const size_t height = 0)
{
svg_stream
<< "<?xml version=\"1.0\" standalone=\"yes\"?>\n"
<< "<!-- SVG graphic -->" << "\n"
<< "<svg xmlns='http://www.w3.org/2000/svg'"
<< " xmlns:xlink='http://www.w3.org/1999/xlink'" << "\n";
if (width > 0 && height > 0)
svg_stream
<<"width=\"" << width << "px\" height=\""<< height << "px\""
<< " preserveAspectRatio=\"xMinYMin meet\""
<< " viewBox=\"0 0 " << width << ' ' << height <<"\"";
svg_stream <<" version=\"1.1\">\n";
}
svgDrawer &operator << (const std::string & svg_element)
{
svg_stream << svg_element;
return *this;
}
///Close the svg tag.
std::ostringstream & closeSvgFile()
{
svg_stream <<"</svg>";
return svg_stream;
}
private:
std::ostringstream svg_stream;
};
} // namespace svg
#endif // SVG_DRAWER_HPP
| 1,838
|
C++
|
.h
| 56
| 29.678571
| 90
| 0.6431
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,336
|
svgHistogram.hpp
|
openMVG_openMVG/src/openMVG/vector_graphics/svgHistogram.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2011, 2012, 2013, 2019 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef SVG_HISTOGRAM_HPP
#define SVG_HISTOGRAM_HPP
#include "svgDrawer.hpp"
#include <fstream>
#include <vector>
namespace svg {
/// Helper function to draw a SVG histogram
/// ____
/// | | ___ |
/// | |__| | |
/// | | | | |
/// -----------|
template<typename T>
static std::string stringifier(const T & t)
{
std::ostringstream os;
os << t;
return os.str();
}
template<typename T>
bool drawHistogram(const std::vector<T> & vec_value,
const std::pair<float, float> & range,
const std::string & sFilename,
const float W, const float H)
{
if (vec_value.empty()) {
return false;
}
//-- Max value
const T maxi = *max_element(vec_value.cbegin(), vec_value.cend());
const size_t n = vec_value.size();
const float scaleFactorY = H / static_cast<float>(maxi);
const float scaleFactorX = W / static_cast<float>(n);
svgDrawer svg_stream;
for (size_t i = 0; i < vec_value.size(); ++i)
{
const size_t dist = i;
const T val = vec_value[i];
std::ostringstream os;
os << '(' << range.first + dist/float(n) * (range.second-range.first) << ',' << val << ')';
const svgAttributes style = svgAttributes().fill("blue").stroke("black", 1.0).tooltip(os.str());
svg_stream << drawRectangle(
scaleFactorX * dist, H-val * scaleFactorY,
scaleFactorX, val * scaleFactorY,
style);
//_________
//| |_________
//| || |
//| || |
//| || |
//0 sFactorX 2*sFactorX
}
const svgAttributes axis_style = svgAttributes().stroke("black", 1.0f);
// Draw X Axis
svg_stream << drawText(.05f*W, 1.2f*H, .1f*H, stringifier(range.first), "black");
svg_stream << drawText( W, 1.2f*H, .1f*H, stringifier(range.second), "black");
svg_stream << drawLine(0, 1.1f*H, W, 1.1f*H, axis_style);
// Draw Y Axis
svg_stream << drawText(1.2f*W, .1f*H, .1f*H, stringifier(maxi), "black");
svg_stream << drawText(1.2f*W, H, .1f*H, "0", "black");
svg_stream << drawLine(1.1f*W, 0, 1.1f*W, H, axis_style);
std::ofstream svg_file_stream( sFilename.c_str());
if (svg_file_stream)
{
svg_file_stream << svg_stream.closeSvgFile().str();
return true;
}
return false;
}
} // namespace svg
#endif // SVG_HISTOGRAM_HPP
| 2,591
|
C++
|
.h
| 76
| 31.052632
| 100
| 0.62
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,337
|
svgAttributes.hpp
|
openMVG_openMVG/src/openMVG/vector_graphics/svgAttributes.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2019 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef SVG_ATTRIBUTES_HPP
#define SVG_ATTRIBUTES_HPP
#include <sstream>
#include <string>
namespace svg {
//
// Helper class to handle some draw SVG attributes.
// see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
//
/// Class to handle SVG some draw attributes
/// Note: Attributes define how elements should be rendered.
class svgAttributes
{
std::string fill_color_ = "";
std::string stroke_color_ = "black";
std::string tooltip_ = "";
float stroke_width_ = 1.0f;
float opacity_ = 1.0f; // Must be in the range [0; 1]
public:
svgAttributes() = default;
// Configure fill color
svgAttributes & fill(const std::string & sFillCol)
{ fill_color_ = sFillCol; return * this;}
// Configure stroke color and width
svgAttributes & stroke(const std::string & sStrokeCol, const float strokeWitdh = 1.f)
{ stroke_color_ = sStrokeCol; stroke_width_ = strokeWitdh; return * this;}
// Configure with no stroke
svgAttributes & noStroke()
{ stroke_color_ = ""; stroke_width_ = 0.f; return * this;}
// Configure tooltip
svgAttributes & tooltip(const std::string & sTooltip)
{ tooltip_ = sTooltip; return * this;}
svgAttributes & opacity(const float & opacity)
{ opacity_ = opacity; return *this; }
const std::string getSvgStream() const {
std::ostringstream os;
if (!stroke_color_.empty())
os << " stroke=\"" << stroke_color_ << "\" stroke-width=\"" << stroke_width_ << "\"";
if (fill_color_.empty())
os << " fill=\"none\"";
else
os << " fill=\"" << fill_color_ << "\"";
if (opacity_ > 0)
os << " opacity=\"" << opacity_ << "\"";
if (!tooltip_.empty())
os << " tooltip=\"enable\">"
<< "<title>" << tooltip_ << "</title>";
return os.str();
}
bool bTooltip() const { return !tooltip_.empty();}
};
} // namespace svg
#endif // SVG_ATTRIBUTES_HPP
| 2,189
|
C++
|
.h
| 58
| 34.517241
| 91
| 0.659091
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,350
|
solver_resection_p3p_ding.hpp
|
openMVG_openMVG/src/openMVG/multiview/solver_resection_p3p_ding.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2024 Yaqing Ding
// Adapted to openMVG by Pierre Moulon
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MULTIVIEW_RESECTION_P3P_DING_HPP
#define OPENMVG_MULTIVIEW_RESECTION_P3P_DING_HPP
#include "openMVG/multiview/two_view_kernel.hpp"
#include "openMVG/multiview/solver_resection_metrics.hpp"
#include "openMVG/multiview/solver_resection_p3p_nordberg.hpp"
namespace openMVG {
namespace euclidean_resection {
struct P3PSolver_Ding {
enum { MINIMUM_SAMPLES = 3 };
enum { MAX_MODELS = 4 };
// Solve the absolute camera pose problem.
// Use "Revisiting the P3P Problem." CVPR23
// Y Ding, J Yang, V Larsson, C Olsson, K Åström.
static void Solve(const Mat &bearing_vectors,
const Mat &X, // 3D points
std::vector<Mat34> *models);
};
//-- Usable solver for robust estimation framework
using PoseResectionKernel_P3P_Ding =
two_view::kernel::Kernel<P3PSolver_Ding, // Model estimator
resection::AngularReprojectionError, // Error
// metric
Mat34>;
} // namespace euclidean_resection
} // namespace openMVG
#endif // OPENMVG_MULTIVIEW_RESECTION_P3P_DING_HPP
| 1,506
|
C++
|
.h
| 32
| 40.0625
| 76
| 0.678059
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| true
| false
|
27,351
|
solver_essential_three_point.hpp
|
openMVG_openMVG/src/openMVG/multiview/solver_essential_three_point.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2017, Romain JANVIER & Pierre MOULON
// Copyright (c) 2020 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MULTIVIEW_SOLVER_ESSENTIAL_THREE_POINT_HPP
#define OPENMVG_MULTIVIEW_SOLVER_ESSENTIAL_THREE_POINT_HPP
#include "openMVG/numeric/eigen_alias_definition.hpp"
namespace openMVG {
/**
* @brief Computes the relative pose of two orthographic cameras from 3 correspondences.
*
* \param x1 Points in the first image. One per column.
* \param x2 Corresponding points in the second image. One per column.
* \param E A list of at most 2 candidates orthographic essential matrix solutions.
*/
void ThreePointsRelativePose
(
const Mat2X &x1,
const Mat2X &x2,
std::vector<Mat3> *E
);
namespace essential {
namespace kernel {
/**
* Three-point algorithm for solving for the essential matrix from bearing
* vector correspondences assuming upright images.
* Implementation of [1] section 3.3. Linear 3-point Algorithm
* Note: this is an approximate solver, not a minimal solver
*
* [1] "Fast and Reliable Minimal Relative Pose Estimation under Planar Motion"
* Sunglok Choi, Jong-Hwan Kim, 2018
*
* [2] Street View Goes Indoors: Automatic Pose Estimation From Uncalibrated Unordered Spherical Panoramas.
* Mohamed Aly and Jean-Yves Bouguet.
* IEEE Workshop on Applications of Computer Vision (WACV), Colorado, January 2012.
*
* Comment [2] and [1] propose both a Direct Linear Method using 3 correspondences.
* Note that they are using gravity axis and that [1] provides more details about the fact that
* the linear formulation is not a minimal solver since it cannot enforce the
* "Pythagorean" identity on sin^2(t) + cos^2(t) = 1
*
*/
struct ThreePointUprightRelativePoseSolver {
enum { MINIMUM_SAMPLES = 3 };
enum { MAX_MODELS = 1 };
static void Solve
(
const Mat3X & bearing_a,
const Mat3X & bearing_b,
std::vector<Mat3> * pvec_E
);
};
} // namespace kernel
} // namespace essential
} // namespace openMVG
#endif //OPENMVG_MULTIVIEW_SOLVER_ESSENTIAL_THREE_POINT_HPP
| 2,303
|
C++
|
.h
| 58
| 37.637931
| 107
| 0.757942
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,352
|
triangulation_method.hpp
|
openMVG_openMVG/src/openMVG/multiview/triangulation_method.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2019 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MULTIVIEW_TRIANGULATION_TYPE_HPP
#define OPENMVG_MULTIVIEW_TRIANGULATION_TYPE_HPP
namespace openMVG
{
/// Define various enumerate for each available two view triangulation solver
enum class ETriangulationMethod : unsigned char
{
DIRECT_LINEAR_TRANSFORM, // DLT
L1_ANGULAR,
LINFINITY_ANGULAR,
INVERSE_DEPTH_WEIGHTED_MIDPOINT,
DEFAULT = INVERSE_DEPTH_WEIGHTED_MIDPOINT
};
static inline bool isValid( const ETriangulationMethod method )
{
return
method >= ETriangulationMethod::DIRECT_LINEAR_TRANSFORM &&
method <= ETriangulationMethod::DEFAULT;
}
} // namespace openMVG
#endif //OPENMVG_MULTIVIEW_TRIANGULATION_TYPE_HPP
| 979
|
C++
|
.h
| 26
| 35.615385
| 77
| 0.784355
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,363
|
solver_resection_kernel.hpp
|
openMVG_openMVG/src/openMVG/multiview/solver_resection_kernel.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2012, 2013, 2017 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MULTIVIEW_RESECTION_KERNEL_HPP
#define OPENMVG_MULTIVIEW_RESECTION_KERNEL_HPP
#include "openMVG/multiview/two_view_kernel.hpp"
#include "openMVG/multiview/solver_resection_metrics.hpp"
namespace openMVG {
namespace resection {
namespace kernel {
/**
* Six-point resection
* P Matrix estimation (Pose estimation)
* Compute a projection matrix using linear least squares.
* Rely on Linear Resection algorithm.
* Work from 6 to N points.
*/
struct SixPointResectionSolver {
enum { MINIMUM_SAMPLES = 6 };
enum { MAX_MODELS = 1 };
// Solve the problem of camera pose.
// First 3d point will be translated in order to have X0 = (0,0,0,1)
static void Solve
(
const Mat &pt2D,
const Mat &pt3D,
std::vector<Mat34> *P,
bool bcheck = true
);
};
//-- Usable solver for the 6pt Resection estimation
using PoseResectionKernel =
two_view::kernel::Kernel<
SixPointResectionSolver, // Model estimator
resection::PixelReprojectionError, // Error metric
Mat34>;
} // namespace kernel
} // namespace resection
} // namespace openMVG
#endif // OPENMVG_MULTIVIEW_RESECTION_KERNEL_HPP
| 1,470
|
C++
|
.h
| 42
| 32.571429
| 76
| 0.7433
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,367
|
solver_resection_p3p_kneip.hpp
|
openMVG_openMVG/src/openMVG/multiview/solver_resection_p3p_kneip.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2012, 2013 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MULTIVIEW_RESECTION_P3P_KNEIP_HPP
#define OPENMVG_MULTIVIEW_RESECTION_P3P_KNEIP_HPP
#include "openMVG/multiview/two_view_kernel.hpp"
#include "openMVG/multiview/solver_resection_metrics.hpp"
namespace openMVG {
namespace euclidean_resection {
struct P3PSolver_Kneip {
enum { MINIMUM_SAMPLES = 3 };
enum { MAX_MODELS = 4};
// Solve the absolute camera pose problem.
// Use "A Novel Parametrization of the P3P-Problem for a Direct Computation of
// Absolute Camera Position and Orientation".
// Kneip, L.; Scaramuzza, D.; Siegwart, R., CVPR 2011.
static void Solve
(
const Mat & bearing_vectors,
const Mat & X, // 3D points
std::vector<Mat34> *models
);
};
//-- Usable solver for robust estimation framework
using PoseResectionKernel_P3P_Kneip =
two_view::kernel::Kernel<
P3PSolver_Kneip, // Model estimator
resection::AngularReprojectionError, // Error metric
Mat34>;
} // namespace euclidean_resection
} // namespace openMVG
#endif // OPENMVG_MULTIVIEW_RESECTION_P3P_KNEIP_HPP
| 1,373
|
C++
|
.h
| 34
| 37.764706
| 80
| 0.745482
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,373
|
solver_resection_p3p_nordberg.hpp
|
openMVG_openMVG/src/openMVG/multiview/solver_resection_p3p_nordberg.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2018 Michael Persson
// Adapted to openMVG by Romain Janvier and Pierre Moulon
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MULTIVIEW_RESECTION_P3P_NORDBERG_HPP
#define OPENMVG_MULTIVIEW_RESECTION_P3P_NORDBERG_HPP
#include "openMVG/multiview/two_view_kernel.hpp"
#include "openMVG/multiview/solver_resection_metrics.hpp"
namespace openMVG {
namespace euclidean_resection {
struct P3PSolver_Nordberg {
enum { MINIMUM_SAMPLES = 3 };
enum { MAX_MODELS = 4 };
static inline bool root2real(const double b, const double c, double &r1,
double &r2) {
const double v = b * b - 4.0 * c;
if (v <= 0.0) {
r1 = r2 = -0.5 * b;
return v >= 0.0;
}
const double y = std::sqrt(v);
if (b < 0.0) {
r1 = 0.5 * (-b + y);
r2 = 0.5 * (-b - y);
} else {
r1 = 2.0 * c / (-b + y);
r2 = 2.0 * c / (-b - y);
}
return true;
};
// Solve the absolute camera pose problem.
// Use "Lambda Twist: An Accurate Fast Robust
// Perspective Three Point (P3P) Solver
// Persson, M.; Nordberg, K.
static void Solve(const Mat &bearing_vectors,
const Mat &X, // 3D points
std::vector<Mat34> *models);
};
//-- Usable solver for robust estimation framework
using PoseResectionKernel_P3P_Nordberg =
two_view::kernel::Kernel<P3PSolver_Nordberg, // Model estimator
resection::AngularReprojectionError, // Error metric
Mat34>;
} // namespace euclidean_resection
} // namespace openMVG
#endif // OPENMVG_MULTIVIEW_RESECTION_P3P_NORDBERG_HPP
| 1,886
|
C++
|
.h
| 48
| 33.520833
| 81
| 0.639497
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,374
|
triangulation.hpp
|
openMVG_openMVG/src/openMVG/multiview/triangulation.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2016 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MULTIVIEW_TRIANGULATION_HPP
#define OPENMVG_MULTIVIEW_TRIANGULATION_HPP
#include "openMVG/numeric/eigen_alias_definition.hpp"
#include "openMVG/multiview/triangulation_method.hpp"
namespace openMVG
{
/**
* @brief Generic triangulation routine (Aggregate all the 2view triangulation solvers in one place).
* @param R0 First Camera rotation matrix
* @param t0 First Camera translation vector
* @param x0 bearing vector of the landmark observation in the first camera
* @param R1 Second Camera rotation matrix
* @param t1 Second Camera translation vector
* @param x1 bearing vector of the landmark observation in the second camera
* @param[out] X_euclidean Euclidean triangulated point
* @return true if the point pass the adequacy or cheirality test (depending of the solver), false otherwise
* (invalid 3d point or method that does not exist)
**/
bool Triangulate2View
(
const Mat3 &R0,
const Vec3 &t0,
const Vec3 &bearing0,
const Mat3 &R1,
const Vec3 &t1,
const Vec3 &bearing1,
Vec3 &X,
ETriangulationMethod etri_method = ETriangulationMethod::DEFAULT
);
/**
* @brief Linear DLT triangulation
* @param P1 First camera projection matrix
* @param P2 Second camera projection matrix
* @param x1 bearing vector of the landmark observation in the first camera
* @param x2 bearing vector of the landmark observation in the second camera
* @param[out] X_homogeneous Homogeneous triangulated point
* @see HZ 12.2 pag.312
* @ref Multiple View Geometry - Richard Hartley, Andrew Zisserman - second edition
*/
void TriangulateDLT
(
const Mat34 &P1,
const Vec3 &x1,
const Mat34 &P2,
const Vec3 &x2,
Vec4 *X_homogeneous
);
/**
* @brief Linear DLT triangulation
* @param P1 First camera projection matrix
* @param P2 Second camera projection matrix
* @param x1 bearing vector of the landmark observation in the first camera
* @param x2 bearing vector of the landmark observation in the second camera
* @param[out] X_euclidean Euclidean triangulated point
* @see HZ 12.2 pag.312
* @ref Multiple View Geometry - Richard Hartley, Andrew Zisserman - second edition
*/
void TriangulateDLT
(
const Mat34 &P1,
const Vec3 &x1,
const Mat34 &P2,
const Vec3 &x2,
Vec3 *X_euclidean
);
/**
* @brief Linear DLT triangulation
* @param R0 First Camera rotation matrix
* @param t0 First Camera translation vector
* @param x0 bearing vector of the landmark observation in the first camera
* @param R1 Second Camera rotation matrix
* @param t1 Second Camera translation vector
* @param x1 bearing vector of the landmark observation in the second camera
* @param[out] X_euclidean Euclidean triangulated point
* @return true if the point pass the cheirality test, false otherwise
* @see HZ 12.2 pag.312
* @ref Multiple View Geometry - Richard Hartley, Andrew Zisserman - second edition
*/
bool TriangulateDLT
(
const Mat3 &R0,
const Vec3 &t0,
const Vec3 &x0,
const Mat3 &R1,
const Vec3 &t1,
const Vec3 &x1,
Vec3 *X_euclidean
);
/**
* @brief Optimal L1 Angular triangulation
* @brief Minimize the L1 norm of angular errors
* @param R0 First Camera rotation matrix
* @param t0 First Camera translation vector
* @param x0 bearing vector of the landmark observation in the first camera
* @param R1 Second Camera rotation matrix
* @param t1 Second Camera translation vector
* @param x1 bearing vector of the landmark observation in the second camera
* @param[out] X_euclidean Euclidean triangulated point
* @return true if the point pass the cheirality test, false otherwise
* @ref S.H. Lee, J. Civera - Closed-Form Optimal Triangulation Based on Angular Errors - ICCV 2019 - https://arxiv.org/pdf/1903.09115.pdf
*/
bool TriangulateL1Angular
(
const Mat3 &R0,
const Vec3 &t0,
const Vec3 &x0,
const Mat3 &R1,
const Vec3 &t1,
const Vec3 &x1,
Vec3 *X_euclidean
);
/**
* @brief Optimal LInfinity Angular triangulation
* @brief Minimize the LInfinity norm of angular errors
* @param R0 First Camera rotation matrix
* @param t0 First Camera translation vector
* @param x0 bearing vector of the landmark observation in the first camera
* @param R1 Second Camera rotation matrix
* @param t1 Second Camera translation vector
* @param x1 bearing vector of the landmark observation in the second camera
* @param[out] X_euclidean Euclidean triangulated point
* @return true if the point pass the cheirality test, false otherwise
* @ref S.H. Lee, J. Civera - Closed-Form Optimal Triangulation Based on Angular Errors - ICCV 2019 - https://arxiv.org/pdf/1903.09115.pdf
*/
bool TriangulateLInfinityAngular
(
const Mat3 &R0,
const Vec3 &t0,
const Vec3 &x0,
const Mat3 &R1,
const Vec3 &t1,
const Vec3 &x1,
Vec3 *X_euclidean
);
/**
* @brief Inverse Depth Weighted Midpoint method
* @brief and its ad hoc adequacy test (a replacement for cheirality tests)
* @brief should be better than DLT for low and high parallax angles
* @param R0 First Camera rotation matrix
* @param t0 First Camera translation vector
* @param x0 bearing vector of the landmark observation in the first camera
* @param R1 Second Camera rotation matrix
* @param t1 Second Camera translation vector
* @param x1 bearing vector of the landmark observation in the second camera
* @param[out] X_euclidean Euclidean triangulated point
* @return true if the point pass the adequacy test, false otherwise
* @ref S.H. Lee, J. Civera - Triangulation: Why Optimize? - BMVC 2019 - https://arxiv.org/pdf/1907.11917.pdf
*/
bool TriangulateIDWMidpoint(
const Mat3 & R0,
const Vec3 & t0,
const Vec3 & x0,
const Mat3 & R1,
const Vec3 & t1,
const Vec3 & x1,
Vec3 *X_euclidean
);
} // namespace openMVG
#endif // OPENMVG_MULTIVIEW_TRIANGULATION_HPP
| 5,984
|
C++
|
.h
| 164
| 34.835366
| 137
| 0.775194
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,378
|
solver_resection_metrics.hpp
|
openMVG_openMVG/src/openMVG/multiview/solver_resection_metrics.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2020 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MULTIVIEW_RESECTION_METRICS_HPP
#define OPENMVG_MULTIVIEW_RESECTION_METRICS_HPP
namespace openMVG {
namespace resection {
struct PixelReprojectionError {
// Compute the residual of the projection distance(x, P(X))
static inline double Error
(
const Mat34 & P,
const Vec2 & x,
const Vec3 & X
)
{
return (x - (P * X.homogeneous()).hnormalized()).norm();
}
};
struct SquaredPixelReprojectionError {
// Compute the Square residual of the projection distance(x, P(X))
static inline double Error
(
const Mat34 & P,
const Vec2 & x,
const Vec3 & X
)
{
return (x - (P * X.homogeneous()).hnormalized()).squaredNorm();
}
};
struct AngularReprojectionError {
// Compute the angular residual of the projection and the bearing vector
static inline double Error
(
const Mat34 & P,
const Vec3 & bearing_vector,
const Vec3 & X
)
{
const auto new_bearing = (P * X.homogeneous()).normalized();
return 1.0 - (bearing_vector.dot(new_bearing));
}
};
} // namespace resection
} // namespace openMVG
#endif // OPENMVG_MULTIVIEW_RESECTION_METRICS_HPP
| 1,458
|
C++
|
.h
| 49
| 26.77551
| 76
| 0.707857
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,380
|
solver_resection_up2p_kukelova.hpp
|
openMVG_openMVG/src/openMVG/multiview/solver_resection_up2p_kukelova.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2020 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MULTIVIEW_RESECTION_UP2P_HPP
#define OPENMVG_MULTIVIEW_RESECTION_UP2P_HPP
#include "openMVG/multiview/two_view_kernel.hpp"
#include "openMVG/multiview/solver_resection_metrics.hpp"
namespace openMVG {
namespace euclidean_resection {
struct UP2PSolver_Kukelova {
enum { MINIMUM_SAMPLES = 2 };
enum { MAX_MODELS = 2 };
// Solve the absolute camera pose problem for the p2p setting (upright camera).
// [1] Closed-form solutions to the minimal absolute pose problems with known vertical direction
// Zuzana Kukelova, Martin Bujnak, Tomas Pajdla
// ACCV 2010
static void Solve
(
const Mat & bearing_vectors,
const Mat & X, // 3D points
std::vector<Mat34> *models
);
};
//-- Usable solver for robust estimation framework
using PoseResectionKernel_UP2P_Kukelova =
two_view::kernel::Kernel<
UP2PSolver_Kukelova, // Model estimator
resection::AngularReprojectionError, // Error metric
Mat34>;
} // namespace euclidean_resection
} // namespace openMVG
#endif // OPENMVG_MULTIVIEW_RESECTION_UP2P_HPP
| 1,378
|
C++
|
.h
| 34
| 37.941176
| 98
| 0.754123
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,381
|
solver_resection.hpp
|
openMVG_openMVG/src/openMVG/multiview/solver_resection.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2017 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef OPENMVG_MULTIVIEW_RESECTION_HPP
#define OPENMVG_MULTIVIEW_RESECTION_HPP
namespace openMVG {
namespace resection {
enum class SolverType
{
DLT_6POINTS = 0,
P3P_KE_CVPR17 = 1,
P3P_KNEIP_CVPR11 = 2,
P3P_NORDBERG_ECCV18 = 3,
P3P_DING_CVPR23 = 4,
UP2P_KUKELOVA_ACCV10 = 5,
DEFAULT = P3P_DING_CVPR23
};
} // namespace resection
} // namespace openMVG
#endif // OPENMVG_MULTIVIEW_RESECTION_HPP
| 735
|
C++
|
.h
| 22
| 31.454545
| 76
| 0.743626
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| true
| false
|
27,382
|
LiGT_algorithm.hpp
|
openMVG_openMVG/src/openMVG/multiview/LiGT/LiGT_algorithm.hpp
|
// This file is part of a pose-only algorithm of Linear Global Translation (LiGT)
// Copyright (c) 2022, Qi Cai and Yuanxin Wu
// This Source Code Form is subject to the license terms of
// Creative Commons Attribution Share Alike 4.0 International.
// Details are available at https://choosealicense.com/licenses/cc-by-sa-4.0/
#ifndef LIGT_ALGORITHM
#define LIGT_ALGORITHM
#pragma once
#include "LiGT_types.hpp"
#include <string>
namespace LiGT {
// ============== The LiGT Algorithm (Version 1.1) =============
// [Version History]
// v1.0: first release; parallelism by Pierre Moulon.
// v1.1: Spectra replaces Eigen; Block manipulation to implement LTL matrix.
//
// Coded by: Drs. Qi Cai and Xinrui Li
// Refined by: Pierre Moulon
// Email: sipangyiyou@sjtu.edu.cn, yuanxin.wu@sjtu.edu.cn
//
// [Conditions of Use]: the LiGT algorithm is distributed under
// the License of Attribution-ShareAlike 4.0 International
// (https://creativecommons.org/licenses/by-sa/4.0/).
//
//------------------
//-- Bibliography --
//------------------
// If you use it for a publication, please cite the following paper:
//- [1] "A Pose-only Solution to Visual Reconstruction and Navigation".
//- Authors: Qi Cai, Lilian Zhang, Yuanxin Wu, Wenxian Yu and Dewen Hu.
//- Date: December 2021.
//- Journal: IEEE T-PAMI.
//
//- [2] "Equivalent constraints for two-view geometry: pose solution/pure rotation identification and 3D reconstruction".
//- Authors: Qi Cai; Yuanxin Wu; Lilian Zhang; Peike Zhang.
//- Date: December 2019.
//- Journal: IJCV.
//
// This is a dedicated version of the LiGT algorithm for openMVG, which is supported by
// the Inertial and Visual Fusion (VINF) research group in Shanghai Jiao Tong University
// @ https://www.researchgate.net/lab/Inertial-visual-Fusion-VINF-Yuanxin-Wu
//
// Note:
// 1. The LiGT algorithm is subject to the University proprietary right with patent protection.
// The current version of the LiGT algorithm is generally consistent with
// the above-mentioned T-PAMI paper in terms of accuracy.
//
// 2. It does not consider the rank condition in Proposition 6 of the T-PAMI paper.
//
#include <Eigen/Core>
class LiGTProblem {
public:
LiGTProblem();
virtual ~LiGTProblem() = default;
// [Step.2 in Pose-only Algorithm]: select the left/right-base views
void SelectBaseViews(const Track& track,
ViewId& lbase_view_id,
ViewId& rbase_view_id,
ObsId& id_lbase,
ObsId& id_rbase);
// [Step.3 in Pose-only algorithm]: calculate local L matrix, update LTL and A_lr matrix
void BuildLTL(Eigen::MatrixXd& LTL,
Eigen::MatrixXd& A_lr);
//[Step.4 in Pose-only Algorithm]: obtain the translation solution by using SVD
bool SolveLiGT(const Eigen::MatrixXd& LTL,
Eigen::VectorXd &evectors);
// [Step.5 in Pose-only Algorithm]: identify the correct sign of the translation solution after using SVD
void IdentifySign(const Eigen::MatrixXd& A_lr,
Eigen::VectorXd& evectors);
// LiGT solution
bool Solution();
// get tracks pointer (help to set track inputs)
Tracks GetTracks();
// get rotations (help to set rotation inputs)
Rotations GetRotations();
// get poses
Poses GetPoses();
// check information in tracks (such as num_view/num_pts/num_obs)
// and build estimated information EstInfo
void CheckTracks();
// recover the view id into original view ids
void RecoverViewIds();
// print copyright claim
void PrintCopyright() const;
protected:
unsigned int num_view_;
unsigned int num_pts_;
unsigned int num_obs_;
// set the minimal number of image observations in a track
// recommend value: 2~3 (default -> 2)
unsigned int min_track_length_;
double time_use_;
// tracks
LiGT::Tracks tracks_;
// estimated view information
LiGT::EstInfo est_info_;
// [Note]: global rotations are sorted by estimated view ids
LiGT::Rotations global_rotations_;
// [Note]: global translations are sorted by estimated view ids
LiGT::Translations global_translations_;
// [Note]: global poses are sorted by original view ids
LiGT::Poses poses_;
// reference view id
ViewId fixed_id_;
};
}
#endif
| 4,195
|
C++
|
.h
| 107
| 36.327103
| 121
| 0.721182
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,383
|
LiGT_algorithm_converter.hpp
|
openMVG_openMVG/src/openMVG/multiview/LiGT/LiGT_algorithm_converter.hpp
|
// This file is part of a pose-only algorithm of Linear Global Translation (LiGT)
// Copyright (c) 2022, Qi Cai and Yuanxin Wu
// This Source Code Form is subject to the license terms of
// Creative Commons Attribution Share Alike 4.0 International.
// Details are available at https://choosealicense.com/licenses/cc-by-sa-4.0/
#ifndef LIGT_ALGORITHM_CONVERTER
#define LIGT_ALGORITHM_CONVERTER
#pragma once
#include "LiGT_algorithm.hpp"
#include "openMVG/sfm/pipelines/sfm_features_provider.hpp"
#include "openMVG/sfm/pipelines/sfm_matches_provider.hpp"
#include "openMVG/tracks/tracks.hpp"
using namespace openMVG;
namespace LiGT {
//------------------
//-- Bibliography --
//------------------
//- [1] "A Pose-only Solution to Visual Reconstruction and Navigation".
//- Authors: Qi Cai, Lilian Zhang, Yuanxin Wu, Wenxian Yu and Dewen Hu.
//- Date: December 2022.
//- Journal: IEEE T-PAMI.
//
//- [2] "Equivalent constraints for two-view geometry: pose solution/pure rotation identification and 3D reconstruction".
//- Authors: Qi Cai; Yuanxin Wu; Lilian Zhang; Peike Zhang.
//- Date: December 2019.
//- Journal: IJCV.
class LiGTBuilder : public LiGTProblem{
// Readme. For this version, we provide following converter functions
// to transform the data type in openMVG into LiGT.
// In the future, we might directly use openMVG's data type in the LiGT algorithm.
public:
LiGTBuilder(const sfm::Features_Provider* features_provider,
const matching::PairWiseMatches& pairWise_matches,
const sfm::SfM_Data& sfm_data,
const Hash_Map<IndexT, Mat3>& map_globalR,
const int min_track_length = 2,
const int fixed_id = 0);
virtual ~LiGTBuilder() = default;
// transform openMVG's tracks info into the LiGT's form
void BuildTracks(const sfm::Features_Provider* features_provider,
const matching::PairWiseMatches& pairWise_matches,
const sfm::SfM_Data& sfm_data);
// Initialize Global rotations
void MapR2Rotations(const Hash_Map<IndexT, Mat3>& map_globalR);
};
}
#endif
| 2,058
|
C++
|
.h
| 47
| 40.744681
| 121
| 0.733333
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,384
|
LiGT_types.hpp
|
openMVG_openMVG/src/openMVG/multiview/LiGT/LiGT_types.hpp
|
// This file is part of a pose-only algorithm of Linear Global Translation (LiGT)
// Copyright (c) 2022, Qi Cai and Yuanxin Wu
// This Source Code Form is subject to the license terms of
// Creative Commons Attribution Share Alike 4.0 International.
// Details are available at https://choosealicense.com/licenses/cc-by-sa-4.0/
#ifndef LIGT_TYPES
#define LIGT_TYPES
#include "openMVG/geometry/pose3.hpp"
#include "openMVG/numeric/eigen_alias_definition.hpp"
#include "openMVG/types.hpp"
#include <set>
#include <unordered_map>
#include <vector>
using namespace openMVG;
namespace LiGT{
using ViewId = IndexT;
using PtsId = IndexT;
using ObsId = IndexT;
// pose storage
using Rotations = std::vector<Mat3>;
using Translations = std::vector<Vec3>;
using Poses = std::unordered_map<ViewId, openMVG::geometry::Pose3>;
// image observation information
struct ObsInfo {
ViewId view_id;
PtsId pts_id;
Eigen::Vector3d coord;
};
// track information
using Track = std::vector<ObsInfo>;
struct TrackInfo {
Track track;
bool is_used = true;
};
using Tracks = std::vector<TrackInfo>;
// estimated information
using EstimatedViewIds = std::vector<ViewId>;
using OriginViewIds = std::vector<ViewId>;
using Origin2EstViewIds = std::unordered_map<ViewId, ViewId>;
using Est2OriginViewIds = std::unordered_map<ViewId, ViewId>;
struct EstInfo {
EstimatedViewIds estimated_view_ids;
OriginViewIds origin_view_ids;
Origin2EstViewIds origin2est_view_ids;
Est2OriginViewIds est2origin_view_ids;
void BuildMap(){
origin2est_view_ids.clear();
est2origin_view_ids.clear();
if (estimated_view_ids.size() > 0
&& origin_view_ids.size() > 0
&& estimated_view_ids.size() == origin_view_ids.size())
{
for ( ViewId i = 0; i < estimated_view_ids.size(); ++i){
origin2est_view_ids.insert({origin_view_ids[i],estimated_view_ids[i]});
est2origin_view_ids.insert({estimated_view_ids[i],origin_view_ids[i]});
}
}
}
};
}
#endif
| 1,996
|
C++
|
.h
| 61
| 29.967213
| 81
| 0.739812
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,422
|
Version.h
|
openMVG_openMVG/src/third_party/spectra/include/Spectra/Util/Version.h
|
// Copyright (C) 2020-2022 Yixuan Qiu <yixuan.qiu@cos.name>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
#ifndef SPECTRA_VERSION_H
#define SPECTRA_VERSION_H
#define SPECTRA_MAJOR_VERSION 1
#define SPECTRA_MINOR_VERSION 0
#define SPECTRA_PATCH_VERSION 1
#define SPECTRA_VERSION (SPECTRA_MAJOR_VERSION * 10000 + SPECTRA_MINOR_VERSION * 100 + SPECTRA_PATCH_VERSION)
#endif // SPECTRA_VERSION_H
| 556
|
C++
|
.h
| 12
| 45
| 109
| 0.766667
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,431
|
SearchSpace.h
|
openMVG_openMVG/src/third_party/spectra/include/Spectra/LinAlg/SearchSpace.h
|
// Copyright (C) 2020 Netherlands eScience Center <n.renauld@esciencecenter.nl>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
#ifndef SPECTRA_SEARCH_SPACE_H
#define SPECTRA_SEARCH_SPACE_H
#include <Eigen/Core>
#include "RitzPairs.h"
#include "Orthogonalization.h"
namespace Spectra {
/// This class handles the creation and manipulation of the search space
/// for iterative eigensolvers such as Davidson, Jacobi-Davidson, etc.
template <typename Scalar>
class SearchSpace
{
private:
using Index = Eigen::Index;
using Matrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>;
Matrix m_basis_vectors;
Matrix m_op_basis_product;
/// Append new vector to the basis
///
/// \param new_vect Matrix of new correction vectors
void append_new_vectors_to_basis(const Matrix& new_vect)
{
Index num_update = new_vect.cols();
m_basis_vectors.conservativeResize(Eigen::NoChange, m_basis_vectors.cols() + num_update);
m_basis_vectors.rightCols(num_update).noalias() = new_vect;
}
public:
SearchSpace() = default;
/// Returns the current size of the search space
Index size() const { return m_basis_vectors.cols(); }
void initialize_search_space(const Eigen::Ref<const Matrix>& initial_vectors)
{
m_basis_vectors = initial_vectors;
m_op_basis_product = Matrix(initial_vectors.rows(), 0);
}
/// Updates the matrix formed by the operator applied to the search space
/// after the addition of new vectors in the search space. Only the product
/// of the operator with the new vectors is computed and the result is appended
/// to the op_basis_product member variable
///
/// \param OpType Operator representing the matrix
template <typename OpType>
void update_operator_basis_product(OpType& op)
{
Index nvec = m_basis_vectors.cols() - m_op_basis_product.cols();
m_op_basis_product.conservativeResize(Eigen::NoChange, m_basis_vectors.cols());
m_op_basis_product.rightCols(nvec).noalias() = op * m_basis_vectors.rightCols(nvec);
}
/// Restart the search space by reducing the basis vector to the last
/// Ritz eigenvector
///
/// \param ritz_pair Instance of a RitzPair class
/// \param size Size of the restart
void restart(const RitzPairs<Scalar>& ritz_pairs, Index size)
{
m_basis_vectors = ritz_pairs.ritz_vectors().leftCols(size);
m_op_basis_product = m_op_basis_product * ritz_pairs.small_ritz_vectors().leftCols(size);
}
/// Append new vectors to the search space and
/// orthogonalize the resulting matrix
///
/// \param new_vect Matrix of new correction vectors
void extend_basis(const Matrix& new_vect)
{
Index left_cols_to_skip = size();
append_new_vectors_to_basis(new_vect);
twice_is_enough_orthogonalisation(m_basis_vectors, left_cols_to_skip);
}
/// Returns the basis vectors
const Matrix& basis_vectors() const { return m_basis_vectors; }
/// Returns the operator applied to basis vector
const Matrix& operator_basis_product() const { return m_op_basis_product; }
};
} // namespace Spectra
#endif // SPECTRA_SEARCH_SPACE_H
| 3,388
|
C++
|
.h
| 79
| 38.075949
| 97
| 0.701094
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| true
| false
| false
| false
| false
| false
| false
|
27,434
|
RitzPairs.h
|
openMVG_openMVG/src/third_party/spectra/include/Spectra/LinAlg/RitzPairs.h
|
// Copyright (C) 2020 Netherlands eScience Center <n.renauld@esciencecenter.nl>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
#ifndef SPECTRA_RITZ_PAIRS_H
#define SPECTRA_RITZ_PAIRS_H
#include <Eigen/Core>
#include <Eigen/Eigenvalues>
#include "../Util/SelectionRule.h"
namespace Spectra {
template <typename Scalar>
class SearchSpace;
/// This class handles the creation and manipulation of Ritz eigen pairs
/// for iterative eigensolvers such as Davidson, Jacobi-Davidson, etc.
template <typename Scalar>
class RitzPairs
{
private:
using Index = Eigen::Index;
using Matrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>;
using Vector = Eigen::Matrix<Scalar, Eigen::Dynamic, 1>;
using Array = Eigen::Array<Scalar, Eigen::Dynamic, 1>;
using BoolArray = Eigen::Array<bool, Eigen::Dynamic, 1>;
Vector m_values; // eigenvalues
Matrix m_small_vectors; // eigenvectors of the small problem, makes restart cheaper.
Matrix m_vectors; // Ritz (or harmonic Ritz) eigenvectors
Matrix m_residues; // residues of the pairs
BoolArray m_root_converged;
public:
RitzPairs() = default;
/// Compute the eigen values/vectors
///
/// \param search_space Instance of the class handling the search space
/// \return Eigen::ComputationalInfo Whether small eigenvalue problem worked
Eigen::ComputationInfo compute_eigen_pairs(const SearchSpace<Scalar>& search_space);
/// Returns the size of the ritz eigen pairs
///
/// \return Eigen::Index Number of pairs
Index size() const { return m_values.size(); }
/// Sort the eigen pairs according to the selection rule
///
/// \param selection Sorting rule
void sort(SortRule selection)
{
std::vector<Index> ind = argsort(selection, m_values);
RitzPairs<Scalar> temp = *this;
for (Index i = 0; i < size(); i++)
{
m_values[i] = temp.m_values[ind[i]];
m_vectors.col(i) = temp.m_vectors.col(ind[i]);
m_residues.col(i) = temp.m_residues.col(ind[i]);
m_small_vectors.col(i) = temp.m_small_vectors.col(ind[i]);
}
}
/// Checks if the algorithm has converged and updates root_converged
///
/// \param tol Tolerance for convergence
/// \param number_eigenvalue Number of request eigenvalues
/// \return bool true if all eigenvalues are converged
bool check_convergence(Scalar tol, Index number_eigenvalues)
{
const Array norms = m_residues.colwise().norm();
bool converged = true;
m_root_converged = BoolArray::Zero(norms.size());
for (Index j = 0; j < norms.size(); j++)
{
m_root_converged[j] = (norms[j] < tol);
if (j < number_eigenvalues)
{
converged &= (norms[j] < tol);
}
}
return converged;
}
const Matrix& ritz_vectors() const { return m_vectors; }
const Vector& ritz_values() const { return m_values; }
const Matrix& small_ritz_vectors() const { return m_small_vectors; }
const Matrix& residues() const { return m_residues; }
const BoolArray& converged_eigenvalues() const { return m_root_converged; }
};
} // namespace Spectra
#include "SearchSpace.h"
namespace Spectra {
/// Creates the small space matrix and computes its eigen pairs
/// Also computes the ritz vectors and residues
///
/// \param search_space Instance of the SearchSpace class
template <typename Scalar>
Eigen::ComputationInfo RitzPairs<Scalar>::compute_eigen_pairs(const SearchSpace<Scalar>& search_space)
{
const Matrix& basis_vectors = search_space.basis_vectors();
const Matrix& op_basis_prod = search_space.operator_basis_product();
// Form the small eigenvalue
Matrix small_matrix = basis_vectors.transpose() * op_basis_prod;
// Small eigenvalue problem
Eigen::SelfAdjointEigenSolver<Matrix> eigen_solver(small_matrix);
m_values = eigen_solver.eigenvalues();
m_small_vectors = eigen_solver.eigenvectors();
// Ritz vectors
m_vectors = basis_vectors * m_small_vectors;
// Residues
m_residues = op_basis_prod * m_small_vectors - m_vectors * m_values.asDiagonal();
return eigen_solver.info();
}
} // namespace Spectra
#endif // SPECTRA_RITZ_PAIRS_H
| 4,472
|
C++
|
.h
| 107
| 36.691589
| 102
| 0.681253
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| true
| false
| false
| false
| false
| false
| false
|
27,437
|
ArpackFun.h
|
openMVG_openMVG/src/third_party/spectra/benchmark/ArpackFun.h
|
#ifndef SPECTRA_ARPACKFUN_H
#define SPECTRA_ARPACKFUN_H
#define F77_CALL(x) x##_
#define F77_NAME(x) F77_CALL(x)
enum BMAT
{
BMAT_I = 0,
BMAT_G
};
enum WHICH
{
WHICH_LM = 0,
WHICH_SM,
WHICH_LR,
WHICH_SR,
WHICH_LI,
WHICH_SI,
WHICH_LA,
WHICH_SA,
WHICH_BE
};
enum HOWMNY
{
HOWMNY_A = 0,
HOWMNY_P,
HOWMNY_S
};
extern "C" {
// ARPACK Fortran functions
void F77_NAME(dsaupdwr)(int *ido, int *bmati, int *n, int *whichi,
int *nev, double *tol, double *resid,
int *ncv, double *v, int *ldv,
int *iparam, int *ipntr, double *workd,
double *workl, int *lworkl, int *info);
void F77_NAME(dseupdwr)(int *rvec, int *howmnyi, int *select, double *d,
double *z, int *ldz, double *sigma, int *bmati,
int *n, int *whichi, int *nev, double *tol,
double *resid, int *ncv, double *v, int *ldv,
int *iparam, int *ipntr, double *workd, double *workl,
int *lworkl, int *info);
void F77_NAME(dnaupdwr)(int *ido, int *bmati, int *n, int *whichi,
int *nev, double *tol, double *resid,
int *ncv, double *v, int *ldv,
int *iparam, int *ipntr, double *workd,
double *workl, int *lworkl, int *info);
void F77_NAME(dneupdwr)(int *rvec, int *howmnyi, int *select, double *dr, double *di,
double *z, int *ldz, double *sigmar, double *sigmai, double *workev,
int *bmati, int *n, int *whichi, int *nev, double *tol,
double *resid, int *ncv, double *v, int *ldv, int *iparam,
int *ipntr, double *workd, double *workl, int *lworkl, int *info);
} // extern "C"
// Map char *which to enum type
// WHICH_LM is the default if unusual case happens
inline int whichenum(char *which)
{
switch (which[0])
{
case 'L':
switch (which[1])
{
case 'M':
return (int) WHICH_LM;
case 'R':
return (int) WHICH_LR;
case 'I':
return (int) WHICH_LI;
case 'A':
return (int) WHICH_LA;
default:
return (int) WHICH_LM;
}
case 'S':
switch (which[1])
{
case 'M':
return (int) WHICH_SM;
case 'R':
return (int) WHICH_SR;
case 'I':
return (int) WHICH_SI;
case 'A':
return (int) WHICH_SA;
default:
return (int) WHICH_LM;
}
case 'B':
if (which[1] == 'E')
return (int) WHICH_BE;
else
return (int) WHICH_LM;
default:
return (int) WHICH_LM;
}
return (int) WHICH_LM;
}
// C++ Wrapper of the functions above
inline void saupd(int &ido, char bmat, int n, char *which,
int nev, double &tol, double resid[],
int ncv, double v[], int ldv,
int iparam[], int ipntr[], double workd[],
double workl[], int lworkl, int &info)
{
int bmati = (bmat == 'G') ? BMAT_G : BMAT_I;
int whichi = whichenum(which);
F77_CALL(dsaupdwr)
(&ido, &bmati, &n, &whichi,
&nev, &tol, resid,
&ncv, v, &ldv,
iparam, ipntr, workd,
workl, &lworkl, &info);
}
inline void seupd(bool rvec, char howmny, double d[],
double z[], int ldz, double sigma, char bmat,
int n, char *which, int nev, double tol,
double resid[], int ncv, double v[], int ldv,
int iparam[], int ipntr[], double workd[], double workl[],
int lworkl, int &info)
{
int rvec_pass = (int) rvec;
int *select_pass = new int[ncv];
double *z_pass = (z == NULL) ? v : z;
int howmnyi = (howmny == 'P') ? HOWMNY_P : ((howmny == 'S') ? HOWMNY_S : HOWMNY_A);
int bmati = (bmat == 'G') ? BMAT_G : BMAT_I;
int whichi = whichenum(which);
F77_CALL(dseupdwr)
(&rvec_pass, &howmnyi, select_pass, d,
z_pass, &ldz, &sigma, &bmati,
&n, &whichi, &nev, &tol,
resid, &ncv, v, &ldv,
iparam, ipntr, workd, workl,
&lworkl, &info);
delete[] select_pass;
}
inline void naupd(int &ido, char bmat, int n, char *which,
int nev, double &tol, double resid[],
int ncv, double v[], int ldv,
int iparam[], int ipntr[], double workd[],
double workl[], int lworkl, int &info)
{
int bmati = (bmat == 'G') ? BMAT_G : BMAT_I;
int whichi = whichenum(which);
F77_CALL(dnaupdwr)
(&ido, &bmati, &n, &whichi,
&nev, &tol, resid,
&ncv, v, &ldv,
iparam, ipntr, workd,
workl, &lworkl, &info);
}
inline void neupd(bool rvec, char howmny, double dr[], double di[],
double z[], int ldz, double sigmar, double sigmai, double workev[],
char bmat, int n, char *which, int nev, double tol,
double resid[], int ncv, double v[], int ldv, int iparam[],
int ipntr[], double workd[], double workl[], int lworkl, int &info)
{
int rvec_pass = (int) rvec;
int *select_pass = new int[ncv];
double *z_pass = (z == NULL) ? v : z;
int howmnyi = (howmny == 'P') ? HOWMNY_P : ((howmny == 'S') ? HOWMNY_S : HOWMNY_A);
int bmati = (bmat == 'G') ? BMAT_G : BMAT_I;
int whichi = whichenum(which);
F77_CALL(dneupdwr)
(&rvec_pass, &howmnyi, select_pass, dr, di,
z_pass, &ldz, &sigmar, &sigmai, workev,
&bmati, &n, &whichi, &nev, &tol,
resid, &ncv, v, &ldv, iparam,
ipntr, workd, workl, &lworkl, &info);
delete[] select_pass;
}
#endif // SPECTRA_ARPACKFUN_H
| 6,067
|
C++
|
.h
| 169
| 25.846154
| 92
| 0.50434
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,440
|
inffast.h
|
openMVG_openMVG/src/third_party/zlib/inffast.h
|
/* inffast.h -- header to use inffast.c
* Copyright (C) 1995-2003 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h.
*/
void inflate_fast OF((z_streamp strm, unsigned start));
| 407
|
C++
|
.h
| 9
| 42.888889
| 73
| 0.752525
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
27,441
|
inffixed.h
|
openMVG_openMVG/src/third_party/zlib/inffixed.h
|
/* inffixed.h -- table for decoding fixed codes
* Generated automatically by makefixed().
*/
/* WARNING: this file should *not* be used by applications. It
is part of the implementation of the compression library and
is subject to change. Applications should only use zlib.h.
*/
static const code lenfix[512] = {
{96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
{0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
{0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
{0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
{0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
{21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
{0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
{0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
{18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
{0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
{0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
{0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
{20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
{0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
{0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
{0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
{16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
{0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
{0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
{0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
{0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
{0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
{0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
{0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
{17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
{0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
{0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
{0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
{19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
{0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
{0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
{0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
{16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
{0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
{0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
{0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
{0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
{20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
{0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
{0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
{17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
{0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
{0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
{0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
{20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
{0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
{0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
{0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
{16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
{0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
{0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
{0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
{0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
{0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
{0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
{0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
{16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
{0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
{0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
{0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
{19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
{0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
{0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
{0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
{16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
{0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
{0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
{0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
{0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
{64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
{0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
{0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
{18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
{0,9,255}
};
static const code distfix[32] = {
{16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
{21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
{18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
{19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
{16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
{22,5,193},{64,5,0}
};
| 6,343
|
C++
|
.h
| 91
| 61.054945
| 78
| 0.441031
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,443
|
inftrees.h
|
openMVG_openMVG/src/third_party/zlib/inftrees.h
|
/* inftrees.h -- header to use inftrees.c
* Copyright (C) 1995-2005 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h.
*/
/* Structure for decoding tables. Each entry provides either the
information needed to do the operation requested by the code that
indexed that table entry, or it provides a pointer to another
table that indexes more bits of the code. op indicates whether
the entry is a pointer to another table, a literal, a length or
distance, an end-of-block, or an invalid code. For a table
pointer, the low four bits of op is the number of index bits of
that table. For a length or distance, the low four bits of op
is the number of extra bits to get after the code. bits is
the number of bits in this code or part of the code to drop off
of the bit buffer. val is the actual byte to output in the case
of a literal, the base length or distance, or the offset from
the current table to the next table. Each entry is four bytes. */
typedef struct {
unsigned char op; /* operation, extra bits, table bits */
unsigned char bits; /* bits in this part of the code */
unsigned short val; /* offset in table or code value */
} code;
/* op values as set by inflate_table():
00000000 - literal
0000tttt - table link, tttt != 0 is the number of table index bits
0001eeee - length or distance, eeee is the number of extra bits
01100000 - end of block
01000000 - invalid code
*/
/* Maximum size of dynamic tree. The maximum found in a long but non-
exhaustive search was 1444 code structures (852 for length/literals
and 592 for distances, the latter actually the result of an
exhaustive search). The true maximum is not known, but the value
below is more than safe. */
#define ENOUGH 2048
#define MAXD 592
/* Type of code to build for inftable() */
typedef enum {
CODES,
LENS,
DISTS
} codetype;
extern int inflate_table OF((codetype type, unsigned short FAR *lens,
unsigned codes, code FAR * FAR *table,
unsigned FAR *bits, unsigned short FAR *work));
| 2,373
|
C++
|
.h
| 49
| 44.020408
| 76
| 0.709664
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
27,452
|
jversion.h
|
openMVG_openMVG/src/third_party/jpeg/jversion.h
|
/*
* jversion.h
*
* Copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains software version identification.
*/
#define JVERSION "9 13-Jan-2013"
#define JCOPYRIGHT "Copyright (C) 2013, Thomas G. Lane, Guido Vollbeding"
| 395
|
C++
|
.h
| 11
| 33.909091
| 76
| 0.753281
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
27,499
|
MatrixCwiseUnaryOps.h
|
openMVG_openMVG/src/third_party/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h
|
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
// Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This file is included into the body of the base classes supporting matrix specific coefficient-wise functions.
// This include MatrixBase and SparseMatrixBase.
typedef CwiseUnaryOp<internal::scalar_abs_op<Scalar>, const Derived> CwiseAbsReturnType;
typedef CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const Derived> CwiseAbs2ReturnType;
typedef CwiseUnaryOp<internal::scalar_arg_op<Scalar>, const Derived> CwiseArgReturnType;
typedef CwiseUnaryOp<internal::scalar_sqrt_op<Scalar>, const Derived> CwiseSqrtReturnType;
typedef CwiseUnaryOp<internal::scalar_sign_op<Scalar>, const Derived> CwiseSignReturnType;
typedef CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const Derived> CwiseInverseReturnType;
/// \returns an expression of the coefficient-wise absolute value of \c *this
///
/// Example: \include MatrixBase_cwiseAbs.cpp
/// Output: \verbinclude MatrixBase_cwiseAbs.out
///
EIGEN_DOC_UNARY_ADDONS(cwiseAbs,absolute value)
///
/// \sa cwiseAbs2()
///
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseAbsReturnType
cwiseAbs() const { return CwiseAbsReturnType(derived()); }
/// \returns an expression of the coefficient-wise squared absolute value of \c *this
///
/// Example: \include MatrixBase_cwiseAbs2.cpp
/// Output: \verbinclude MatrixBase_cwiseAbs2.out
///
EIGEN_DOC_UNARY_ADDONS(cwiseAbs2,squared absolute value)
///
/// \sa cwiseAbs()
///
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseAbs2ReturnType
cwiseAbs2() const { return CwiseAbs2ReturnType(derived()); }
/// \returns an expression of the coefficient-wise square root of *this.
///
/// Example: \include MatrixBase_cwiseSqrt.cpp
/// Output: \verbinclude MatrixBase_cwiseSqrt.out
///
EIGEN_DOC_UNARY_ADDONS(cwiseSqrt,square-root)
///
/// \sa cwisePow(), cwiseSquare()
///
EIGEN_DEVICE_FUNC
inline const CwiseSqrtReturnType
cwiseSqrt() const { return CwiseSqrtReturnType(derived()); }
/// \returns an expression of the coefficient-wise signum of *this.
///
/// Example: \include MatrixBase_cwiseSign.cpp
/// Output: \verbinclude MatrixBase_cwiseSign.out
///
EIGEN_DOC_UNARY_ADDONS(cwiseSign,sign function)
///
EIGEN_DEVICE_FUNC
inline const CwiseSignReturnType
cwiseSign() const { return CwiseSignReturnType(derived()); }
/// \returns an expression of the coefficient-wise inverse of *this.
///
/// Example: \include MatrixBase_cwiseInverse.cpp
/// Output: \verbinclude MatrixBase_cwiseInverse.out
///
EIGEN_DOC_UNARY_ADDONS(cwiseInverse,inverse)
///
/// \sa cwiseProduct()
///
EIGEN_DEVICE_FUNC
inline const CwiseInverseReturnType
cwiseInverse() const { return CwiseInverseReturnType(derived()); }
/// \returns an expression of the coefficient-wise phase angle of \c *this
///
/// Example: \include MatrixBase_cwiseArg.cpp
/// Output: \verbinclude MatrixBase_cwiseArg.out
///
EIGEN_DOC_UNARY_ADDONS(cwiseArg,arg)
EIGEN_DEVICE_FUNC
inline const CwiseArgReturnType
cwiseArg() const { return CwiseArgReturnType(derived()); }
| 3,350
|
C++
|
.h
| 84
| 38.75
| 113
| 0.784946
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,524
|
lapack.h
|
openMVG_openMVG/src/third_party/eigen/Eigen/src/misc/lapack.h
|
#ifndef LAPACK_H
#define LAPACK_H
#include "blas.h"
#ifdef __cplusplus
extern "C"
{
#endif
int BLASFUNC(csymv) (const char *, const int *, const float *, const float *, const int *, const float *, const int *, const float *, float *, const int *);
int BLASFUNC(zsymv) (const char *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
int BLASFUNC(xsymv) (const char *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
int BLASFUNC(cspmv) (char *, int *, float *, float *,
float *, int *, float *, float *, int *);
int BLASFUNC(zspmv) (char *, int *, double *, double *,
double *, int *, double *, double *, int *);
int BLASFUNC(xspmv) (char *, int *, double *, double *,
double *, int *, double *, double *, int *);
int BLASFUNC(csyr) (char *, int *, float *, float *, int *,
float *, int *);
int BLASFUNC(zsyr) (char *, int *, double *, double *, int *,
double *, int *);
int BLASFUNC(xsyr) (char *, int *, double *, double *, int *,
double *, int *);
int BLASFUNC(cspr) (char *, int *, float *, float *, int *,
float *);
int BLASFUNC(zspr) (char *, int *, double *, double *, int *,
double *);
int BLASFUNC(xspr) (char *, int *, double *, double *, int *,
double *);
int BLASFUNC(sgemt)(char *, int *, int *, float *, float *, int *,
float *, int *);
int BLASFUNC(dgemt)(char *, int *, int *, double *, double *, int *,
double *, int *);
int BLASFUNC(cgemt)(char *, int *, int *, float *, float *, int *,
float *, int *);
int BLASFUNC(zgemt)(char *, int *, int *, double *, double *, int *,
double *, int *);
int BLASFUNC(sgema)(char *, char *, int *, int *, float *,
float *, int *, float *, float *, int *, float *, int *);
int BLASFUNC(dgema)(char *, char *, int *, int *, double *,
double *, int *, double*, double *, int *, double*, int *);
int BLASFUNC(cgema)(char *, char *, int *, int *, float *,
float *, int *, float *, float *, int *, float *, int *);
int BLASFUNC(zgema)(char *, char *, int *, int *, double *,
double *, int *, double*, double *, int *, double*, int *);
int BLASFUNC(sgems)(char *, char *, int *, int *, float *,
float *, int *, float *, float *, int *, float *, int *);
int BLASFUNC(dgems)(char *, char *, int *, int *, double *,
double *, int *, double*, double *, int *, double*, int *);
int BLASFUNC(cgems)(char *, char *, int *, int *, float *,
float *, int *, float *, float *, int *, float *, int *);
int BLASFUNC(zgems)(char *, char *, int *, int *, double *,
double *, int *, double*, double *, int *, double*, int *);
int BLASFUNC(sgetf2)(int *, int *, float *, int *, int *, int *);
int BLASFUNC(dgetf2)(int *, int *, double *, int *, int *, int *);
int BLASFUNC(qgetf2)(int *, int *, double *, int *, int *, int *);
int BLASFUNC(cgetf2)(int *, int *, float *, int *, int *, int *);
int BLASFUNC(zgetf2)(int *, int *, double *, int *, int *, int *);
int BLASFUNC(xgetf2)(int *, int *, double *, int *, int *, int *);
int BLASFUNC(sgetrf)(int *, int *, float *, int *, int *, int *);
int BLASFUNC(dgetrf)(int *, int *, double *, int *, int *, int *);
int BLASFUNC(qgetrf)(int *, int *, double *, int *, int *, int *);
int BLASFUNC(cgetrf)(int *, int *, float *, int *, int *, int *);
int BLASFUNC(zgetrf)(int *, int *, double *, int *, int *, int *);
int BLASFUNC(xgetrf)(int *, int *, double *, int *, int *, int *);
int BLASFUNC(slaswp)(int *, float *, int *, int *, int *, int *, int *);
int BLASFUNC(dlaswp)(int *, double *, int *, int *, int *, int *, int *);
int BLASFUNC(qlaswp)(int *, double *, int *, int *, int *, int *, int *);
int BLASFUNC(claswp)(int *, float *, int *, int *, int *, int *, int *);
int BLASFUNC(zlaswp)(int *, double *, int *, int *, int *, int *, int *);
int BLASFUNC(xlaswp)(int *, double *, int *, int *, int *, int *, int *);
int BLASFUNC(sgetrs)(char *, int *, int *, float *, int *, int *, float *, int *, int *);
int BLASFUNC(dgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *);
int BLASFUNC(qgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *);
int BLASFUNC(cgetrs)(char *, int *, int *, float *, int *, int *, float *, int *, int *);
int BLASFUNC(zgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *);
int BLASFUNC(xgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *);
int BLASFUNC(sgesv)(int *, int *, float *, int *, int *, float *, int *, int *);
int BLASFUNC(dgesv)(int *, int *, double *, int *, int *, double*, int *, int *);
int BLASFUNC(qgesv)(int *, int *, double *, int *, int *, double*, int *, int *);
int BLASFUNC(cgesv)(int *, int *, float *, int *, int *, float *, int *, int *);
int BLASFUNC(zgesv)(int *, int *, double *, int *, int *, double*, int *, int *);
int BLASFUNC(xgesv)(int *, int *, double *, int *, int *, double*, int *, int *);
int BLASFUNC(spotf2)(char *, int *, float *, int *, int *);
int BLASFUNC(dpotf2)(char *, int *, double *, int *, int *);
int BLASFUNC(qpotf2)(char *, int *, double *, int *, int *);
int BLASFUNC(cpotf2)(char *, int *, float *, int *, int *);
int BLASFUNC(zpotf2)(char *, int *, double *, int *, int *);
int BLASFUNC(xpotf2)(char *, int *, double *, int *, int *);
int BLASFUNC(spotrf)(char *, int *, float *, int *, int *);
int BLASFUNC(dpotrf)(char *, int *, double *, int *, int *);
int BLASFUNC(qpotrf)(char *, int *, double *, int *, int *);
int BLASFUNC(cpotrf)(char *, int *, float *, int *, int *);
int BLASFUNC(zpotrf)(char *, int *, double *, int *, int *);
int BLASFUNC(xpotrf)(char *, int *, double *, int *, int *);
int BLASFUNC(slauu2)(char *, int *, float *, int *, int *);
int BLASFUNC(dlauu2)(char *, int *, double *, int *, int *);
int BLASFUNC(qlauu2)(char *, int *, double *, int *, int *);
int BLASFUNC(clauu2)(char *, int *, float *, int *, int *);
int BLASFUNC(zlauu2)(char *, int *, double *, int *, int *);
int BLASFUNC(xlauu2)(char *, int *, double *, int *, int *);
int BLASFUNC(slauum)(char *, int *, float *, int *, int *);
int BLASFUNC(dlauum)(char *, int *, double *, int *, int *);
int BLASFUNC(qlauum)(char *, int *, double *, int *, int *);
int BLASFUNC(clauum)(char *, int *, float *, int *, int *);
int BLASFUNC(zlauum)(char *, int *, double *, int *, int *);
int BLASFUNC(xlauum)(char *, int *, double *, int *, int *);
int BLASFUNC(strti2)(char *, char *, int *, float *, int *, int *);
int BLASFUNC(dtrti2)(char *, char *, int *, double *, int *, int *);
int BLASFUNC(qtrti2)(char *, char *, int *, double *, int *, int *);
int BLASFUNC(ctrti2)(char *, char *, int *, float *, int *, int *);
int BLASFUNC(ztrti2)(char *, char *, int *, double *, int *, int *);
int BLASFUNC(xtrti2)(char *, char *, int *, double *, int *, int *);
int BLASFUNC(strtri)(char *, char *, int *, float *, int *, int *);
int BLASFUNC(dtrtri)(char *, char *, int *, double *, int *, int *);
int BLASFUNC(qtrtri)(char *, char *, int *, double *, int *, int *);
int BLASFUNC(ctrtri)(char *, char *, int *, float *, int *, int *);
int BLASFUNC(ztrtri)(char *, char *, int *, double *, int *, int *);
int BLASFUNC(xtrtri)(char *, char *, int *, double *, int *, int *);
int BLASFUNC(spotri)(char *, int *, float *, int *, int *);
int BLASFUNC(dpotri)(char *, int *, double *, int *, int *);
int BLASFUNC(qpotri)(char *, int *, double *, int *, int *);
int BLASFUNC(cpotri)(char *, int *, float *, int *, int *);
int BLASFUNC(zpotri)(char *, int *, double *, int *, int *);
int BLASFUNC(xpotri)(char *, int *, double *, int *, int *);
#ifdef __cplusplus
}
#endif
#endif
| 7,834
|
C++
|
.h
| 128
| 58.679688
| 161
| 0.570034
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| true
| false
| false
| false
| false
| false
| false
|
27,526
|
lapacke_mangling.h
|
openMVG_openMVG/src/third_party/eigen/Eigen/src/misc/lapacke_mangling.h
|
#ifndef LAPACK_HEADER_INCLUDED
#define LAPACK_HEADER_INCLUDED
#ifndef LAPACK_GLOBAL
#if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_)
#define LAPACK_GLOBAL(lcname,UCNAME) lcname##_
#elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER)
#define LAPACK_GLOBAL(lcname,UCNAME) UCNAME
#elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE)
#define LAPACK_GLOBAL(lcname,UCNAME) lcname
#else
#define LAPACK_GLOBAL(lcname,UCNAME) lcname##_
#endif
#endif
#endif
| 474
|
C++
|
.h
| 14
| 32.642857
| 60
| 0.796499
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| true
| false
| false
| false
| false
| false
| false
|
27,661
|
DisableStupidWarnings.h
|
openMVG_openMVG/src/third_party/eigen/Eigen/src/Core/util/DisableStupidWarnings.h
|
#ifndef EIGEN_WARNINGS_DISABLED
#define EIGEN_WARNINGS_DISABLED
#ifdef _MSC_VER
// 4100 - unreferenced formal parameter (occurred e.g. in aligned_allocator::destroy(pointer p))
// 4101 - unreferenced local variable
// 4181 - qualifier applied to reference type ignored
// 4211 - nonstandard extension used : redefined extern to static
// 4244 - 'argument' : conversion from 'type1' to 'type2', possible loss of data
// 4273 - QtAlignedMalloc, inconsistent DLL linkage
// 4324 - structure was padded due to declspec(align())
// 4503 - decorated name length exceeded, name was truncated
// 4512 - assignment operator could not be generated
// 4522 - 'class' : multiple assignment operators specified
// 4700 - uninitialized local variable 'xyz' used
// 4714 - function marked as __forceinline not inlined
// 4717 - 'function' : recursive on all control paths, function will cause runtime stack overflow
// 4800 - 'type' : forcing value to bool 'true' or 'false' (performance warning)
#ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
#pragma warning( push )
#endif
#pragma warning( disable : 4100 4101 4181 4211 4244 4273 4324 4503 4512 4522 4700 4714 4717 4800)
#elif defined __INTEL_COMPILER
// 2196 - routine is both "inline" and "noinline" ("noinline" assumed)
// ICC 12 generates this warning even without any inline keyword, when defining class methods 'inline' i.e. inside of class body
// typedef that may be a reference type.
// 279 - controlling expression is constant
// ICC 12 generates this warning on assert(constant_expression_depending_on_template_params) and frankly this is a legitimate use case.
// 1684 - conversion from pointer to same-sized integral type (potential portability problem)
// 2259 - non-pointer conversion from "Eigen::Index={ptrdiff_t={long}}" to "int" may lose significant bits
#ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
#pragma warning push
#endif
#pragma warning disable 2196 279 1684 2259
#elif defined __clang__
// -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant
// this is really a stupid warning as it warns on compile-time expressions involving enums
#ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
#pragma clang diagnostic push
#endif
#pragma clang diagnostic ignored "-Wconstant-logical-operand"
#if __clang_major__ >= 3 && __clang_minor__ >= 5
#pragma clang diagnostic ignored "-Wabsolute-value"
#endif
#if __clang_major__ >= 10
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
#endif
#if ( defined(__ALTIVEC__) || defined(__VSX__) ) && __cplusplus < 201103L
// warning: generic selections are a C11-specific feature
// ignoring warnings thrown at vec_ctf in Altivec/PacketMath.h
#pragma clang diagnostic ignored "-Wc11-extensions"
#endif
#elif defined __GNUC__
#if (!defined(EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS)) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#pragma GCC diagnostic push
#endif
// g++ warns about local variables shadowing member functions, which is too strict
#pragma GCC diagnostic ignored "-Wshadow"
#if __GNUC__ == 4 && __GNUC_MINOR__ < 8
// Until g++-4.7 there are warnings when comparing unsigned int vs 0, even in templated functions:
#pragma GCC diagnostic ignored "-Wtype-limits"
#endif
#if __GNUC__>=6
#pragma GCC diagnostic ignored "-Wignored-attributes"
#endif
#if __GNUC__==7
// See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
#pragma GCC diagnostic ignored "-Wattributes"
#endif
#endif
#if defined __NVCC__
#pragma diag_suppress boolean_controlling_expr_is_constant
// Disable the "statement is unreachable" message
#pragma diag_suppress code_is_unreachable
// Disable the "dynamic initialization in unreachable code" message
#pragma diag_suppress initialization_not_reachable
// Disable the "invalid error number" message that we get with older versions of nvcc
#pragma diag_suppress 1222
// Disable the "calling a __host__ function from a __host__ __device__ function is not allowed" messages (yes, there are many of them and they seem to change with every version of the compiler)
#pragma diag_suppress 2527
#pragma diag_suppress 2529
#pragma diag_suppress 2651
#pragma diag_suppress 2653
#pragma diag_suppress 2668
#pragma diag_suppress 2669
#pragma diag_suppress 2670
#pragma diag_suppress 2671
#pragma diag_suppress 2735
#pragma diag_suppress 2737
#pragma diag_suppress 2739
#endif
#else
// warnings already disabled:
# ifndef EIGEN_WARNINGS_DISABLED_2
# define EIGEN_WARNINGS_DISABLED_2
# elif defined(EIGEN_INTERNAL_DEBUGGING)
# error "Do not include \"DisableStupidWarnings.h\" recursively more than twice!"
# endif
#endif // not EIGEN_WARNINGS_DISABLED
| 4,892
|
C++
|
.h
| 98
| 46.897959
| 195
| 0.738613
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| true
| false
| false
| false
| false
| false
| false
|
27,666
|
NonMPL2.h
|
openMVG_openMVG/src/third_party/eigen/Eigen/src/Core/util/NonMPL2.h
|
#ifdef EIGEN_MPL2_ONLY
#error Including non-MPL2 code in EIGEN_MPL2_ONLY mode
#endif
| 85
|
C++
|
.h
| 3
| 27.333333
| 54
| 0.817073
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,671
|
ReenableStupidWarnings.h
|
openMVG_openMVG/src/third_party/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h
|
#ifdef EIGEN_WARNINGS_DISABLED_2
// "DisableStupidWarnings.h" was included twice recursively: Do not reenable warnings yet!
# undef EIGEN_WARNINGS_DISABLED_2
#elif defined(EIGEN_WARNINGS_DISABLED)
#undef EIGEN_WARNINGS_DISABLED
#ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
#ifdef _MSC_VER
#pragma warning( pop )
#elif defined __INTEL_COMPILER
#pragma warning pop
#elif defined __clang__
#pragma clang diagnostic pop
#elif defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#pragma GCC diagnostic pop
#endif
#if defined __NVCC__
// Don't reenable the diagnostic messages, as it turns out these messages need
// to be disabled at the point of the template instantiation (i.e the user code)
// otherwise they'll be triggered by nvcc.
// #pragma diag_default code_is_unreachable
// #pragma diag_default initialization_not_reachable
// #pragma diag_default 2651
// #pragma diag_default 2653
#endif
#endif
#endif // EIGEN_WARNINGS_DISABLED
| 1,024
|
C++
|
.h
| 26
| 37.038462
| 90
| 0.725076
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| true
| false
| false
| false
| false
| false
| false
|
27,736
|
Settings.h
|
openMVG_openMVG/src/third_party/eigen/Eigen/src/Core/arch/Default/Settings.h
|
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
// Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
/* All the parameters defined in this file can be specialized in the
* architecture specific files, and/or by the user.
* More to come... */
#ifndef EIGEN_DEFAULT_SETTINGS_H
#define EIGEN_DEFAULT_SETTINGS_H
/** Defines the maximal loop size to enable meta unrolling of loops.
* Note that the value here is expressed in Eigen's own notion of "number of FLOPS",
* it does not correspond to the number of iterations or the number of instructions
*/
#ifndef EIGEN_UNROLLING_LIMIT
#define EIGEN_UNROLLING_LIMIT 110
#endif
/** Defines the threshold between a "small" and a "large" matrix.
* This threshold is mainly used to select the proper product implementation.
*/
#ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
#define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 8
#endif
/** Defines the maximal width of the blocks used in the triangular product and solver
* for vectors (level 2 blas xTRMV and xTRSV). The default is 8.
*/
#ifndef EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH
#define EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 8
#endif
/** Defines the default number of registers available for that architecture.
* Currently it must be 8 or 16. Other values will fail.
*/
#ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS
#define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 8
#endif
#endif // EIGEN_DEFAULT_SETTINGS_H
| 1,746
|
C++
|
.h
| 40
| 41.925
| 85
| 0.771361
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
27,745
|
math_constants.h
|
openMVG_openMVG/src/third_party/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h
|
/*
* math_constants.h -
* HIP equivalent of the CUDA header of the same name
*/
#ifndef __MATH_CONSTANTS_H__
#define __MATH_CONSTANTS_H__
/* single precision constants */
#define HIPRT_INF_F __int_as_float(0x7f800000)
#define HIPRT_NAN_F __int_as_float(0x7fffffff)
#define HIPRT_MIN_DENORM_F __int_as_float(0x00000001)
#define HIPRT_MAX_NORMAL_F __int_as_float(0x7f7fffff)
#define HIPRT_NEG_ZERO_F __int_as_float(0x80000000)
#define HIPRT_ZERO_F 0.0f
#define HIPRT_ONE_F 1.0f
/* double precision constants */
#define HIPRT_INF __hiloint2double(0x7ff00000, 0x00000000)
#define HIPRT_NAN __hiloint2double(0xfff80000, 0x00000000)
#endif
| 691
|
C++
|
.h
| 18
| 36.888889
| 67
| 0.706587
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,808
|
TensorContractionCuda.h
|
openMVG_openMVG/src/third_party/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h
|
#if defined(__clang__) || defined(__GNUC__)
#warning "Deprecated header file, please either include the main Eigen/CXX11/Tensor header or the respective TensorContractionGpu.h file"
#endif
#include "TensorContractionGpu.h"
| 225
|
C++
|
.h
| 4
| 54.75
| 137
| 0.789954
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,810
|
TensorDeviceCuda.h
|
openMVG_openMVG/src/third_party/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h
|
#if defined(__clang__) || defined(__GNUC__)
#warning "Deprecated header file, please either include the main Eigen/CXX11/Tensor header or the respective TensorDeviceGpu.h file"
#endif
#include "TensorDeviceGpu.h"
| 215
|
C++
|
.h
| 4
| 52.25
| 132
| 0.779904
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,829
|
TensorGpuHipCudaUndefines.h
|
openMVG_openMVG/src/third_party/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaUndefines.h
|
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2014 Benoit Steiner <benoit.steiner.goog@gmail.com>
// Copyright (C) 2018 Deven Desai <deven.desai.amd@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#if defined(EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H)
#ifndef EIGEN_PERMANENTLY_ENABLE_GPU_HIP_CUDA_DEFINES
#undef gpuStream_t
#undef gpuDeviceProp_t
#undef gpuError_t
#undef gpuSuccess
#undef gpuErrorNotReady
#undef gpuGetDeviceCount
#undef gpuGetErrorString
#undef gpuGetDeviceProperties
#undef gpuStreamDefault
#undef gpuGetDevice
#undef gpuSetDevice
#undef gpuMalloc
#undef gpuFree
#undef gpuMemsetAsync
#undef gpuMemcpyAsync
#undef gpuMemcpyDeviceToDevice
#undef gpuMemcpyDeviceToHost
#undef gpuMemcpyHostToDevice
#undef gpuStreamQuery
#undef gpuSharedMemConfig
#undef gpuDeviceSetSharedMemConfig
#undef gpuStreamSynchronize
#undef gpuDeviceSynchronize
#undef gpuMemcpy
#endif // EIGEN_PERMANENTLY_ENABLE_GPU_HIP_CUDA_DEFINES
#undef EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H
#endif // EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H
| 1,267
|
C++
|
.h
| 38
| 32.157895
| 69
| 0.82502
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,834
|
TensorReductionCuda.h
|
openMVG_openMVG/src/third_party/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h
|
#if defined(__clang__) || defined(__GNUC__)
#warning "Deprecated header file, please either include the main Eigen/CXX11/Tensor header or the respective TensorReductionGpu.h file"
#endif
#include "TensorReductionGpu.h"
| 221
|
C++
|
.h
| 4
| 53.75
| 135
| 0.786047
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,836
|
TensorGpuHipCudaDefines.h
|
openMVG_openMVG/src/third_party/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h
|
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2014 Benoit Steiner <benoit.steiner.goog@gmail.com>
// Copyright (C) 2018 Deven Desai <deven.desai.amd@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#if defined(EIGEN_USE_GPU) && !defined(EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H)
#define EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H
// Note that we are using EIGEN_USE_HIP here instead of EIGEN_HIPCC...this is by design
// There is code in the Tensorflow codebase that will define EIGEN_USE_GPU, but
// for some reason gets sent to the gcc/host compiler instead of the gpu/nvcc/hipcc compiler
// When compiling such files, gcc will end up trying to pick up the CUDA headers by
// default (see the code within "unsupported/Eigen/CXX11/Tensor" that is guarded by EIGEN_USE_GPU)
// This will obviously not work when trying to compile tensorflow on a system with no CUDA
// To work around this issue for HIP systems (and leave the default behaviour intact), the
// HIP tensorflow build defines EIGEN_USE_HIP when compiling all source files, and
// "unsupported/Eigen/CXX11/Tensor" has been updated to use HIP header when EIGEN_USE_HIP is
// defined. In continuation of that requirement, the guard here needs to be EIGEN_USE_HIP as well
#if defined(EIGEN_USE_HIP)
#define gpuStream_t hipStream_t
#define gpuDeviceProp_t hipDeviceProp_t
#define gpuError_t hipError_t
#define gpuSuccess hipSuccess
#define gpuErrorNotReady hipErrorNotReady
#define gpuGetDeviceCount hipGetDeviceCount
#define gpuGetLastError hipGetLastError
#define gpuPeekAtLastError hipPeekAtLastError
#define gpuGetErrorName hipGetErrorName
#define gpuGetErrorString hipGetErrorString
#define gpuGetDeviceProperties hipGetDeviceProperties
#define gpuStreamDefault hipStreamDefault
#define gpuGetDevice hipGetDevice
#define gpuSetDevice hipSetDevice
#define gpuMalloc hipMalloc
#define gpuFree hipFree
#define gpuMemsetAsync hipMemsetAsync
#define gpuMemcpyAsync hipMemcpyAsync
#define gpuMemcpyDeviceToDevice hipMemcpyDeviceToDevice
#define gpuMemcpyDeviceToHost hipMemcpyDeviceToHost
#define gpuMemcpyHostToDevice hipMemcpyHostToDevice
#define gpuStreamQuery hipStreamQuery
#define gpuSharedMemConfig hipSharedMemConfig
#define gpuDeviceSetSharedMemConfig hipDeviceSetSharedMemConfig
#define gpuStreamSynchronize hipStreamSynchronize
#define gpuDeviceSynchronize hipDeviceSynchronize
#define gpuMemcpy hipMemcpy
#else
#define gpuStream_t cudaStream_t
#define gpuDeviceProp_t cudaDeviceProp
#define gpuError_t cudaError_t
#define gpuSuccess cudaSuccess
#define gpuErrorNotReady cudaErrorNotReady
#define gpuGetDeviceCount cudaGetDeviceCount
#define gpuGetLastError cudaGetLastError
#define gpuPeekAtLastError cudaPeekAtLastError
#define gpuGetErrorName cudaGetErrorName
#define gpuGetErrorString cudaGetErrorString
#define gpuGetDeviceProperties cudaGetDeviceProperties
#define gpuStreamDefault cudaStreamDefault
#define gpuGetDevice cudaGetDevice
#define gpuSetDevice cudaSetDevice
#define gpuMalloc cudaMalloc
#define gpuFree cudaFree
#define gpuMemsetAsync cudaMemsetAsync
#define gpuMemcpyAsync cudaMemcpyAsync
#define gpuMemcpyDeviceToDevice cudaMemcpyDeviceToDevice
#define gpuMemcpyDeviceToHost cudaMemcpyDeviceToHost
#define gpuMemcpyHostToDevice cudaMemcpyHostToDevice
#define gpuStreamQuery cudaStreamQuery
#define gpuSharedMemConfig cudaSharedMemConfig
#define gpuDeviceSetSharedMemConfig cudaDeviceSetSharedMemConfig
#define gpuStreamSynchronize cudaStreamSynchronize
#define gpuDeviceSynchronize cudaDeviceSynchronize
#define gpuMemcpy cudaMemcpy
#endif
// gpu_assert can be overridden
#ifndef gpu_assert
#if defined(EIGEN_HIP_DEVICE_COMPILE)
// HIPCC do not support the use of assert on the GPU side.
#define gpu_assert(COND)
#else
#define gpu_assert(COND) assert(COND)
#endif
#endif // gpu_assert
#endif // EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H
| 4,068
|
C++
|
.h
| 88
| 45.079545
| 98
| 0.853112
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,839
|
ThreadCancel.h
|
openMVG_openMVG/src/third_party/eigen/unsupported/Eigen/CXX11/src/ThreadPool/ThreadCancel.h
|
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2016 Benoit Steiner <benoit.steiner.goog@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_CXX11_THREADPOOL_THREAD_CANCEL_H
#define EIGEN_CXX11_THREADPOOL_THREAD_CANCEL_H
// Try to come up with a portable way to cancel a thread
#if EIGEN_OS_GNULINUX
#define EIGEN_THREAD_CANCEL(t) \
pthread_cancel(t.native_handle());
#define EIGEN_SUPPORTS_THREAD_CANCELLATION 1
#else
#define EIGEN_THREAD_CANCEL(t)
#endif
#endif // EIGEN_CXX11_THREADPOOL_THREAD_CANCEL_H
| 774
|
C++
|
.h
| 19
| 39.105263
| 69
| 0.743009
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,946
|
version.h
|
openMVG_openMVG/src/third_party/ceres-solver/include/ceres/version.h
|
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2015 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Google Inc. nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Author: mierle@gmail.com (Keir Mierle)
#ifndef CERES_PUBLIC_VERSION_H_
#define CERES_PUBLIC_VERSION_H_
#define CERES_VERSION_MAJOR 1
#define CERES_VERSION_MINOR 13
#define CERES_VERSION_REVISION 0
// Classic CPP stringifcation; the extra level of indirection allows the
// preprocessor to expand the macro before being converted to a string.
#define CERES_TO_STRING_HELPER(x) #x
#define CERES_TO_STRING(x) CERES_TO_STRING_HELPER(x)
// The Ceres version as a string; for example "1.9.0".
#define CERES_VERSION_STRING CERES_TO_STRING(CERES_VERSION_MAJOR) "." \
CERES_TO_STRING(CERES_VERSION_MINOR) "." \
CERES_TO_STRING(CERES_VERSION_REVISION)
#endif // CERES_PUBLIC_VERSION_H_
| 2,378
|
C++
|
.h
| 43
| 52.837209
| 78
| 0.762661
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,952
|
c_api.h
|
openMVG_openMVG/src/third_party/ceres-solver/include/ceres/c_api.h
|
/* Ceres Solver - A fast non-linear least squares minimizer
* Copyright 2015 Google Inc. All rights reserved.
* http://ceres-solver.org/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of Google Inc. nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Author: mierle@gmail.com (Keir Mierle)
*
* A minimal C API for Ceres. Not all functionality is included. This API is
* not intended for clients of Ceres, but is instead intended for easing the
* process of binding Ceres to other languages.
*
* Currently this is a work in progress.
*/
#ifndef CERES_PUBLIC_C_API_H_
#define CERES_PUBLIC_C_API_H_
#include "ceres/internal/port.h"
#include "ceres/internal/disable_warnings.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Init the Ceres private data. Must be called before anything else. */
CERES_EXPORT void ceres_init();
/* Equivalent to CostFunction::Evaluate() in the C++ API.
*
* The user may keep private information inside the opaque user_data object.
* The pointer here is the same one passed in the ceres_add_residual_block().
*/
typedef int (*ceres_cost_function_t)(void* user_data,
double** parameters,
double* residuals,
double** jacobians);
/* Equivalent to LossFunction::Evaluate() from the C++ API. */
typedef void (*ceres_loss_function_t)(void* user_data,
double squared_norm,
double out[3]);
/* Create callback data for Ceres' stock loss functions.
*
* Ceres has several loss functions available by default, and these functions
* expose those to the C API. To use the stock loss functions, call
* ceres_create_*_loss_data(), which internally creates an instance of one of
* the stock loss functions (for example ceres::CauchyLoss), and pass the
* returned "loss_function_data" along with the ceres_stock_loss_function to
* ceres_add_residual_block().
*
* For example:
*
* void* cauchy_loss_function_data =
* ceres_create_cauchy_loss_function_data(1.2, 0.0);
* ceres_problem_add_residual_block(
* problem,
* my_cost_function,
* my_cost_function_data,
* ceres_stock_loss_function,
* cauchy_loss_function_data,
* 1,
* 2,
* parameter_sizes,
* parameter_pointers);
* ...
* ceres_free_stock_loss_function_data(cauchy_loss_function_data);
*
* See loss_function.h for the details of each loss function.
*/
CERES_EXPORT void* ceres_create_huber_loss_function_data(double a);
CERES_EXPORT void* ceres_create_softl1_loss_function_data(double a);
CERES_EXPORT void* ceres_create_cauchy_loss_function_data(double a);
CERES_EXPORT void* ceres_create_arctan_loss_function_data(double a);
CERES_EXPORT void* ceres_create_tolerant_loss_function_data(double a, double b);
/* Free the given stock loss function data. */
CERES_EXPORT void ceres_free_stock_loss_function_data(void* loss_function_data);
/* This is an implementation of ceres_loss_function_t contained within Ceres
* itself, intended as a way to access the various stock Ceres loss functions
* from the C API. This should be passed to ceres_add_residual() below, in
* combination with a user_data pointer generated by
* ceres_create_stock_loss_function() above. */
CERES_EXPORT void ceres_stock_loss_function(void* user_data,
double squared_norm,
double out[3]);
/* Equivalent to Problem from the C++ API. */
struct ceres_problem_s;
typedef struct ceres_problem_s ceres_problem_t;
struct ceres_residual_block_id_s;
typedef struct ceres_residual_block_id_s ceres_residual_block_id_t;
/* Create and destroy a problem */
/* TODO(keir): Add options for the problem. */
CERES_EXPORT ceres_problem_t* ceres_create_problem();
CERES_EXPORT void ceres_free_problem(ceres_problem_t* problem);
/* Add a residual block. */
CERES_EXPORT ceres_residual_block_id_t* ceres_problem_add_residual_block(
ceres_problem_t* problem,
ceres_cost_function_t cost_function,
void* cost_function_data,
ceres_loss_function_t loss_function,
void* loss_function_data,
int num_residuals,
int num_parameter_blocks,
int* parameter_block_sizes,
double** parameters);
CERES_EXPORT void ceres_solve(ceres_problem_t* problem);
/* TODO(keir): Figure out a way to pass a config in. */
#ifdef __cplusplus
}
#endif
#include "ceres/internal/reenable_warnings.h"
#endif /* CERES_PUBLIC_C_API_H_ */
| 5,938
|
C++
|
.h
| 128
| 42.273438
| 80
| 0.718923
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
27,966
|
ceres.h
|
openMVG_openMVG/src/third_party/ceres-solver/include/ceres/ceres.h
|
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2015 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Google Inc. nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Author: keir@google.com (Keir Mierle)
//
// This is a forwarding header containing the public symbols exported from
// Ceres. Anything in the "ceres" namespace is available for use.
#ifndef CERES_PUBLIC_CERES_H_
#define CERES_PUBLIC_CERES_H_
#include "ceres/autodiff_cost_function.h"
#include "ceres/autodiff_local_parameterization.h"
#include "ceres/cost_function.h"
#include "ceres/cost_function_to_functor.h"
#include "ceres/covariance.h"
#include "ceres/crs_matrix.h"
#include "ceres/dynamic_autodiff_cost_function.h"
#include "ceres/dynamic_numeric_diff_cost_function.h"
#include "ceres/gradient_problem.h"
#include "ceres/gradient_problem_solver.h"
#include "ceres/iteration_callback.h"
#include "ceres/jet.h"
#include "ceres/local_parameterization.h"
#include "ceres/loss_function.h"
#include "ceres/numeric_diff_cost_function.h"
#include "ceres/ordered_groups.h"
#include "ceres/problem.h"
#include "ceres/sized_cost_function.h"
#include "ceres/solver.h"
#include "ceres/types.h"
#include "ceres/version.h"
#endif // CERES_PUBLIC_CERES_H_
| 2,689
|
C++
|
.h
| 56
| 46.964286
| 78
| 0.785171
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,982
|
disable_warnings.h
|
openMVG_openMVG/src/third_party/ceres-solver/include/ceres/internal/disable_warnings.h
|
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2015 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Google Inc. nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// This file has the sole purpose to silence warnings when including Ceres.
// This is not your usual header guard. The macro CERES_WARNINGS_DISABLED
// shows up again in reenable_warnings.h.
#ifndef CERES_WARNINGS_DISABLED
#define CERES_WARNINGS_DISABLED
#ifdef _MSC_VER
#pragma warning( push )
// Disable the warning C4251 which is trigerred by stl classes in
// Ceres' public interface. To quote MSDN: "C4251 can be ignored "
// "if you are deriving from a type in the Standard C++ Library"
#pragma warning( disable : 4251 )
#endif
#endif // CERES_WARNINGS_DISABLED
| 2,208
|
C++
|
.h
| 41
| 52.780488
| 78
| 0.781885
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,984
|
reenable_warnings.h
|
openMVG_openMVG/src/third_party/ceres-solver/include/ceres/internal/reenable_warnings.h
|
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2015 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Google Inc. nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// This is not your usual header guard. See disable_warnings.h
#ifdef CERES_WARNINGS_DISABLED
#undef CERES_WARNINGS_DISABLED
#ifdef _MSC_VER
#pragma warning( pop )
#endif
#endif // CERES_WARNINGS_DISABLED
| 1,844
|
C++
|
.h
| 35
| 51.6
| 78
| 0.785161
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
27,989
|
config.h
|
openMVG_openMVG/src/third_party/ceres-solver/config/ceres/internal/config.h
|
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2015 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Google Inc. nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Author: alexs.mac@gmail.com (Alex Stewart)
// Default (empty) configuration options for Ceres.
//
// IMPORTANT: Most users of Ceres will not use this file, when
// compiling Ceres with CMake, CMake will configure a new
// config.h with the currently selected Ceres compile
// options in <BUILD_DIR>/config, which will be added to
// the include path for compilation, and installed with the
// public Ceres headers. However, for some users of Ceres
// who compile without CMake (Android), this file ensures
// that Ceres will compile, with the user either specifying
// manually the Ceres compile options, or passing them
// directly through the compiler.
#ifndef CERES_PUBLIC_INTERNAL_CONFIG_H_
#define CERES_PUBLIC_INTERNAL_CONFIG_H_
#endif // CERES_PUBLIC_INTERNAL_CONFIG_H_
| 2,520
|
C++
|
.h
| 44
| 56.181818
| 78
| 0.750405
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,099
|
fast.h
|
openMVG_openMVG/src/third_party/fast/fast.h
|
#ifndef FAST_H
#define FAST_H
typedef struct { int x, y; } xy;
typedef unsigned char byte;
int fast9_corner_score(const byte* p, const int pixel[], int bstart);
int fast10_corner_score(const byte* p, const int pixel[], int bstart);
int fast11_corner_score(const byte* p, const int pixel[], int bstart);
int fast12_corner_score(const byte* p, const int pixel[], int bstart);
xy* fast9_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners);
xy* fast10_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners);
xy* fast11_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners);
xy* fast12_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners);
int* fast9_score(const byte* i, int stride, xy* corners, int num_corners, int b);
int* fast10_score(const byte* i, int stride, xy* corners, int num_corners, int b);
int* fast11_score(const byte* i, int stride, xy* corners, int num_corners, int b);
int* fast12_score(const byte* i, int stride, xy* corners, int num_corners, int b);
xy* fast9_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners);
xy* fast10_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners);
xy* fast11_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners);
xy* fast12_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners);
xy* nonmax_suppression(const xy* corners, const int* scores, int num_corners, int* ret_num_nonmax);
#endif
| 1,632
|
C++
|
.h
| 22
| 72.727273
| 104
| 0.730169
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| true
| false
| false
| false
| false
| false
| false
|
28,107
|
config.h
|
openMVG_openMVG/src/third_party/flann/src/cpp/flann/config.h
|
/***********************************************************************
* Software License Agreement (BSD License)
*
* Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved.
* Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*************************************************************************/
#ifndef FLANN_CONFIG_H_
#define FLANN_CONFIG_H_
#ifdef FLANN_VERSION_
#undef FLANN_VERSION_
#endif
#define FLANN_VERSION_ "1.8.4"
#endif /* FLANN_CONFIG_H_ */
| 1,767
|
C++
|
.h
| 34
| 50.088235
| 77
| 0.707924
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,151
|
pngconf.h
|
openMVG_openMVG/src/third_party/png/pngconf.h
|
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.6.6 - September 16, 2013
*
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
*/
/* Any machine specific code is near the front of this file, so if you
* are configuring libpng for a machine, you may want to read the section
* starting here down to where it starts to typedef png_color, png_text,
* and png_info.
*/
#ifndef PNGCONF_H
#define PNGCONF_H
/* To do: Do all of this in scripts/pnglibconf.dfa */
#ifdef PNG_SAFE_LIMITS_SUPPORTED
# ifdef PNG_USER_WIDTH_MAX
# undef PNG_USER_WIDTH_MAX
# define PNG_USER_WIDTH_MAX 1000000L
# endif
# ifdef PNG_USER_HEIGHT_MAX
# undef PNG_USER_HEIGHT_MAX
# define PNG_USER_HEIGHT_MAX 1000000L
# endif
# ifdef PNG_USER_CHUNK_MALLOC_MAX
# undef PNG_USER_CHUNK_MALLOC_MAX
# define PNG_USER_CHUNK_MALLOC_MAX 4000000L
# endif
# ifdef PNG_USER_CHUNK_CACHE_MAX
# undef PNG_USER_CHUNK_CACHE_MAX
# define PNG_USER_CHUNK_CACHE_MAX 128
# endif
#endif
#ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */
/* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C
* compiler for correct compilation. The following header files are required by
* the standard. If your compiler doesn't provide these header files, or they
* do not match the standard, you will need to provide/improve them.
*/
#include <limits.h>
#include <stddef.h>
/* Library header files. These header files are all defined by ISOC90; libpng
* expects conformant implementations, however, an ISOC90 conformant system need
* not provide these header files if the functionality cannot be implemented.
* In this case it will be necessary to disable the relevant parts of libpng in
* the build of pnglibconf.h.
*
* Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not
* include this unnecessary header file.
*/
#ifdef PNG_STDIO_SUPPORTED
/* Required for the definition of FILE: */
# include <stdio.h>
#endif
#ifdef PNG_SETJMP_SUPPORTED
/* Required for the definition of jmp_buf and the declaration of longjmp: */
# include <setjmp.h>
#endif
#ifdef PNG_CONVERT_tIME_SUPPORTED
/* Required for struct tm: */
# include <time.h>
#endif
#endif /* PNG_BUILDING_SYMBOL_TABLE */
/* Prior to 1.6.0 it was possible to turn off 'const' in declarations using
* PNG_NO_CONST; this is no longer supported except for data declarations which
* apparently still cause problems in 2011 on some compilers.
*/
#define PNG_CONST const /* backward compatibility only */
/* This controls optimization of the reading of 16 and 32 bit values
* from PNG files. It can be set on a per-app-file basis - it
* just changes whether a macro is used when the function is called.
* The library builder sets the default; if read functions are not
* built into the library the macro implementation is forced on.
*/
#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
# define PNG_USE_READ_MACROS
#endif
#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)
# if PNG_DEFAULT_READ_MACROS
# define PNG_USE_READ_MACROS
# endif
#endif
/* COMPILER SPECIFIC OPTIONS.
*
* These options are provided so that a variety of difficult compilers
* can be used. Some are fixed at build time (e.g. PNG_API_RULE
* below) but still have compiler specific implementations, others
* may be changed on a per-file basis when compiling against libpng.
*/
/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect
* against legacy (pre ISOC90) compilers that did not understand function
* prototypes. It is not required for modern C compilers.
*/
#ifndef PNGARG
# define PNGARG(arglist) arglist
#endif
/* Function calling conventions.
* =============================
* Normally it is not necessary to specify to the compiler how to call
* a function - it just does it - however on x86 systems derived from
* Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems
* and some others) there are multiple ways to call a function and the
* default can be changed on the compiler command line. For this reason
* libpng specifies the calling convention of every exported function and
* every function called via a user supplied function pointer. This is
* done in this file by defining the following macros:
*
* PNGAPI Calling convention for exported functions.
* PNGCBAPI Calling convention for user provided (callback) functions.
* PNGCAPI Calling convention used by the ANSI-C library (required
* for longjmp callbacks and sometimes used internally to
* specify the calling convention for zlib).
*
* These macros should never be overridden. If it is necessary to
* change calling convention in a private build this can be done
* by setting PNG_API_RULE (which defaults to 0) to one of the values
* below to select the correct 'API' variants.
*
* PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.
* This is correct in every known environment.
* PNG_API_RULE=1 Use the operating system convention for PNGAPI and
* the 'C' calling convention (from PNGCAPI) for
* callbacks (PNGCBAPI). This is no longer required
* in any known environment - if it has to be used
* please post an explanation of the problem to the
* libpng mailing list.
*
* These cases only differ if the operating system does not use the C
* calling convention, at present this just means the above cases
* (x86 DOS/Windows sytems) and, even then, this does not apply to
* Cygwin running on those systems.
*
* Note that the value must be defined in pnglibconf.h so that what
* the application uses to call the library matches the conventions
* set when building the library.
*/
/* Symbol export
* =============
* When building a shared library it is almost always necessary to tell
* the compiler which symbols to export. The png.h macro 'PNG_EXPORT'
* is used to mark the symbols. On some systems these symbols can be
* extracted at link time and need no special processing by the compiler,
* on other systems the symbols are flagged by the compiler and just
* the declaration requires a special tag applied (unfortunately) in a
* compiler dependent way. Some systems can do either.
*
* A small number of older systems also require a symbol from a DLL to
* be flagged to the program that calls it. This is a problem because
* we do not know in the header file included by application code that
* the symbol will come from a shared library, as opposed to a statically
* linked one. For this reason the application must tell us by setting
* the magic flag PNG_USE_DLL to turn on the special processing before
* it includes png.h.
*
* Four additional macros are used to make this happen:
*
* PNG_IMPEXP The magic (if any) to cause a symbol to be exported from
* the build or imported if PNG_USE_DLL is set - compiler
* and system specific.
*
* PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to
* 'type', compiler specific.
*
* PNG_DLL_EXPORT Set to the magic to use during a libpng build to
* make a symbol exported from the DLL. Not used in the
* public header files; see pngpriv.h for how it is used
* in the libpng build.
*
* PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come
* from a DLL - used to define PNG_IMPEXP when
* PNG_USE_DLL is set.
*/
/* System specific discovery.
* ==========================
* This code is used at build time to find PNG_IMPEXP, the API settings
* and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL
* import processing is possible. On Windows systems it also sets
* compiler-specific macros to the values required to change the calling
* conventions of the various functions.
*/
#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
/* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or
* MinGW on any architecture currently supported by Windows. Also includes
* Watcom builds but these need special treatment because they are not
* compatible with GCC or Visual C because of different calling conventions.
*/
# if PNG_API_RULE == 2
/* If this line results in an error, either because __watcall is not
* understood or because of a redefine just below you cannot use *this*
* build of the library with the compiler you are using. *This* build was
* build using Watcom and applications must also be built using Watcom!
*/
# define PNGCAPI __watcall
# endif
# if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))
# define PNGCAPI __cdecl
# if PNG_API_RULE == 1
/* If this line results in an error __stdcall is not understood and
* PNG_API_RULE should not have been set to '1'.
*/
# define PNGAPI __stdcall
# endif
# else
/* An older compiler, or one not detected (erroneously) above,
* if necessary override on the command line to get the correct
* variants for the compiler.
*/
# ifndef PNGCAPI
# define PNGCAPI _cdecl
# endif
# if PNG_API_RULE == 1 && !defined(PNGAPI)
# define PNGAPI _stdcall
# endif
# endif /* compiler/api */
/* NOTE: PNGCBAPI always defaults to PNGCAPI. */
# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
# error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed"
# endif
# if (defined(_MSC_VER) && _MSC_VER < 800) ||\
(defined(__BORLANDC__) && __BORLANDC__ < 0x500)
/* older Borland and MSC
* compilers used '__export' and required this to be after
* the type.
*/
# ifndef PNG_EXPORT_TYPE
# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
# endif
# define PNG_DLL_EXPORT __export
# else /* newer compiler */
# define PNG_DLL_EXPORT __declspec(dllexport)
# ifndef PNG_DLL_IMPORT
# define PNG_DLL_IMPORT __declspec(dllimport)
# endif
# endif /* compiler */
#else /* !Windows */
# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
# define PNGAPI _System
# else /* !Windows/x86 && !OS/2 */
/* Use the defaults, or define PNG*API on the command line (but
* this will have to be done for every compile!)
*/
# endif /* other system, !OS/2 */
#endif /* !Windows/x86 */
/* Now do all the defaulting . */
#ifndef PNGCAPI
# define PNGCAPI
#endif
#ifndef PNGCBAPI
# define PNGCBAPI PNGCAPI
#endif
#ifndef PNGAPI
# define PNGAPI PNGCAPI
#endif
/* PNG_IMPEXP may be set on the compilation system command line or (if not set)
* then in an internal header file when building the library, otherwise (when
* using the library) it is set here.
*/
#ifndef PNG_IMPEXP
# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
/* This forces use of a DLL, disallowing static linking */
# define PNG_IMPEXP PNG_DLL_IMPORT
# endif
# ifndef PNG_IMPEXP
# define PNG_IMPEXP
# endif
#endif
/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat
* 'attributes' as a storage class - the attributes go at the start of the
* function definition, and attributes are always appended regardless of the
* compiler. This considerably simplifies these macros but may cause problems
* if any compilers both need function attributes and fail to handle them as
* a storage class (this is unlikely.)
*/
#ifndef PNG_FUNCTION
# define PNG_FUNCTION(type, name, args, attributes) attributes type name args
#endif
#ifndef PNG_EXPORT_TYPE
# define PNG_EXPORT_TYPE(type) PNG_IMPEXP type
#endif
/* The ordinal value is only relevant when preprocessing png.h for symbol
* table entries, so we discard it here. See the .dfn files in the
* scripts directory.
*/
#ifndef PNG_EXPORTA
# define PNG_EXPORTA(ordinal, type, name, args, attributes)\
PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \
extern attributes)
#endif
/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,
* so make something non-empty to satisfy the requirement:
*/
#define PNG_EMPTY /*empty list*/
#define PNG_EXPORT(ordinal, type, name, args)\
PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)
/* Use PNG_REMOVED to comment out a removed interface. */
#ifndef PNG_REMOVED
# define PNG_REMOVED(ordinal, type, name, args, attributes)
#endif
#ifndef PNG_CALLBACK
# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)
#endif
/* Support for compiler specific function attributes. These are used
* so that where compiler support is available incorrect use of API
* functions in png.h will generate compiler warnings.
*
* Added at libpng-1.2.41.
*/
#ifndef PNG_NO_PEDANTIC_WARNINGS
# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED
# define PNG_PEDANTIC_WARNINGS_SUPPORTED
# endif
#endif
#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
/* Support for compiler specific function attributes. These are used
* so that where compiler support is available, incorrect use of API
* functions in png.h will generate compiler warnings. Added at libpng
* version 1.2.41. Disabling these removes the warnings but may also produce
* less efficient code.
*/
# if defined(__GNUC__)
# ifndef PNG_USE_RESULT
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
# endif
# ifndef PNG_NORETURN
# define PNG_NORETURN __attribute__((__noreturn__))
# endif
# if __GNUC__ >= 3
# ifndef PNG_ALLOCATED
# define PNG_ALLOCATED __attribute__((__malloc__))
# endif
# ifndef PNG_DEPRECATED
# define PNG_DEPRECATED __attribute__((__deprecated__))
# endif
# ifndef PNG_PRIVATE
# if 0 /* Doesn't work so we use deprecated instead*/
# define PNG_PRIVATE \
__attribute__((warning("This function is not exported by libpng.")))
# else
# define PNG_PRIVATE \
__attribute__((__deprecated__))
# endif
# endif
# if ((__GNUC__ != 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))
# ifndef PNG_RESTRICT
# define PNG_RESTRICT __restrict
# endif
# endif /* __GNUC__ == 3.0 */
# endif /* __GNUC__ >= 3 */
# elif defined(_MSC_VER) && (_MSC_VER >= 1300)
# ifndef PNG_USE_RESULT
# define PNG_USE_RESULT /* not supported */
# endif
# ifndef PNG_NORETURN
# define PNG_NORETURN __declspec(noreturn)
# endif
# ifndef PNG_ALLOCATED
# if (_MSC_VER >= 1400)
# define PNG_ALLOCATED __declspec(restrict)
# endif
# endif
# ifndef PNG_DEPRECATED
# define PNG_DEPRECATED __declspec(deprecated)
# endif
# ifndef PNG_PRIVATE
# define PNG_PRIVATE __declspec(deprecated)
# endif
# ifndef PNG_RESTRICT
# if (_MSC_VER >= 1400)
# define PNG_RESTRICT __restrict
# endif
# endif
# elif defined(__WATCOMC__)
# ifndef PNG_RESTRICT
# define PNG_RESTRICT __restrict
# endif
# endif /* _MSC_VER */
#endif /* PNG_PEDANTIC_WARNINGS */
#ifndef PNG_DEPRECATED
# define PNG_DEPRECATED /* Use of this function is deprecated */
#endif
#ifndef PNG_USE_RESULT
# define PNG_USE_RESULT /* The result of this function must be checked */
#endif
#ifndef PNG_NORETURN
# define PNG_NORETURN /* This function does not return */
#endif
#ifndef PNG_ALLOCATED
# define PNG_ALLOCATED /* The result of the function is new memory */
#endif
#ifndef PNG_PRIVATE
# define PNG_PRIVATE /* This is a private libpng function */
#endif
#ifndef PNG_RESTRICT
# define PNG_RESTRICT /* The C99 "restrict" feature */
#endif
#ifndef PNG_FP_EXPORT /* A floating point API. */
# ifdef PNG_FLOATING_POINT_SUPPORTED
# define PNG_FP_EXPORT(ordinal, type, name, args)\
PNG_EXPORT(ordinal, type, name, args);
# else /* No floating point APIs */
# define PNG_FP_EXPORT(ordinal, type, name, args)
# endif
#endif
#ifndef PNG_FIXED_EXPORT /* A fixed point API. */
# ifdef PNG_FIXED_POINT_SUPPORTED
# define PNG_FIXED_EXPORT(ordinal, type, name, args)\
PNG_EXPORT(ordinal, type, name, args);
# else /* No fixed point APIs */
# define PNG_FIXED_EXPORT(ordinal, type, name, args)
# endif
#endif
#ifndef PNG_BUILDING_SYMBOL_TABLE
/* Some typedefs to get us started. These should be safe on most of the common
* platforms.
*
* png_uint_32 and png_int_32 may, currently, be larger than required to hold a
* 32-bit value however this is not normally advisable.
*
* png_uint_16 and png_int_16 should always be two bytes in size - this is
* verified at library build time.
*
* png_byte must always be one byte in size.
*
* The checks below use constants from limits.h, as defined by the ISOC90
* standard.
*/
#if CHAR_BIT == 8 && UCHAR_MAX == 255
typedef unsigned char png_byte;
#else
# error "libpng requires 8 bit bytes"
#endif
#if INT_MIN == -32768 && INT_MAX == 32767
typedef int png_int_16;
#elif SHRT_MIN == -32768 && SHRT_MAX == 32767
typedef short png_int_16;
#else
# error "libpng requires a signed 16 bit type"
#endif
#if UINT_MAX == 65535
typedef unsigned int png_uint_16;
#elif USHRT_MAX == 65535
typedef unsigned short png_uint_16;
#else
# error "libpng requires an unsigned 16 bit type"
#endif
#if INT_MIN < -2147483646 && INT_MAX > 2147483646
typedef int png_int_32;
#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646
typedef long int png_int_32;
#else
# error "libpng requires a signed 32 bit (or more) type"
#endif
#if UINT_MAX > 4294967294
typedef unsigned int png_uint_32;
#elif ULONG_MAX > 4294967294
typedef unsigned long int png_uint_32;
#else
# error "libpng requires an unsigned 32 bit (or more) type"
#endif
/* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,
* requires an ISOC90 compiler and relies on consistent behavior of sizeof.
*/
typedef size_t png_size_t;
typedef ptrdiff_t png_ptrdiff_t;
/* libpng needs to know the maximum value of 'size_t' and this controls the
* definition of png_alloc_size_t, below. This maximum value of size_t limits
* but does not control the maximum allocations the library makes - there is
* direct application control of this through png_set_user_limits().
*/
#ifndef PNG_SMALL_SIZE_T
/* Compiler specific tests for systems where size_t is known to be less than
* 32 bits (some of these systems may no longer work because of the lack of
* 'far' support; see above.)
*/
# if (defined(__TURBOC__) && !defined(__FLAT__)) ||\
(defined(_MSC_VER) && defined(MAXSEG_64K))
# define PNG_SMALL_SIZE_T
# endif
#endif
/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no
* smaller than png_uint_32. Casts from png_size_t or png_uint_32 to
* png_alloc_size_t are not necessary; in fact, it is recommended not to use
* them at all so that the compiler can complain when something turns out to be
* problematic.
*
* Casts in the other direction (from png_alloc_size_t to png_size_t or
* png_uint_32) should be explicitly applied; however, we do not expect to
* encounter practical situations that require such conversions.
*
* PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than
* 4294967295 - i.e. less than the maximum value of png_uint_32.
*/
#ifdef PNG_SMALL_SIZE_T
typedef png_uint_32 png_alloc_size_t;
#else
typedef png_size_t png_alloc_size_t;
#endif
/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler
* implementations of Intel CPU specific support of user-mode segmented address
* spaces, where 16-bit pointers address more than 65536 bytes of memory using
* separate 'segment' registers. The implementation requires two different
* types of pointer (only one of which includes the segment value.)
*
* If required this support is available in version 1.2 of libpng and may be
* available in versions through 1.5, although the correctness of the code has
* not been verified recently.
*/
/* Typedef for floating-point numbers that are converted to fixed-point with a
* multiple of 100,000, e.g., gamma
*/
typedef png_int_32 png_fixed_point;
/* Add typedefs for pointers */
typedef void * png_voidp;
typedef const void * png_const_voidp;
typedef png_byte * png_bytep;
typedef const png_byte * png_const_bytep;
typedef png_uint_32 * png_uint_32p;
typedef const png_uint_32 * png_const_uint_32p;
typedef png_int_32 * png_int_32p;
typedef const png_int_32 * png_const_int_32p;
typedef png_uint_16 * png_uint_16p;
typedef const png_uint_16 * png_const_uint_16p;
typedef png_int_16 * png_int_16p;
typedef const png_int_16 * png_const_int_16p;
typedef char * png_charp;
typedef const char * png_const_charp;
typedef png_fixed_point * png_fixed_point_p;
typedef const png_fixed_point * png_const_fixed_point_p;
typedef png_size_t * png_size_tp;
typedef const png_size_t * png_const_size_tp;
#ifdef PNG_STDIO_SUPPORTED
typedef FILE * png_FILE_p;
#endif
#ifdef PNG_FLOATING_POINT_SUPPORTED
typedef double * png_doublep;
typedef const double * png_const_doublep;
#endif
/* Pointers to pointers; i.e. arrays */
typedef png_byte * * png_bytepp;
typedef png_uint_32 * * png_uint_32pp;
typedef png_int_32 * * png_int_32pp;
typedef png_uint_16 * * png_uint_16pp;
typedef png_int_16 * * png_int_16pp;
typedef const char * * png_const_charpp;
typedef char * * png_charpp;
typedef png_fixed_point * * png_fixed_point_pp;
#ifdef PNG_FLOATING_POINT_SUPPORTED
typedef double * * png_doublepp;
#endif
/* Pointers to pointers to pointers; i.e., pointer to array */
typedef char * * * png_charppp;
#endif /* PNG_BUILDING_SYMBOL_TABLE */
#endif /* PNGCONF_H */
| 22,364
|
C++
|
.h
| 560
| 38.003571
| 80
| 0.705063
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
28,153
|
pngdebug.h
|
openMVG_openMVG/src/third_party/png/pngdebug.h
|
/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c
*
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Last changed in libpng 1.5.0 [January 6, 2011]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* Define PNG_DEBUG at compile time for debugging information. Higher
* numbers for PNG_DEBUG mean more debugging information. This has
* only been added since version 0.95 so it is not implemented throughout
* libpng yet, but more support will be added as needed.
*
* png_debug[1-2]?(level, message ,arg{0-2})
* Expands to a statement (either a simple expression or a compound
* do..while(0) statement) that outputs a message with parameter
* substitution if PNG_DEBUG is defined to 2 or more. If PNG_DEBUG
* is undefined, 0 or 1 every png_debug expands to a simple expression
* (actually ((void)0)).
*
* level: level of detail of message, starting at 0. A level 'n'
* message is preceded by 'n' tab characters (not implemented
* on Microsoft compilers unless PNG_DEBUG_FILE is also
* defined, to allow debug DLL compilation with no standard IO).
* message: a printf(3) style text string. A trailing '\n' is added
* to the message.
* arg: 0 to 2 arguments for printf(3) style substitution in message.
*/
#ifndef PNGDEBUG_H
#define PNGDEBUG_H
/* These settings control the formatting of messages in png.c and pngerror.c */
/* Moved to pngdebug.h at 1.5.0 */
# ifndef PNG_LITERAL_SHARP
# define PNG_LITERAL_SHARP 0x23
# endif
# ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET
# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b
# endif
# ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET
# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d
# endif
# ifndef PNG_STRING_NEWLINE
# define PNG_STRING_NEWLINE "\n"
# endif
#ifdef PNG_DEBUG
# if (PNG_DEBUG > 0)
# if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER)
# include <crtdbg.h>
# if (PNG_DEBUG > 1)
# ifndef _DEBUG
# define _DEBUG
# endif
# ifndef png_debug
# define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
_RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2)
# endif
# endif
# else /* PNG_DEBUG_FILE || !_MSC_VER */
# ifndef PNG_STDIO_SUPPORTED
# include <stdio.h> /* not included yet */
# endif
# ifndef PNG_DEBUG_FILE
# define PNG_DEBUG_FILE stderr
# endif /* PNG_DEBUG_FILE */
# if (PNG_DEBUG > 1)
/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on
* non-ISO compilers
*/
# ifdef __STDC__
# ifndef png_debug
# define png_debug(l,m) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
} while (0)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
} while (0)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
} while (0)
# endif
# else /* __STDC __ */
# ifndef png_debug
# define png_debug(l,m) \
do { \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format); \
} while (0)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) \
do { \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format,p1); \
} while (0)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
do { \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format,p1,p2); \
} while (0)
# endif
# endif /* __STDC __ */
# endif /* (PNG_DEBUG > 1) */
# endif /* _MSC_VER */
# endif /* (PNG_DEBUG > 0) */
#endif /* PNG_DEBUG */
#ifndef png_debug
# define png_debug(l, m) ((void)0)
#endif
#ifndef png_debug1
# define png_debug1(l, m, p1) ((void)0)
#endif
#ifndef png_debug2
# define png_debug2(l, m, p1, p2) ((void)0)
#endif
#endif /* PNGDEBUG_H */
| 5,403
|
C++
|
.h
| 152
| 32.302632
| 79
| 0.582348
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,155
|
tiffvers.h
|
openMVG_openMVG/src/third_party/tiff/tiffvers.h
|
#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.3\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
/*
* This define can be used in code that requires
* compilation-related definitions specific to a
* version or versions of the library. Runtime
* version checking should be done based on the
* string returned by TIFFGetVersion.
*/
#define TIFFLIB_VERSION 20120922
| 410
|
C++
|
.h
| 9
| 43.888889
| 137
| 0.783042
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
28,156
|
tif_fax3.h
|
openMVG_openMVG/src/third_party/tiff/tif_fax3.h
|
/* $Id: tif_fax3.h,v 1.9 2011-03-10 20:23:07 fwarmerdam Exp $ */
/*
* Copyright (c) 1990-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#ifndef _FAX3_
#define _FAX3_
/*
* TIFF Library.
*
* CCITT Group 3 (T.4) and Group 4 (T.6) Decompression Support.
*
* Decoder support is derived, with permission, from the code
* in Frank Cringle's viewfax program;
* Copyright (C) 1990, 1995 Frank D. Cringle.
*/
#include "tiff.h"
/*
* To override the default routine used to image decoded
* spans one can use the pseduo tag TIFFTAG_FAXFILLFUNC.
* The routine must have the type signature given below;
* for example:
*
* fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
*
* where buf is place to set the bits, runs is the array of b&w run
* lengths (white then black), erun is the last run in the array, and
* lastx is the width of the row in pixels. Fill routines can assume
* the run array has room for at least lastx runs and can overwrite
* data in the run array as needed (e.g. to append zero runs to bring
* the count up to a nice multiple).
*/
typedef void (*TIFFFaxFillFunc)(unsigned char*, uint32*, uint32*, uint32);
/*
* The default run filler; made external for other decoders.
*/
#if defined(__cplusplus)
extern "C" {
#endif
extern void _TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32);
#if defined(__cplusplus)
}
#endif
/* finite state machine codes */
#define S_Null 0
#define S_Pass 1
#define S_Horiz 2
#define S_V0 3
#define S_VR 4
#define S_VL 5
#define S_Ext 6
#define S_TermW 7
#define S_TermB 8
#define S_MakeUpW 9
#define S_MakeUpB 10
#define S_MakeUp 11
#define S_EOL 12
typedef struct { /* state table entry */
unsigned char State; /* see above */
unsigned char Width; /* width of code in bits */
uint32 Param; /* unsigned 32-bit run length in bits */
} TIFFFaxTabEnt;
extern const TIFFFaxTabEnt TIFFFaxMainTable[];
extern const TIFFFaxTabEnt TIFFFaxWhiteTable[];
extern const TIFFFaxTabEnt TIFFFaxBlackTable[];
/*
* The following macros define the majority of the G3/G4 decoder
* algorithm using the state tables defined elsewhere. To build
* a decoder you need some setup code and some glue code. Note
* that you may also need/want to change the way the NeedBits*
* macros get input data if, for example, you know the data to be
* decoded is properly aligned and oriented (doing so before running
* the decoder can be a big performance win).
*
* Consult the decoder in the TIFF library for an idea of what you
* need to define and setup to make use of these definitions.
*
* NB: to enable a debugging version of these macros define FAX3_DEBUG
* before including this file. Trace output goes to stdout.
*/
#ifndef EndOfData
#define EndOfData() (cp >= ep)
#endif
/*
* Need <=8 or <=16 bits of input data. Unlike viewfax we
* cannot use/assume a word-aligned, properly bit swizzled
* input data set because data may come from an arbitrarily
* aligned, read-only source such as a memory-mapped file.
* Note also that the viewfax decoder does not check for
* running off the end of the input data buffer. This is
* possible for G3-encoded data because it prescans the input
* data to count EOL markers, but can cause problems for G4
* data. In any event, we don't prescan and must watch for
* running out of data since we can't permit the library to
* scan past the end of the input data buffer.
*
* Finally, note that we must handle remaindered data at the end
* of a strip specially. The coder asks for a fixed number of
* bits when scanning for the next code. This may be more bits
* than are actually present in the data stream. If we appear
* to run out of data but still have some number of valid bits
* remaining then we makeup the requested amount with zeros and
* return successfully. If the returned data is incorrect then
* we should be called again and get a premature EOF error;
* otherwise we should get the right answer.
*/
#ifndef NeedBits8
#define NeedBits8(n,eoflab) do { \
if (BitsAvail < (n)) { \
if (EndOfData()) { \
if (BitsAvail == 0) /* no valid bits */ \
goto eoflab; \
BitsAvail = (n); /* pad with zeros */ \
} else { \
BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail; \
BitsAvail += 8; \
} \
} \
} while (0)
#endif
#ifndef NeedBits16
#define NeedBits16(n,eoflab) do { \
if (BitsAvail < (n)) { \
if (EndOfData()) { \
if (BitsAvail == 0) /* no valid bits */ \
goto eoflab; \
BitsAvail = (n); /* pad with zeros */ \
} else { \
BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail; \
if ((BitsAvail += 8) < (n)) { \
if (EndOfData()) { \
/* NB: we know BitsAvail is non-zero here */ \
BitsAvail = (n); /* pad with zeros */ \
} else { \
BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail; \
BitsAvail += 8; \
} \
} \
} \
} \
} while (0)
#endif
#define GetBits(n) (BitAcc & ((1<<(n))-1))
#define ClrBits(n) do { \
BitsAvail -= (n); \
BitAcc >>= (n); \
} while (0)
#ifdef FAX3_DEBUG
static const char* StateNames[] = {
"Null ",
"Pass ",
"Horiz ",
"V0 ",
"VR ",
"VL ",
"Ext ",
"TermW ",
"TermB ",
"MakeUpW",
"MakeUpB",
"MakeUp ",
"EOL ",
};
#define DEBUG_SHOW putchar(BitAcc & (1 << t) ? '1' : '0')
#define LOOKUP8(wid,tab,eoflab) do { \
int t; \
NeedBits8(wid,eoflab); \
TabEnt = tab + GetBits(wid); \
printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail, \
StateNames[TabEnt->State], TabEnt->Param); \
for (t = 0; t < TabEnt->Width; t++) \
DEBUG_SHOW; \
putchar('\n'); \
fflush(stdout); \
ClrBits(TabEnt->Width); \
} while (0)
#define LOOKUP16(wid,tab,eoflab) do { \
int t; \
NeedBits16(wid,eoflab); \
TabEnt = tab + GetBits(wid); \
printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail, \
StateNames[TabEnt->State], TabEnt->Param); \
for (t = 0; t < TabEnt->Width; t++) \
DEBUG_SHOW; \
putchar('\n'); \
fflush(stdout); \
ClrBits(TabEnt->Width); \
} while (0)
#define SETVALUE(x) do { \
*pa++ = RunLength + (x); \
printf("SETVALUE: %d\t%d\n", RunLength + (x), a0); \
a0 += x; \
RunLength = 0; \
} while (0)
#else
#define LOOKUP8(wid,tab,eoflab) do { \
NeedBits8(wid,eoflab); \
TabEnt = tab + GetBits(wid); \
ClrBits(TabEnt->Width); \
} while (0)
#define LOOKUP16(wid,tab,eoflab) do { \
NeedBits16(wid,eoflab); \
TabEnt = tab + GetBits(wid); \
ClrBits(TabEnt->Width); \
} while (0)
/*
* Append a run to the run length array for the
* current row and reset decoding state.
*/
#define SETVALUE(x) do { \
*pa++ = RunLength + (x); \
a0 += (x); \
RunLength = 0; \
} while (0)
#endif
/*
* Synchronize input decoding at the start of each
* row by scanning for an EOL (if appropriate) and
* skipping any trash data that might be present
* after a decoding error. Note that the decoding
* done elsewhere that recognizes an EOL only consumes
* 11 consecutive zero bits. This means that if EOLcnt
* is non-zero then we still need to scan for the final flag
* bit that is part of the EOL code.
*/
#define SYNC_EOL(eoflab) do { \
if (EOLcnt == 0) { \
for (;;) { \
NeedBits16(11,eoflab); \
if (GetBits(11) == 0) \
break; \
ClrBits(1); \
} \
} \
for (;;) { \
NeedBits8(8,eoflab); \
if (GetBits(8)) \
break; \
ClrBits(8); \
} \
while (GetBits(1) == 0) \
ClrBits(1); \
ClrBits(1); /* EOL bit */ \
EOLcnt = 0; /* reset EOL counter/flag */ \
} while (0)
/*
* Cleanup the array of runs after decoding a row.
* We adjust final runs to insure the user buffer is not
* overwritten and/or undecoded area is white filled.
*/
#define CLEANUP_RUNS() do { \
if (RunLength) \
SETVALUE(0); \
if (a0 != lastx) { \
badlength(a0, lastx); \
while (a0 > lastx && pa > thisrun) \
a0 -= *--pa; \
if (a0 < lastx) { \
if (a0 < 0) \
a0 = 0; \
if ((pa-thisrun)&1) \
SETVALUE(0); \
SETVALUE(lastx - a0); \
} else if (a0 > lastx) { \
SETVALUE(lastx); \
SETVALUE(0); \
} \
} \
} while (0)
/*
* Decode a line of 1D-encoded data.
*
* The line expanders are written as macros so that they can be reused
* but still have direct access to the local variables of the "calling"
* function.
*
* Note that unlike the original version we have to explicitly test for
* a0 >= lastx after each black/white run is decoded. This is because
* the original code depended on the input data being zero-padded to
* insure the decoder recognized an EOL before running out of data.
*/
#define EXPAND1D(eoflab) do { \
for (;;) { \
for (;;) { \
LOOKUP16(12, TIFFFaxWhiteTable, eof1d); \
switch (TabEnt->State) { \
case S_EOL: \
EOLcnt = 1; \
goto done1d; \
case S_TermW: \
SETVALUE(TabEnt->Param); \
goto doneWhite1d; \
case S_MakeUpW: \
case S_MakeUp: \
a0 += TabEnt->Param; \
RunLength += TabEnt->Param; \
break; \
default: \
unexpected("WhiteTable", a0); \
goto done1d; \
} \
} \
doneWhite1d: \
if (a0 >= lastx) \
goto done1d; \
for (;;) { \
LOOKUP16(13, TIFFFaxBlackTable, eof1d); \
switch (TabEnt->State) { \
case S_EOL: \
EOLcnt = 1; \
goto done1d; \
case S_TermB: \
SETVALUE(TabEnt->Param); \
goto doneBlack1d; \
case S_MakeUpB: \
case S_MakeUp: \
a0 += TabEnt->Param; \
RunLength += TabEnt->Param; \
break; \
default: \
unexpected("BlackTable", a0); \
goto done1d; \
} \
} \
doneBlack1d: \
if (a0 >= lastx) \
goto done1d; \
if( *(pa-1) == 0 && *(pa-2) == 0 ) \
pa -= 2; \
} \
eof1d: \
prematureEOF(a0); \
CLEANUP_RUNS(); \
goto eoflab; \
done1d: \
CLEANUP_RUNS(); \
} while (0)
/*
* Update the value of b1 using the array
* of runs for the reference line.
*/
#define CHECK_b1 do { \
if (pa != thisrun) while (b1 <= a0 && b1 < lastx) { \
b1 += pb[0] + pb[1]; \
pb += 2; \
} \
} while (0)
/*
* Expand a row of 2D-encoded data.
*/
#define EXPAND2D(eoflab) do { \
while (a0 < lastx) { \
LOOKUP8(7, TIFFFaxMainTable, eof2d); \
switch (TabEnt->State) { \
case S_Pass: \
CHECK_b1; \
b1 += *pb++; \
RunLength += b1 - a0; \
a0 = b1; \
b1 += *pb++; \
break; \
case S_Horiz: \
if ((pa-thisrun)&1) { \
for (;;) { /* black first */ \
LOOKUP16(13, TIFFFaxBlackTable, eof2d); \
switch (TabEnt->State) { \
case S_TermB: \
SETVALUE(TabEnt->Param); \
goto doneWhite2da; \
case S_MakeUpB: \
case S_MakeUp: \
a0 += TabEnt->Param; \
RunLength += TabEnt->Param; \
break; \
default: \
goto badBlack2d; \
} \
} \
doneWhite2da:; \
for (;;) { /* then white */ \
LOOKUP16(12, TIFFFaxWhiteTable, eof2d); \
switch (TabEnt->State) { \
case S_TermW: \
SETVALUE(TabEnt->Param); \
goto doneBlack2da; \
case S_MakeUpW: \
case S_MakeUp: \
a0 += TabEnt->Param; \
RunLength += TabEnt->Param; \
break; \
default: \
goto badWhite2d; \
} \
} \
doneBlack2da:; \
} else { \
for (;;) { /* white first */ \
LOOKUP16(12, TIFFFaxWhiteTable, eof2d); \
switch (TabEnt->State) { \
case S_TermW: \
SETVALUE(TabEnt->Param); \
goto doneWhite2db; \
case S_MakeUpW: \
case S_MakeUp: \
a0 += TabEnt->Param; \
RunLength += TabEnt->Param; \
break; \
default: \
goto badWhite2d; \
} \
} \
doneWhite2db:; \
for (;;) { /* then black */ \
LOOKUP16(13, TIFFFaxBlackTable, eof2d); \
switch (TabEnt->State) { \
case S_TermB: \
SETVALUE(TabEnt->Param); \
goto doneBlack2db; \
case S_MakeUpB: \
case S_MakeUp: \
a0 += TabEnt->Param; \
RunLength += TabEnt->Param; \
break; \
default: \
goto badBlack2d; \
} \
} \
doneBlack2db:; \
} \
CHECK_b1; \
break; \
case S_V0: \
CHECK_b1; \
SETVALUE(b1 - a0); \
b1 += *pb++; \
break; \
case S_VR: \
CHECK_b1; \
SETVALUE(b1 - a0 + TabEnt->Param); \
b1 += *pb++; \
break; \
case S_VL: \
CHECK_b1; \
if (b1 <= (int) (a0 + TabEnt->Param)) { \
if (b1 < (int) (a0 + TabEnt->Param) || pa != thisrun) { \
unexpected("VL", a0); \
goto eol2d; \
} \
} \
SETVALUE(b1 - a0 - TabEnt->Param); \
b1 -= *--pb; \
break; \
case S_Ext: \
*pa++ = lastx - a0; \
extension(a0); \
goto eol2d; \
case S_EOL: \
*pa++ = lastx - a0; \
NeedBits8(4,eof2d); \
if (GetBits(4)) \
unexpected("EOL", a0); \
ClrBits(4); \
EOLcnt = 1; \
goto eol2d; \
default: \
badMain2d: \
unexpected("MainTable", a0); \
goto eol2d; \
badBlack2d: \
unexpected("BlackTable", a0); \
goto eol2d; \
badWhite2d: \
unexpected("WhiteTable", a0); \
goto eol2d; \
eof2d: \
prematureEOF(a0); \
CLEANUP_RUNS(); \
goto eoflab; \
} \
} \
if (RunLength) { \
if (RunLength + a0 < lastx) { \
/* expect a final V0 */ \
NeedBits8(1,eof2d); \
if (!GetBits(1)) \
goto badMain2d; \
ClrBits(1); \
} \
SETVALUE(0); \
} \
eol2d: \
CLEANUP_RUNS(); \
} while (0)
#endif /* _FAX3_ */
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
| 16,183
|
C++
|
.h
| 520
| 27.592308
| 78
| 0.556983
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| true
| false
| false
| false
| false
| false
| false
|
28,157
|
tiff.h
|
openMVG_openMVG/src/third_party/tiff/tiff.h
|
/* $Id: tiff.h,v 1.68 2012-08-19 16:56:35 bfriesen Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#ifndef _TIFF_
#define _TIFF_
#include "tif_config.h"
/*
* Tag Image File Format (TIFF)
*
* Based on Rev 6.0 from:
* Developer's Desk
* Aldus Corporation
* 411 First Ave. South
* Suite 200
* Seattle, WA 98104
* 206-622-5500
*
* (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf)
*
* For BigTIFF design notes see the following links
* http://www.remotesensing.org/libtiff/bigtiffdesign.html
* http://www.awaresystems.be/imaging/tiff/bigtiff.html
*/
#define TIFF_VERSION_CLASSIC 42
#define TIFF_VERSION_BIG 43
#define TIFF_BIGENDIAN 0x4d4d
#define TIFF_LITTLEENDIAN 0x4949
#define MDI_LITTLEENDIAN 0x5045
#define MDI_BIGENDIAN 0x4550
/*
* Intrinsic data types required by the file format:
*
* 8-bit quantities int8/uint8
* 16-bit quantities int16/uint16
* 32-bit quantities int32/uint32
* 64-bit quantities int64/uint64
* strings unsigned char*
*/
typedef TIFF_INT8_T int8;
typedef TIFF_UINT8_T uint8;
typedef TIFF_INT16_T int16;
typedef TIFF_UINT16_T uint16;
typedef TIFF_INT32_T int32;
typedef TIFF_UINT32_T uint32;
typedef TIFF_INT64_T int64;
typedef TIFF_UINT64_T uint64;
/*
* Some types as promoted in a variable argument list
* We use uint16_vap rather then directly using int, because this way
* we document the type we actually want to pass through, conceptually,
* rather then confusing the issue by merely stating the type it gets
* promoted to
*/
typedef int uint16_vap;
/*
* TIFF header.
*/
typedef struct {
uint16 tiff_magic; /* magic number (defines byte order) */
uint16 tiff_version; /* TIFF version number */
} TIFFHeaderCommon;
typedef struct {
uint16 tiff_magic; /* magic number (defines byte order) */
uint16 tiff_version; /* TIFF version number */
uint32 tiff_diroff; /* byte offset to first directory */
} TIFFHeaderClassic;
typedef struct {
uint16 tiff_magic; /* magic number (defines byte order) */
uint16 tiff_version; /* TIFF version number */
uint16 tiff_offsetsize; /* size of offsets, should be 8 */
uint16 tiff_unused; /* unused word, should be 0 */
uint64 tiff_diroff; /* byte offset to first directory */
} TIFFHeaderBig;
/*
* NB: In the comments below,
* - items marked with a + are obsoleted by revision 5.0,
* - items marked with a ! are introduced in revision 6.0.
* - items marked with a % are introduced post revision 6.0.
* - items marked with a $ are obsoleted by revision 6.0.
* - items marked with a & are introduced by Adobe DNG specification.
*/
/*
* Tag data type information.
*
* Note: RATIONALs are the ratio of two 32-bit integer values.
*/
typedef enum {
TIFF_NOTYPE = 0, /* placeholder */
TIFF_BYTE = 1, /* 8-bit unsigned integer */
TIFF_ASCII = 2, /* 8-bit bytes w/ last byte null */
TIFF_SHORT = 3, /* 16-bit unsigned integer */
TIFF_LONG = 4, /* 32-bit unsigned integer */
TIFF_RATIONAL = 5, /* 64-bit unsigned fraction */
TIFF_SBYTE = 6, /* !8-bit signed integer */
TIFF_UNDEFINED = 7, /* !8-bit untyped data */
TIFF_SSHORT = 8, /* !16-bit signed integer */
TIFF_SLONG = 9, /* !32-bit signed integer */
TIFF_SRATIONAL = 10, /* !64-bit signed fraction */
TIFF_FLOAT = 11, /* !32-bit IEEE floating point */
TIFF_DOUBLE = 12, /* !64-bit IEEE floating point */
TIFF_IFD = 13, /* %32-bit unsigned integer (offset) */
TIFF_LONG8 = 16, /* BigTIFF 64-bit unsigned integer */
TIFF_SLONG8 = 17, /* BigTIFF 64-bit signed integer */
TIFF_IFD8 = 18 /* BigTIFF 64-bit unsigned integer (offset) */
} TIFFDataType;
/*
* TIFF Tag Definitions.
*/
#define TIFFTAG_SUBFILETYPE 254 /* subfile data descriptor */
#define FILETYPE_REDUCEDIMAGE 0x1 /* reduced resolution version */
#define FILETYPE_PAGE 0x2 /* one page of many */
#define FILETYPE_MASK 0x4 /* transparency mask */
#define TIFFTAG_OSUBFILETYPE 255 /* +kind of data in subfile */
#define OFILETYPE_IMAGE 1 /* full resolution image data */
#define OFILETYPE_REDUCEDIMAGE 2 /* reduced size image data */
#define OFILETYPE_PAGE 3 /* one page of many */
#define TIFFTAG_IMAGEWIDTH 256 /* image width in pixels */
#define TIFFTAG_IMAGELENGTH 257 /* image height in pixels */
#define TIFFTAG_BITSPERSAMPLE 258 /* bits per channel (sample) */
#define TIFFTAG_COMPRESSION 259 /* data compression technique */
#define COMPRESSION_NONE 1 /* dump mode */
#define COMPRESSION_CCITTRLE 2 /* CCITT modified Huffman RLE */
#define COMPRESSION_CCITTFAX3 3 /* CCITT Group 3 fax encoding */
#define COMPRESSION_CCITT_T4 3 /* CCITT T.4 (TIFF 6 name) */
#define COMPRESSION_CCITTFAX4 4 /* CCITT Group 4 fax encoding */
#define COMPRESSION_CCITT_T6 4 /* CCITT T.6 (TIFF 6 name) */
#define COMPRESSION_LZW 5 /* Lempel-Ziv & Welch */
#define COMPRESSION_OJPEG 6 /* !6.0 JPEG */
#define COMPRESSION_JPEG 7 /* %JPEG DCT compression */
#define COMPRESSION_T85 9 /* !TIFF/FX T.85 JBIG compression */
#define COMPRESSION_T43 10 /* !TIFF/FX T.43 colour by layered JBIG compression */
#define COMPRESSION_NEXT 32766 /* NeXT 2-bit RLE */
#define COMPRESSION_CCITTRLEW 32771 /* #1 w/ word alignment */
#define COMPRESSION_PACKBITS 32773 /* Macintosh RLE */
#define COMPRESSION_THUNDERSCAN 32809 /* ThunderScan RLE */
/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */
#define COMPRESSION_IT8CTPAD 32895 /* IT8 CT w/padding */
#define COMPRESSION_IT8LW 32896 /* IT8 Linework RLE */
#define COMPRESSION_IT8MP 32897 /* IT8 Monochrome picture */
#define COMPRESSION_IT8BL 32898 /* IT8 Binary line art */
/* compression codes 32908-32911 are reserved for Pixar */
#define COMPRESSION_PIXARFILM 32908 /* Pixar companded 10bit LZW */
#define COMPRESSION_PIXARLOG 32909 /* Pixar companded 11bit ZIP */
#define COMPRESSION_DEFLATE 32946 /* Deflate compression */
#define COMPRESSION_ADOBE_DEFLATE 8 /* Deflate compression,
as recognized by Adobe */
/* compression code 32947 is reserved for Oceana Matrix <dev@oceana.com> */
#define COMPRESSION_DCS 32947 /* Kodak DCS encoding */
#define COMPRESSION_JBIG 34661 /* ISO JBIG */
#define COMPRESSION_SGILOG 34676 /* SGI Log Luminance RLE */
#define COMPRESSION_SGILOG24 34677 /* SGI Log 24-bit packed */
#define COMPRESSION_JP2000 34712 /* Leadtools JPEG2000 */
#define COMPRESSION_LZMA 34925 /* LZMA2 */
#define TIFFTAG_PHOTOMETRIC 262 /* photometric interpretation */
#define PHOTOMETRIC_MINISWHITE 0 /* min value is white */
#define PHOTOMETRIC_MINISBLACK 1 /* min value is black */
#define PHOTOMETRIC_RGB 2 /* RGB color model */
#define PHOTOMETRIC_PALETTE 3 /* color map indexed */
#define PHOTOMETRIC_MASK 4 /* $holdout mask */
#define PHOTOMETRIC_SEPARATED 5 /* !color separations */
#define PHOTOMETRIC_YCBCR 6 /* !CCIR 601 */
#define PHOTOMETRIC_CIELAB 8 /* !1976 CIE L*a*b* */
#define PHOTOMETRIC_ICCLAB 9 /* ICC L*a*b* [Adobe TIFF Technote 4] */
#define PHOTOMETRIC_ITULAB 10 /* ITU L*a*b* */
#define PHOTOMETRIC_LOGL 32844 /* CIE Log2(L) */
#define PHOTOMETRIC_LOGLUV 32845 /* CIE Log2(L) (u',v') */
#define TIFFTAG_THRESHHOLDING 263 /* +thresholding used on data */
#define THRESHHOLD_BILEVEL 1 /* b&w art scan */
#define THRESHHOLD_HALFTONE 2 /* or dithered scan */
#define THRESHHOLD_ERRORDIFFUSE 3 /* usually floyd-steinberg */
#define TIFFTAG_CELLWIDTH 264 /* +dithering matrix width */
#define TIFFTAG_CELLLENGTH 265 /* +dithering matrix height */
#define TIFFTAG_FILLORDER 266 /* data order within a byte */
#define FILLORDER_MSB2LSB 1 /* most significant -> least */
#define FILLORDER_LSB2MSB 2 /* least significant -> most */
#define TIFFTAG_DOCUMENTNAME 269 /* name of doc. image is from */
#define TIFFTAG_IMAGEDESCRIPTION 270 /* info about image */
#define TIFFTAG_MAKE 271 /* scanner manufacturer name */
#define TIFFTAG_MODEL 272 /* scanner model name/number */
#define TIFFTAG_STRIPOFFSETS 273 /* offsets to data strips */
#define TIFFTAG_ORIENTATION 274 /* +image orientation */
#define ORIENTATION_TOPLEFT 1 /* row 0 top, col 0 lhs */
#define ORIENTATION_TOPRIGHT 2 /* row 0 top, col 0 rhs */
#define ORIENTATION_BOTRIGHT 3 /* row 0 bottom, col 0 rhs */
#define ORIENTATION_BOTLEFT 4 /* row 0 bottom, col 0 lhs */
#define ORIENTATION_LEFTTOP 5 /* row 0 lhs, col 0 top */
#define ORIENTATION_RIGHTTOP 6 /* row 0 rhs, col 0 top */
#define ORIENTATION_RIGHTBOT 7 /* row 0 rhs, col 0 bottom */
#define ORIENTATION_LEFTBOT 8 /* row 0 lhs, col 0 bottom */
#define TIFFTAG_SAMPLESPERPIXEL 277 /* samples per pixel */
#define TIFFTAG_ROWSPERSTRIP 278 /* rows per strip of data */
#define TIFFTAG_STRIPBYTECOUNTS 279 /* bytes counts for strips */
#define TIFFTAG_MINSAMPLEVALUE 280 /* +minimum sample value */
#define TIFFTAG_MAXSAMPLEVALUE 281 /* +maximum sample value */
#define TIFFTAG_XRESOLUTION 282 /* pixels/resolution in x */
#define TIFFTAG_YRESOLUTION 283 /* pixels/resolution in y */
#define TIFFTAG_PLANARCONFIG 284 /* storage organization */
#define PLANARCONFIG_CONTIG 1 /* single image plane */
#define PLANARCONFIG_SEPARATE 2 /* separate planes of data */
#define TIFFTAG_PAGENAME 285 /* page name image is from */
#define TIFFTAG_XPOSITION 286 /* x page offset of image lhs */
#define TIFFTAG_YPOSITION 287 /* y page offset of image lhs */
#define TIFFTAG_FREEOFFSETS 288 /* +byte offset to free block */
#define TIFFTAG_FREEBYTECOUNTS 289 /* +sizes of free blocks */
#define TIFFTAG_GRAYRESPONSEUNIT 290 /* $gray scale curve accuracy */
#define GRAYRESPONSEUNIT_10S 1 /* tenths of a unit */
#define GRAYRESPONSEUNIT_100S 2 /* hundredths of a unit */
#define GRAYRESPONSEUNIT_1000S 3 /* thousandths of a unit */
#define GRAYRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */
#define GRAYRESPONSEUNIT_100000S 5 /* hundred-thousandths */
#define TIFFTAG_GRAYRESPONSECURVE 291 /* $gray scale response curve */
#define TIFFTAG_GROUP3OPTIONS 292 /* 32 flag bits */
#define TIFFTAG_T4OPTIONS 292 /* TIFF 6.0 proper name alias */
#define GROUP3OPT_2DENCODING 0x1 /* 2-dimensional coding */
#define GROUP3OPT_UNCOMPRESSED 0x2 /* data not compressed */
#define GROUP3OPT_FILLBITS 0x4 /* fill to byte boundary */
#define TIFFTAG_GROUP4OPTIONS 293 /* 32 flag bits */
#define TIFFTAG_T6OPTIONS 293 /* TIFF 6.0 proper name */
#define GROUP4OPT_UNCOMPRESSED 0x2 /* data not compressed */
#define TIFFTAG_RESOLUTIONUNIT 296 /* units of resolutions */
#define RESUNIT_NONE 1 /* no meaningful units */
#define RESUNIT_INCH 2 /* english */
#define RESUNIT_CENTIMETER 3 /* metric */
#define TIFFTAG_PAGENUMBER 297 /* page numbers of multi-page */
#define TIFFTAG_COLORRESPONSEUNIT 300 /* $color curve accuracy */
#define COLORRESPONSEUNIT_10S 1 /* tenths of a unit */
#define COLORRESPONSEUNIT_100S 2 /* hundredths of a unit */
#define COLORRESPONSEUNIT_1000S 3 /* thousandths of a unit */
#define COLORRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */
#define COLORRESPONSEUNIT_100000S 5 /* hundred-thousandths */
#define TIFFTAG_TRANSFERFUNCTION 301 /* !colorimetry info */
#define TIFFTAG_SOFTWARE 305 /* name & release */
#define TIFFTAG_DATETIME 306 /* creation date and time */
#define TIFFTAG_ARTIST 315 /* creator of image */
#define TIFFTAG_HOSTCOMPUTER 316 /* machine where created */
#define TIFFTAG_PREDICTOR 317 /* prediction scheme w/ LZW */
#define PREDICTOR_NONE 1 /* no prediction scheme used */
#define PREDICTOR_HORIZONTAL 2 /* horizontal differencing */
#define PREDICTOR_FLOATINGPOINT 3 /* floating point predictor */
#define TIFFTAG_WHITEPOINT 318 /* image white point */
#define TIFFTAG_PRIMARYCHROMATICITIES 319 /* !primary chromaticities */
#define TIFFTAG_COLORMAP 320 /* RGB map for pallette image */
#define TIFFTAG_HALFTONEHINTS 321 /* !highlight+shadow info */
#define TIFFTAG_TILEWIDTH 322 /* !tile width in pixels */
#define TIFFTAG_TILELENGTH 323 /* !tile height in pixels */
#define TIFFTAG_TILEOFFSETS 324 /* !offsets to data tiles */
#define TIFFTAG_TILEBYTECOUNTS 325 /* !byte counts for tiles */
#define TIFFTAG_BADFAXLINES 326 /* lines w/ wrong pixel count */
#define TIFFTAG_CLEANFAXDATA 327 /* regenerated line info */
#define CLEANFAXDATA_CLEAN 0 /* no errors detected */
#define CLEANFAXDATA_REGENERATED 1 /* receiver regenerated lines */
#define CLEANFAXDATA_UNCLEAN 2 /* uncorrected errors exist */
#define TIFFTAG_CONSECUTIVEBADFAXLINES 328 /* max consecutive bad lines */
#define TIFFTAG_SUBIFD 330 /* subimage descriptors */
#define TIFFTAG_INKSET 332 /* !inks in separated image */
#define INKSET_CMYK 1 /* !cyan-magenta-yellow-black color */
#define INKSET_MULTIINK 2 /* !multi-ink or hi-fi color */
#define TIFFTAG_INKNAMES 333 /* !ascii names of inks */
#define TIFFTAG_NUMBEROFINKS 334 /* !number of inks */
#define TIFFTAG_DOTRANGE 336 /* !0% and 100% dot codes */
#define TIFFTAG_TARGETPRINTER 337 /* !separation target */
#define TIFFTAG_EXTRASAMPLES 338 /* !info about extra samples */
#define EXTRASAMPLE_UNSPECIFIED 0 /* !unspecified data */
#define EXTRASAMPLE_ASSOCALPHA 1 /* !associated alpha data */
#define EXTRASAMPLE_UNASSALPHA 2 /* !unassociated alpha data */
#define TIFFTAG_SAMPLEFORMAT 339 /* !data sample format */
#define SAMPLEFORMAT_UINT 1 /* !unsigned integer data */
#define SAMPLEFORMAT_INT 2 /* !signed integer data */
#define SAMPLEFORMAT_IEEEFP 3 /* !IEEE floating point data */
#define SAMPLEFORMAT_VOID 4 /* !untyped data */
#define SAMPLEFORMAT_COMPLEXINT 5 /* !complex signed int */
#define SAMPLEFORMAT_COMPLEXIEEEFP 6 /* !complex ieee floating */
#define TIFFTAG_SMINSAMPLEVALUE 340 /* !variable MinSampleValue */
#define TIFFTAG_SMAXSAMPLEVALUE 341 /* !variable MaxSampleValue */
#define TIFFTAG_CLIPPATH 343 /* %ClipPath
[Adobe TIFF technote 2] */
#define TIFFTAG_XCLIPPATHUNITS 344 /* %XClipPathUnits
[Adobe TIFF technote 2] */
#define TIFFTAG_YCLIPPATHUNITS 345 /* %YClipPathUnits
[Adobe TIFF technote 2] */
#define TIFFTAG_INDEXED 346 /* %Indexed
[Adobe TIFF Technote 3] */
#define TIFFTAG_JPEGTABLES 347 /* %JPEG table stream */
#define TIFFTAG_OPIPROXY 351 /* %OPI Proxy [Adobe TIFF technote] */
/* Tags 400-435 are from the TIFF/FX spec */
#define TIFFTAG_GLOBALPARAMETERSIFD 400 /* ! */
#define TIFFTAG_PROFILETYPE 401 /* ! */
#define PROFILETYPE_UNSPECIFIED 0 /* ! */
#define PROFILETYPE_G3_FAX 1 /* ! */
#define TIFFTAG_FAXPROFILE 402 /* ! */
#define FAXPROFILE_S 1 /* !TIFF/FX FAX profile S */
#define FAXPROFILE_F 2 /* !TIFF/FX FAX profile F */
#define FAXPROFILE_J 3 /* !TIFF/FX FAX profile J */
#define FAXPROFILE_C 4 /* !TIFF/FX FAX profile C */
#define FAXPROFILE_L 5 /* !TIFF/FX FAX profile L */
#define FAXPROFILE_M 6 /* !TIFF/FX FAX profile LM */
#define TIFFTAG_CODINGMETHODS 403 /* !TIFF/FX coding methods */
#define CODINGMETHODS_T4_1D (1 << 1) /* !T.4 1D */
#define CODINGMETHODS_T4_2D (1 << 2) /* !T.4 2D */
#define CODINGMETHODS_T6 (1 << 3) /* !T.6 */
#define CODINGMETHODS_T85 (1 << 4) /* !T.85 JBIG */
#define CODINGMETHODS_T42 (1 << 5) /* !T.42 JPEG */
#define CODINGMETHODS_T43 (1 << 6) /* !T.43 colour by layered JBIG */
#define TIFFTAG_VERSIONYEAR 404 /* !TIFF/FX version year */
#define TIFFTAG_MODENUMBER 405 /* !TIFF/FX mode number */
#define TIFFTAG_DECODE 433 /* !TIFF/FX decode */
#define TIFFTAG_IMAGEBASECOLOR 434 /* !TIFF/FX image base colour */
#define TIFFTAG_T82OPTIONS 435 /* !TIFF/FX T.82 options */
/*
* Tags 512-521 are obsoleted by Technical Note #2 which specifies a
* revised JPEG-in-TIFF scheme.
*/
#define TIFFTAG_JPEGPROC 512 /* !JPEG processing algorithm */
#define JPEGPROC_BASELINE 1 /* !baseline sequential */
#define JPEGPROC_LOSSLESS 14 /* !Huffman coded lossless */
#define TIFFTAG_JPEGIFOFFSET 513 /* !pointer to SOI marker */
#define TIFFTAG_JPEGIFBYTECOUNT 514 /* !JFIF stream length */
#define TIFFTAG_JPEGRESTARTINTERVAL 515 /* !restart interval length */
#define TIFFTAG_JPEGLOSSLESSPREDICTORS 517 /* !lossless proc predictor */
#define TIFFTAG_JPEGPOINTTRANSFORM 518 /* !lossless point transform */
#define TIFFTAG_JPEGQTABLES 519 /* !Q matrice offsets */
#define TIFFTAG_JPEGDCTABLES 520 /* !DCT table offsets */
#define TIFFTAG_JPEGACTABLES 521 /* !AC coefficient offsets */
#define TIFFTAG_YCBCRCOEFFICIENTS 529 /* !RGB -> YCbCr transform */
#define TIFFTAG_YCBCRSUBSAMPLING 530 /* !YCbCr subsampling factors */
#define TIFFTAG_YCBCRPOSITIONING 531 /* !subsample positioning */
#define YCBCRPOSITION_CENTERED 1 /* !as in PostScript Level 2 */
#define YCBCRPOSITION_COSITED 2 /* !as in CCIR 601-1 */
#define TIFFTAG_REFERENCEBLACKWHITE 532 /* !colorimetry info */
#define TIFFTAG_STRIPROWCOUNTS 559 /* !TIFF/FX strip row counts */
#define TIFFTAG_XMLPACKET 700 /* %XML packet
[Adobe XMP Specification,
January 2004 */
#define TIFFTAG_OPIIMAGEID 32781 /* %OPI ImageID
[Adobe TIFF technote] */
/* tags 32952-32956 are private tags registered to Island Graphics */
#define TIFFTAG_REFPTS 32953 /* image reference points */
#define TIFFTAG_REGIONTACKPOINT 32954 /* region-xform tack point */
#define TIFFTAG_REGIONWARPCORNERS 32955 /* warp quadrilateral */
#define TIFFTAG_REGIONAFFINE 32956 /* affine transformation mat */
/* tags 32995-32999 are private tags registered to SGI */
#define TIFFTAG_MATTEING 32995 /* $use ExtraSamples */
#define TIFFTAG_DATATYPE 32996 /* $use SampleFormat */
#define TIFFTAG_IMAGEDEPTH 32997 /* z depth of image */
#define TIFFTAG_TILEDEPTH 32998 /* z depth/data tile */
/* tags 33300-33309 are private tags registered to Pixar */
/*
* TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH
* are set when an image has been cropped out of a larger image.
* They reflect the size of the original uncropped image.
* The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used
* to determine the position of the smaller image in the larger one.
*/
#define TIFFTAG_PIXAR_IMAGEFULLWIDTH 33300 /* full image size in x */
#define TIFFTAG_PIXAR_IMAGEFULLLENGTH 33301 /* full image size in y */
/* Tags 33302-33306 are used to identify special image modes and data
* used by Pixar's texture formats.
*/
#define TIFFTAG_PIXAR_TEXTUREFORMAT 33302 /* texture map format */
#define TIFFTAG_PIXAR_WRAPMODES 33303 /* s & t wrap modes */
#define TIFFTAG_PIXAR_FOVCOT 33304 /* cotan(fov) for env. maps */
#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305
#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306
/* tag 33405 is a private tag registered to Eastman Kodak */
#define TIFFTAG_WRITERSERIALNUMBER 33405 /* device serial number */
/* tag 33432 is listed in the 6.0 spec w/ unknown ownership */
#define TIFFTAG_COPYRIGHT 33432 /* copyright string */
/* IPTC TAG from RichTIFF specifications */
#define TIFFTAG_RICHTIFFIPTC 33723
/* 34016-34029 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */
#define TIFFTAG_IT8SITE 34016 /* site name */
#define TIFFTAG_IT8COLORSEQUENCE 34017 /* color seq. [RGB,CMYK,etc] */
#define TIFFTAG_IT8HEADER 34018 /* DDES Header */
#define TIFFTAG_IT8RASTERPADDING 34019 /* raster scanline padding */
#define TIFFTAG_IT8BITSPERRUNLENGTH 34020 /* # of bits in short run */
#define TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH 34021/* # of bits in long run */
#define TIFFTAG_IT8COLORTABLE 34022 /* LW colortable */
#define TIFFTAG_IT8IMAGECOLORINDICATOR 34023 /* BP/BL image color switch */
#define TIFFTAG_IT8BKGCOLORINDICATOR 34024 /* BP/BL bg color switch */
#define TIFFTAG_IT8IMAGECOLORVALUE 34025 /* BP/BL image color value */
#define TIFFTAG_IT8BKGCOLORVALUE 34026 /* BP/BL bg color value */
#define TIFFTAG_IT8PIXELINTENSITYRANGE 34027 /* MP pixel intensity value */
#define TIFFTAG_IT8TRANSPARENCYINDICATOR 34028 /* HC transparency switch */
#define TIFFTAG_IT8COLORCHARACTERIZATION 34029 /* color character. table */
#define TIFFTAG_IT8HCUSAGE 34030 /* HC usage indicator */
#define TIFFTAG_IT8TRAPINDICATOR 34031 /* Trapping indicator
(untrapped=0, trapped=1) */
#define TIFFTAG_IT8CMYKEQUIVALENT 34032 /* CMYK color equivalents */
/* tags 34232-34236 are private tags registered to Texas Instruments */
#define TIFFTAG_FRAMECOUNT 34232 /* Sequence Frame Count */
/* tag 34377 is private tag registered to Adobe for PhotoShop */
#define TIFFTAG_PHOTOSHOP 34377
/* tags 34665, 34853 and 40965 are documented in EXIF specification */
#define TIFFTAG_EXIFIFD 34665 /* Pointer to EXIF private directory */
/* tag 34750 is a private tag registered to Adobe? */
#define TIFFTAG_ICCPROFILE 34675 /* ICC profile data */
#define TIFFTAG_IMAGELAYER 34732 /* !TIFF/FX image layer information */
/* tag 34750 is a private tag registered to Pixel Magic */
#define TIFFTAG_JBIGOPTIONS 34750 /* JBIG options */
#define TIFFTAG_GPSIFD 34853 /* Pointer to GPS private directory */
/* tags 34908-34914 are private tags registered to SGI */
#define TIFFTAG_FAXRECVPARAMS 34908 /* encoded Class 2 ses. parms */
#define TIFFTAG_FAXSUBADDRESS 34909 /* received SubAddr string */
#define TIFFTAG_FAXRECVTIME 34910 /* receive time (secs) */
#define TIFFTAG_FAXDCS 34911 /* encoded fax ses. params, Table 2/T.30 */
/* tags 37439-37443 are registered to SGI <gregl@sgi.com> */
#define TIFFTAG_STONITS 37439 /* Sample value to Nits */
/* tag 34929 is a private tag registered to FedEx */
#define TIFFTAG_FEDEX_EDR 34929 /* unknown use */
#define TIFFTAG_INTEROPERABILITYIFD 40965 /* Pointer to Interoperability private directory */
/* Adobe Digital Negative (DNG) format tags */
#define TIFFTAG_DNGVERSION 50706 /* &DNG version number */
#define TIFFTAG_DNGBACKWARDVERSION 50707 /* &DNG compatibility version */
#define TIFFTAG_UNIQUECAMERAMODEL 50708 /* &name for the camera model */
#define TIFFTAG_LOCALIZEDCAMERAMODEL 50709 /* &localized camera model
name */
#define TIFFTAG_CFAPLANECOLOR 50710 /* &CFAPattern->LinearRaw space
mapping */
#define TIFFTAG_CFALAYOUT 50711 /* &spatial layout of the CFA */
#define TIFFTAG_LINEARIZATIONTABLE 50712 /* &lookup table description */
#define TIFFTAG_BLACKLEVELREPEATDIM 50713 /* &repeat pattern size for
the BlackLevel tag */
#define TIFFTAG_BLACKLEVEL 50714 /* &zero light encoding level */
#define TIFFTAG_BLACKLEVELDELTAH 50715 /* &zero light encoding level
differences (columns) */
#define TIFFTAG_BLACKLEVELDELTAV 50716 /* &zero light encoding level
differences (rows) */
#define TIFFTAG_WHITELEVEL 50717 /* &fully saturated encoding
level */
#define TIFFTAG_DEFAULTSCALE 50718 /* &default scale factors */
#define TIFFTAG_DEFAULTCROPORIGIN 50719 /* &origin of the final image
area */
#define TIFFTAG_DEFAULTCROPSIZE 50720 /* &size of the final image
area */
#define TIFFTAG_COLORMATRIX1 50721 /* &XYZ->reference color space
transformation matrix 1 */
#define TIFFTAG_COLORMATRIX2 50722 /* &XYZ->reference color space
transformation matrix 2 */
#define TIFFTAG_CAMERACALIBRATION1 50723 /* &calibration matrix 1 */
#define TIFFTAG_CAMERACALIBRATION2 50724 /* &calibration matrix 2 */
#define TIFFTAG_REDUCTIONMATRIX1 50725 /* &dimensionality reduction
matrix 1 */
#define TIFFTAG_REDUCTIONMATRIX2 50726 /* &dimensionality reduction
matrix 2 */
#define TIFFTAG_ANALOGBALANCE 50727 /* &gain applied the stored raw
values*/
#define TIFFTAG_ASSHOTNEUTRAL 50728 /* &selected white balance in
linear reference space */
#define TIFFTAG_ASSHOTWHITEXY 50729 /* &selected white balance in
x-y chromaticity
coordinates */
#define TIFFTAG_BASELINEEXPOSURE 50730 /* &how much to move the zero
point */
#define TIFFTAG_BASELINENOISE 50731 /* &relative noise level */
#define TIFFTAG_BASELINESHARPNESS 50732 /* &relative amount of
sharpening */
#define TIFFTAG_BAYERGREENSPLIT 50733 /* &how closely the values of
the green pixels in the
blue/green rows track the
values of the green pixels
in the red/green rows */
#define TIFFTAG_LINEARRESPONSELIMIT 50734 /* &non-linear encoding range */
#define TIFFTAG_CAMERASERIALNUMBER 50735 /* &camera's serial number */
#define TIFFTAG_LENSINFO 50736 /* info about the lens */
#define TIFFTAG_CHROMABLURRADIUS 50737 /* &chroma blur radius */
#define TIFFTAG_ANTIALIASSTRENGTH 50738 /* &relative strength of the
camera's anti-alias filter */
#define TIFFTAG_SHADOWSCALE 50739 /* &used by Adobe Camera Raw */
#define TIFFTAG_DNGPRIVATEDATA 50740 /* &manufacturer's private data */
#define TIFFTAG_MAKERNOTESAFETY 50741 /* &whether the EXIF MakerNote
tag is safe to preserve
along with the rest of the
EXIF data */
#define TIFFTAG_CALIBRATIONILLUMINANT1 50778 /* &illuminant 1 */
#define TIFFTAG_CALIBRATIONILLUMINANT2 50779 /* &illuminant 2 */
#define TIFFTAG_BESTQUALITYSCALE 50780 /* &best quality multiplier */
#define TIFFTAG_RAWDATAUNIQUEID 50781 /* &unique identifier for
the raw image data */
#define TIFFTAG_ORIGINALRAWFILENAME 50827 /* &file name of the original
raw file */
#define TIFFTAG_ORIGINALRAWFILEDATA 50828 /* &contents of the original
raw file */
#define TIFFTAG_ACTIVEAREA 50829 /* &active (non-masked) pixels
of the sensor */
#define TIFFTAG_MASKEDAREAS 50830 /* &list of coordinates
of fully masked pixels */
#define TIFFTAG_ASSHOTICCPROFILE 50831 /* &these two tags used to */
#define TIFFTAG_ASSHOTPREPROFILEMATRIX 50832 /* map cameras's color space
into ICC profile space */
#define TIFFTAG_CURRENTICCPROFILE 50833 /* & */
#define TIFFTAG_CURRENTPREPROFILEMATRIX 50834 /* & */
/* tag 65535 is an undefined tag used by Eastman Kodak */
#define TIFFTAG_DCSHUESHIFTVALUES 65535 /* hue shift correction data */
/*
* The following are ``pseudo tags'' that can be used to control
* codec-specific functionality. These tags are not written to file.
* Note that these values start at 0xffff+1 so that they'll never
* collide with Aldus-assigned tags.
*
* If you want your private pseudo tags ``registered'' (i.e. added to
* this file), please post a bug report via the tracking system at
* http://www.remotesensing.org/libtiff/bugs.html with the appropriate
* C definitions to add.
*/
#define TIFFTAG_FAXMODE 65536 /* Group 3/4 format control */
#define FAXMODE_CLASSIC 0x0000 /* default, include RTC */
#define FAXMODE_NORTC 0x0001 /* no RTC at end of data */
#define FAXMODE_NOEOL 0x0002 /* no EOL code at end of row */
#define FAXMODE_BYTEALIGN 0x0004 /* byte align row */
#define FAXMODE_WORDALIGN 0x0008 /* word align row */
#define FAXMODE_CLASSF FAXMODE_NORTC /* TIFF Class F */
#define TIFFTAG_JPEGQUALITY 65537 /* Compression quality level */
/* Note: quality level is on the IJG 0-100 scale. Default value is 75 */
#define TIFFTAG_JPEGCOLORMODE 65538 /* Auto RGB<=>YCbCr convert? */
#define JPEGCOLORMODE_RAW 0x0000 /* no conversion (default) */
#define JPEGCOLORMODE_RGB 0x0001 /* do auto conversion */
#define TIFFTAG_JPEGTABLESMODE 65539 /* What to put in JPEGTables */
#define JPEGTABLESMODE_QUANT 0x0001 /* include quantization tbls */
#define JPEGTABLESMODE_HUFF 0x0002 /* include Huffman tbls */
/* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */
#define TIFFTAG_FAXFILLFUNC 65540 /* G3/G4 fill function */
#define TIFFTAG_PIXARLOGDATAFMT 65549 /* PixarLogCodec I/O data sz */
#define PIXARLOGDATAFMT_8BIT 0 /* regular u_char samples */
#define PIXARLOGDATAFMT_8BITABGR 1 /* ABGR-order u_chars */
#define PIXARLOGDATAFMT_11BITLOG 2 /* 11-bit log-encoded (raw) */
#define PIXARLOGDATAFMT_12BITPICIO 3 /* as per PICIO (1.0==2048) */
#define PIXARLOGDATAFMT_16BIT 4 /* signed short samples */
#define PIXARLOGDATAFMT_FLOAT 5 /* IEEE float samples */
/* 65550-65556 are allocated to Oceana Matrix <dev@oceana.com> */
#define TIFFTAG_DCSIMAGERTYPE 65550 /* imager model & filter */
#define DCSIMAGERMODEL_M3 0 /* M3 chip (1280 x 1024) */
#define DCSIMAGERMODEL_M5 1 /* M5 chip (1536 x 1024) */
#define DCSIMAGERMODEL_M6 2 /* M6 chip (3072 x 2048) */
#define DCSIMAGERFILTER_IR 0 /* infrared filter */
#define DCSIMAGERFILTER_MONO 1 /* monochrome filter */
#define DCSIMAGERFILTER_CFA 2 /* color filter array */
#define DCSIMAGERFILTER_OTHER 3 /* other filter */
#define TIFFTAG_DCSINTERPMODE 65551 /* interpolation mode */
#define DCSINTERPMODE_NORMAL 0x0 /* whole image, default */
#define DCSINTERPMODE_PREVIEW 0x1 /* preview of image (384x256) */
#define TIFFTAG_DCSBALANCEARRAY 65552 /* color balance values */
#define TIFFTAG_DCSCORRECTMATRIX 65553 /* color correction values */
#define TIFFTAG_DCSGAMMA 65554 /* gamma value */
#define TIFFTAG_DCSTOESHOULDERPTS 65555 /* toe & shoulder points */
#define TIFFTAG_DCSCALIBRATIONFD 65556 /* calibration file desc */
/* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */
#define TIFFTAG_ZIPQUALITY 65557 /* compression quality level */
#define TIFFTAG_PIXARLOGQUALITY 65558 /* PixarLog uses same scale */
/* 65559 is allocated to Oceana Matrix <dev@oceana.com> */
#define TIFFTAG_DCSCLIPRECTANGLE 65559 /* area of image to acquire */
#define TIFFTAG_SGILOGDATAFMT 65560 /* SGILog user data format */
#define SGILOGDATAFMT_FLOAT 0 /* IEEE float samples */
#define SGILOGDATAFMT_16BIT 1 /* 16-bit samples */
#define SGILOGDATAFMT_RAW 2 /* uninterpreted data */
#define SGILOGDATAFMT_8BIT 3 /* 8-bit RGB monitor values */
#define TIFFTAG_SGILOGENCODE 65561 /* SGILog data encoding control*/
#define SGILOGENCODE_NODITHER 0 /* do not dither encoded values*/
#define SGILOGENCODE_RANDITHER 1 /* randomly dither encd values */
#define TIFFTAG_LZMAPRESET 65562 /* LZMA2 preset (compression level) */
#define TIFFTAG_PERSAMPLE 65563 /* interface for per sample tags */
#define PERSAMPLE_MERGED 0 /* present as a single value */
#define PERSAMPLE_MULTI 1 /* present as multiple values */
/*
* EXIF tags
*/
#define EXIFTAG_EXPOSURETIME 33434 /* Exposure time */
#define EXIFTAG_FNUMBER 33437 /* F number */
#define EXIFTAG_EXPOSUREPROGRAM 34850 /* Exposure program */
#define EXIFTAG_SPECTRALSENSITIVITY 34852 /* Spectral sensitivity */
#define EXIFTAG_ISOSPEEDRATINGS 34855 /* ISO speed rating */
#define EXIFTAG_OECF 34856 /* Optoelectric conversion
factor */
#define EXIFTAG_EXIFVERSION 36864 /* Exif version */
#define EXIFTAG_DATETIMEORIGINAL 36867 /* Date and time of original
data generation */
#define EXIFTAG_DATETIMEDIGITIZED 36868 /* Date and time of digital
data generation */
#define EXIFTAG_COMPONENTSCONFIGURATION 37121 /* Meaning of each component */
#define EXIFTAG_COMPRESSEDBITSPERPIXEL 37122 /* Image compression mode */
#define EXIFTAG_SHUTTERSPEEDVALUE 37377 /* Shutter speed */
#define EXIFTAG_APERTUREVALUE 37378 /* Aperture */
#define EXIFTAG_BRIGHTNESSVALUE 37379 /* Brightness */
#define EXIFTAG_EXPOSUREBIASVALUE 37380 /* Exposure bias */
#define EXIFTAG_MAXAPERTUREVALUE 37381 /* Maximum lens aperture */
#define EXIFTAG_SUBJECTDISTANCE 37382 /* Subject distance */
#define EXIFTAG_METERINGMODE 37383 /* Metering mode */
#define EXIFTAG_LIGHTSOURCE 37384 /* Light source */
#define EXIFTAG_FLASH 37385 /* Flash */
#define EXIFTAG_FOCALLENGTH 37386 /* Lens focal length */
#define EXIFTAG_SUBJECTAREA 37396 /* Subject area */
#define EXIFTAG_MAKERNOTE 37500 /* Manufacturer notes */
#define EXIFTAG_USERCOMMENT 37510 /* User comments */
#define EXIFTAG_SUBSECTIME 37520 /* DateTime subseconds */
#define EXIFTAG_SUBSECTIMEORIGINAL 37521 /* DateTimeOriginal subseconds */
#define EXIFTAG_SUBSECTIMEDIGITIZED 37522 /* DateTimeDigitized subseconds */
#define EXIFTAG_FLASHPIXVERSION 40960 /* Supported Flashpix version */
#define EXIFTAG_COLORSPACE 40961 /* Color space information */
#define EXIFTAG_PIXELXDIMENSION 40962 /* Valid image width */
#define EXIFTAG_PIXELYDIMENSION 40963 /* Valid image height */
#define EXIFTAG_RELATEDSOUNDFILE 40964 /* Related audio file */
#define EXIFTAG_FLASHENERGY 41483 /* Flash energy */
#define EXIFTAG_SPATIALFREQUENCYRESPONSE 41484 /* Spatial frequency response */
#define EXIFTAG_FOCALPLANEXRESOLUTION 41486 /* Focal plane X resolution */
#define EXIFTAG_FOCALPLANEYRESOLUTION 41487 /* Focal plane Y resolution */
#define EXIFTAG_FOCALPLANERESOLUTIONUNIT 41488 /* Focal plane resolution unit */
#define EXIFTAG_SUBJECTLOCATION 41492 /* Subject location */
#define EXIFTAG_EXPOSUREINDEX 41493 /* Exposure index */
#define EXIFTAG_SENSINGMETHOD 41495 /* Sensing method */
#define EXIFTAG_FILESOURCE 41728 /* File source */
#define EXIFTAG_SCENETYPE 41729 /* Scene type */
#define EXIFTAG_CFAPATTERN 41730 /* CFA pattern */
#define EXIFTAG_CUSTOMRENDERED 41985 /* Custom image processing */
#define EXIFTAG_EXPOSUREMODE 41986 /* Exposure mode */
#define EXIFTAG_WHITEBALANCE 41987 /* White balance */
#define EXIFTAG_DIGITALZOOMRATIO 41988 /* Digital zoom ratio */
#define EXIFTAG_FOCALLENGTHIN35MMFILM 41989 /* Focal length in 35 mm film */
#define EXIFTAG_SCENECAPTURETYPE 41990 /* Scene capture type */
#define EXIFTAG_GAINCONTROL 41991 /* Gain control */
#define EXIFTAG_CONTRAST 41992 /* Contrast */
#define EXIFTAG_SATURATION 41993 /* Saturation */
#define EXIFTAG_SHARPNESS 41994 /* Sharpness */
#define EXIFTAG_DEVICESETTINGDESCRIPTION 41995 /* Device settings description */
#define EXIFTAG_SUBJECTDISTANCERANGE 41996 /* Subject distance range */
#define EXIFTAG_GAINCONTROL 41991 /* Gain control */
#define EXIFTAG_GAINCONTROL 41991 /* Gain control */
#define EXIFTAG_IMAGEUNIQUEID 42016 /* Unique image ID */
#endif /* _TIFF_ */
/* vim: set ts=8 sts=8 sw=8 noet: */
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
| 35,786
|
C++
|
.h
| 656
| 52.702744
| 93
| 0.721146
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| true
| false
| false
| false
| false
| false
| false
|
28,158
|
tiffio.h
|
openMVG_openMVG/src/third_party/tiff/tiffio.h
|
/* $Id: tiffio.h,v 1.91 2012-07-29 15:45:29 tgl Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#ifndef _TIFFIO_
#define _TIFFIO_
/*
* TIFF I/O Library Definitions.
*/
#include "tiff.h"
#include "tiffvers.h"
/*
* TIFF is defined as an incomplete type to hide the
* library's internal data structures from clients.
*/
typedef struct tiff TIFF;
/*
* The following typedefs define the intrinsic size of
* data types used in the *exported* interfaces. These
* definitions depend on the proper definition of types
* in tiff.h. Note also that the varargs interface used
* to pass tag types and values uses the types defined in
* tiff.h directly.
*
* NB: ttag_t is unsigned int and not unsigned short because
* ANSI C requires that the type before the ellipsis be a
* promoted type (i.e. one of int, unsigned int, pointer,
* or double) and because we defined pseudo-tags that are
* outside the range of legal Aldus-assigned tags.
* NB: tsize_t is int32 and not uint32 because some functions
* return -1.
* NB: toff_t is not off_t for many reasons; TIFFs max out at
* 32-bit file offsets, and BigTIFF maxes out at 64-bit
* offsets being the most important, and to ensure use of
* a consistently unsigned type across architectures.
* Prior to libtiff 4.0, this was an unsigned 32 bit type.
*/
/*
* this is the machine addressing size type, only it's signed, so make it
* int32 on 32bit machines, int64 on 64bit machines
*/
typedef TIFF_SSIZE_T tmsize_t;
typedef uint64 toff_t; /* file offset */
/* the following are deprecated and should be replaced by their defining
counterparts */
typedef uint32 ttag_t; /* directory tag */
typedef uint16 tdir_t; /* directory index */
typedef uint16 tsample_t; /* sample number */
typedef uint32 tstrile_t; /* strip or tile number */
typedef tstrile_t tstrip_t; /* strip number */
typedef tstrile_t ttile_t; /* tile number */
typedef tmsize_t tsize_t; /* i/o size in bytes */
typedef void* tdata_t; /* image data ref */
#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32))
#define __WIN32__
#endif
/*
* On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c
* or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c).
*
* By default tif_unix.c is assumed.
*/
#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)
# if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO)
# define AVOID_WIN32_FILEIO
# endif
#endif
#if defined(USE_WIN32_FILEIO)
# define VC_EXTRALEAN
# include <windows.h>
# ifdef __WIN32__
DECLARE_HANDLE(thandle_t); /* Win32 file handle */
# else
typedef HFILE thandle_t; /* client data handle */
# endif /* __WIN32__ */
#else
typedef void* thandle_t; /* client data handle */
#endif /* USE_WIN32_FILEIO */
/*
* Flags to pass to TIFFPrintDirectory to control
* printing of data structures that are potentially
* very large. Bit-or these flags to enable printing
* multiple items.
*/
#define TIFFPRINT_NONE 0x0 /* no extra info */
#define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */
#define TIFFPRINT_CURVES 0x2 /* color/gray response curves */
#define TIFFPRINT_COLORMAP 0x4 /* colormap */
#define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */
#define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */
#define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */
/*
* Colour conversion stuff
*/
/* reference white */
#define D65_X0 (95.0470F)
#define D65_Y0 (100.0F)
#define D65_Z0 (108.8827F)
#define D50_X0 (96.4250F)
#define D50_Y0 (100.0F)
#define D50_Z0 (82.4680F)
/* Structure for holding information about a display device. */
typedef unsigned char TIFFRGBValue; /* 8-bit samples */
typedef struct {
float d_mat[3][3]; /* XYZ -> luminance matrix */
float d_YCR; /* Light o/p for reference white */
float d_YCG;
float d_YCB;
uint32 d_Vrwr; /* Pixel values for ref. white */
uint32 d_Vrwg;
uint32 d_Vrwb;
float d_Y0R; /* Residual light for black pixel */
float d_Y0G;
float d_Y0B;
float d_gammaR; /* Gamma values for the three guns */
float d_gammaG;
float d_gammaB;
} TIFFDisplay;
typedef struct { /* YCbCr->RGB support */
TIFFRGBValue* clamptab; /* range clamping table */
int* Cr_r_tab;
int* Cb_b_tab;
int32* Cr_g_tab;
int32* Cb_g_tab;
int32* Y_tab;
} TIFFYCbCrToRGB;
typedef struct { /* CIE Lab 1976->RGB support */
int range; /* Size of conversion table */
#define CIELABTORGB_TABLE_RANGE 1500
float rstep, gstep, bstep;
float X0, Y0, Z0; /* Reference white point */
TIFFDisplay display;
float Yr2r[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yr to r */
float Yg2g[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yg to g */
float Yb2b[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yb to b */
} TIFFCIELabToRGB;
/*
* RGBA-style image support.
*/
typedef struct _TIFFRGBAImage TIFFRGBAImage;
/*
* The image reading and conversion routines invoke
* ``put routines'' to copy/image/whatever tiles of
* raw image data. A default set of routines are
* provided to convert/copy raw image data to 8-bit
* packed ABGR format rasters. Applications can supply
* alternate routines that unpack the data into a
* different format or, for example, unpack the data
* and draw the unpacked raster on the display.
*/
typedef void (*tileContigRoutine)
(TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
unsigned char*);
typedef void (*tileSeparateRoutine)
(TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
unsigned char*, unsigned char*, unsigned char*, unsigned char*);
/*
* RGBA-reader state.
*/
struct _TIFFRGBAImage {
TIFF* tif; /* image handle */
int stoponerr; /* stop on read error */
int isContig; /* data is packed/separate */
int alpha; /* type of alpha data present */
uint32 width; /* image width */
uint32 height; /* image height */
uint16 bitspersample; /* image bits/sample */
uint16 samplesperpixel; /* image samples/pixel */
uint16 orientation; /* image orientation */
uint16 req_orientation; /* requested orientation */
uint16 photometric; /* image photometric interp */
uint16* redcmap; /* colormap pallete */
uint16* greencmap;
uint16* bluecmap;
/* get image data routine */
int (*get)(TIFFRGBAImage*, uint32*, uint32, uint32);
/* put decoded strip/tile */
union {
void (*any)(TIFFRGBAImage*);
tileContigRoutine contig;
tileSeparateRoutine separate;
} put;
TIFFRGBValue* Map; /* sample mapping array */
uint32** BWmap; /* black&white map */
uint32** PALmap; /* palette image map */
TIFFYCbCrToRGB* ycbcr; /* YCbCr conversion state */
TIFFCIELabToRGB* cielab; /* CIE L*a*b conversion state */
uint8* UaToAa; /* Unassociated alpha to associated alpha convertion LUT */
uint8* Bitdepth16To8; /* LUT for conversion from 16bit to 8bit values */
int row_offset;
int col_offset;
};
/*
* Macros for extracting components from the
* packed ABGR form returned by TIFFReadRGBAImage.
*/
#define TIFFGetR(abgr) ((abgr) & 0xff)
#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)
/*
* A CODEC is a software package that implements decoding,
* encoding, or decoding+encoding of a compression algorithm.
* The library provides a collection of builtin codecs.
* More codecs may be registered through calls to the library
* and/or the builtin implementations may be overridden.
*/
typedef int (*TIFFInitMethod)(TIFF*, int);
typedef struct {
char* name;
uint16 scheme;
TIFFInitMethod init;
} TIFFCodec;
#include <stdio.h>
#include <stdarg.h>
/* share internal LogLuv conversion routines? */
#ifndef LOGLUV_PUBLIC
#define LOGLUV_PUBLIC 1
#endif
#if !defined(__GNUC__) && !defined(__attribute__)
# define __attribute__(x) /*nothing*/
#endif
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
typedef void (*TIFFErrorHandler)(const char*, const char*, va_list);
typedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list);
typedef tmsize_t (*TIFFReadWriteProc)(thandle_t, void*, tmsize_t);
typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);
typedef int (*TIFFCloseProc)(thandle_t);
typedef toff_t (*TIFFSizeProc)(thandle_t);
typedef int (*TIFFMapFileProc)(thandle_t, void** base, toff_t* size);
typedef void (*TIFFUnmapFileProc)(thandle_t, void* base, toff_t size);
typedef void (*TIFFExtendProc)(TIFF*);
extern const char* TIFFGetVersion(void);
extern const TIFFCodec* TIFFFindCODEC(uint16);
extern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);
extern void TIFFUnRegisterCODEC(TIFFCodec*);
extern int TIFFIsCODECConfigured(uint16);
extern TIFFCodec* TIFFGetConfiguredCODECs(void);
/*
* Auxiliary functions.
*/
extern void* _TIFFmalloc(tmsize_t s);
extern void* _TIFFrealloc(void* p, tmsize_t s);
extern void _TIFFmemset(void* p, int v, tmsize_t c);
extern void _TIFFmemcpy(void* d, const void* s, tmsize_t c);
extern int _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c);
extern void _TIFFfree(void* p);
/*
** Stuff, related to tag handling and creating custom tags.
*/
extern int TIFFGetTagListCount( TIFF * );
extern uint32 TIFFGetTagListEntry( TIFF *, int tag_index );
#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
#define TIFF_VARIABLE -1 /* marker for variable length tags */
#define TIFF_SPP -2 /* marker for SamplesPerPixel tags */
#define TIFF_VARIABLE2 -3 /* marker for uint32 var-length tags */
#define FIELD_CUSTOM 65
typedef struct _TIFFField TIFFField;
typedef struct _TIFFFieldArray TIFFFieldArray;
extern const TIFFField* TIFFFindField(TIFF *, uint32, TIFFDataType);
extern const TIFFField* TIFFFieldWithTag(TIFF*, uint32);
extern const TIFFField* TIFFFieldWithName(TIFF*, const char *);
extern uint32 TIFFFieldTag(const TIFFField*);
extern const char* TIFFFieldName(const TIFFField*);
extern TIFFDataType TIFFFieldDataType(const TIFFField*);
extern int TIFFFieldPassCount(const TIFFField*);
extern int TIFFFieldReadCount(const TIFFField*);
extern int TIFFFieldWriteCount(const TIFFField*);
typedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list);
typedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list);
typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);
typedef struct {
TIFFVSetMethod vsetfield; /* tag set routine */
TIFFVGetMethod vgetfield; /* tag get routine */
TIFFPrintMethod printdir; /* directory print routine */
} TIFFTagMethods;
extern TIFFTagMethods *TIFFAccessTagMethods(TIFF *);
extern void *TIFFGetClientInfo(TIFF *, const char *);
extern void TIFFSetClientInfo(TIFF *, void *, const char *);
extern void TIFFCleanup(TIFF* tif);
extern void TIFFClose(TIFF* tif);
extern int TIFFFlush(TIFF* tif);
extern int TIFFFlushData(TIFF* tif);
extern int TIFFGetField(TIFF* tif, uint32 tag, ...);
extern int TIFFVGetField(TIFF* tif, uint32 tag, va_list ap);
extern int TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...);
extern int TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap);
extern int TIFFReadDirectory(TIFF* tif);
extern int TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldArray* infoarray);
extern int TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff);
extern uint64 TIFFScanlineSize64(TIFF* tif);
extern tmsize_t TIFFScanlineSize(TIFF* tif);
extern uint64 TIFFRasterScanlineSize64(TIFF* tif);
extern tmsize_t TIFFRasterScanlineSize(TIFF* tif);
extern uint64 TIFFStripSize64(TIFF* tif);
extern tmsize_t TIFFStripSize(TIFF* tif);
extern uint64 TIFFRawStripSize64(TIFF* tif, uint32 strip);
extern tmsize_t TIFFRawStripSize(TIFF* tif, uint32 strip);
extern uint64 TIFFVStripSize64(TIFF* tif, uint32 nrows);
extern tmsize_t TIFFVStripSize(TIFF* tif, uint32 nrows);
extern uint64 TIFFTileRowSize64(TIFF* tif);
extern tmsize_t TIFFTileRowSize(TIFF* tif);
extern uint64 TIFFTileSize64(TIFF* tif);
extern tmsize_t TIFFTileSize(TIFF* tif);
extern uint64 TIFFVTileSize64(TIFF* tif, uint32 nrows);
extern tmsize_t TIFFVTileSize(TIFF* tif, uint32 nrows);
extern uint32 TIFFDefaultStripSize(TIFF* tif, uint32 request);
extern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
extern int TIFFFileno(TIFF*);
extern int TIFFSetFileno(TIFF*, int);
extern thandle_t TIFFClientdata(TIFF*);
extern thandle_t TIFFSetClientdata(TIFF*, thandle_t);
extern int TIFFGetMode(TIFF*);
extern int TIFFSetMode(TIFF*, int);
extern int TIFFIsTiled(TIFF*);
extern int TIFFIsByteSwapped(TIFF*);
extern int TIFFIsUpSampled(TIFF*);
extern int TIFFIsMSB2LSB(TIFF*);
extern int TIFFIsBigEndian(TIFF*);
extern TIFFReadWriteProc TIFFGetReadProc(TIFF*);
extern TIFFReadWriteProc TIFFGetWriteProc(TIFF*);
extern TIFFSeekProc TIFFGetSeekProc(TIFF*);
extern TIFFCloseProc TIFFGetCloseProc(TIFF*);
extern TIFFSizeProc TIFFGetSizeProc(TIFF*);
extern TIFFMapFileProc TIFFGetMapFileProc(TIFF*);
extern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*);
extern uint32 TIFFCurrentRow(TIFF*);
extern uint16 TIFFCurrentDirectory(TIFF*);
extern uint16 TIFFNumberOfDirectories(TIFF*);
extern uint64 TIFFCurrentDirOffset(TIFF*);
extern uint32 TIFFCurrentStrip(TIFF*);
extern uint32 TIFFCurrentTile(TIFF* tif);
extern int TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size);
extern int TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size);
extern int TIFFSetupStrips(TIFF *);
extern int TIFFWriteCheck(TIFF*, int, const char *);
extern void TIFFFreeDirectory(TIFF*);
extern int TIFFCreateDirectory(TIFF*);
extern int TIFFCreateCustomDirectory(TIFF*,const TIFFFieldArray*);
extern int TIFFCreateEXIFDirectory(TIFF*);
extern int TIFFLastDirectory(TIFF*);
extern int TIFFSetDirectory(TIFF*, uint16);
extern int TIFFSetSubDirectory(TIFF*, uint64);
extern int TIFFUnlinkDirectory(TIFF*, uint16);
extern int TIFFSetField(TIFF*, uint32, ...);
extern int TIFFVSetField(TIFF*, uint32, va_list);
extern int TIFFUnsetField(TIFF*, uint32);
extern int TIFFWriteDirectory(TIFF *);
extern int TIFFWriteCustomDirectory(TIFF *, uint64 *);
extern int TIFFCheckpointDirectory(TIFF *);
extern int TIFFRewriteDirectory(TIFF *);
#if defined(c_plusplus) || defined(__cplusplus)
extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);
extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);
extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);
extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);
extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*,
int = ORIENTATION_BOTLEFT, int = 0);
#else
extern void TIFFPrintDirectory(TIFF*, FILE*, long);
extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);
extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);
extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);
extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int);
#endif
extern int TIFFReadRGBAStrip(TIFF*, uint32, uint32 * );
extern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );
extern int TIFFRGBAImageOK(TIFF*, char [1024]);
extern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);
extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);
extern void TIFFRGBAImageEnd(TIFFRGBAImage*);
extern TIFF* TIFFOpen(const char*, const char*);
# ifdef __WIN32__
extern TIFF* TIFFOpenW(const wchar_t*, const char*);
# endif /* __WIN32__ */
extern TIFF* TIFFFdOpen(int, const char*, const char*);
extern TIFF* TIFFClientOpen(const char*, const char*,
thandle_t,
TIFFReadWriteProc, TIFFReadWriteProc,
TIFFSeekProc, TIFFCloseProc,
TIFFSizeProc,
TIFFMapFileProc, TIFFUnmapFileProc);
extern const char* TIFFFileName(TIFF*);
extern const char* TIFFSetFileName(TIFF*, const char *);
extern void TIFFError(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3)));
extern void TIFFErrorExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4)));
extern void TIFFWarning(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3)));
extern void TIFFWarningExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4)));
extern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);
extern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt);
extern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);
extern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt);
extern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);
extern uint32 TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);
extern int TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);
extern uint32 TIFFNumberOfTiles(TIFF*);
extern tmsize_t TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);
extern tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);
extern uint32 TIFFComputeStrip(TIFF*, uint32, uint16);
extern uint32 TIFFNumberOfStrips(TIFF*);
extern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);
extern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);
extern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);
extern tmsize_t TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);
extern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);
extern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);
extern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);
extern tmsize_t TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);
extern int TIFFDataWidth(TIFFDataType); /* table of tag datatype widths */
extern void TIFFSetWriteOffset(TIFF* tif, toff_t off);
extern void TIFFSwabShort(uint16*);
extern void TIFFSwabLong(uint32*);
extern void TIFFSwabLong8(uint64*);
extern void TIFFSwabFloat(float*);
extern void TIFFSwabDouble(double*);
extern void TIFFSwabArrayOfShort(uint16* wp, tmsize_t n);
extern void TIFFSwabArrayOfTriples(uint8* tp, tmsize_t n);
extern void TIFFSwabArrayOfLong(uint32* lp, tmsize_t n);
extern void TIFFSwabArrayOfLong8(uint64* lp, tmsize_t n);
extern void TIFFSwabArrayOfFloat(float* fp, tmsize_t n);
extern void TIFFSwabArrayOfDouble(double* dp, tmsize_t n);
extern void TIFFReverseBits(uint8* cp, tmsize_t n);
extern const unsigned char* TIFFGetBitRevTable(int);
#ifdef LOGLUV_PUBLIC
#define U_NEU 0.210526316
#define V_NEU 0.473684211
#define UVSCALE 410.
extern double LogL16toY(int);
extern double LogL10toY(int);
extern void XYZtoRGB24(float*, uint8*);
extern int uv_decode(double*, double*, int);
extern void LogLuv24toXYZ(uint32, float*);
extern void LogLuv32toXYZ(uint32, float*);
#if defined(c_plusplus) || defined(__cplusplus)
extern int LogL16fromY(double, int = SGILOGENCODE_NODITHER);
extern int LogL10fromY(double, int = SGILOGENCODE_NODITHER);
extern int uv_encode(double, double, int = SGILOGENCODE_NODITHER);
extern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);
extern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);
#else
extern int LogL16fromY(double, int);
extern int LogL10fromY(double, int);
extern int uv_encode(double, double, int);
extern uint32 LogLuv24fromXYZ(float*, int);
extern uint32 LogLuv32fromXYZ(float*, int);
#endif
#endif /* LOGLUV_PUBLIC */
extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, const TIFFDisplay *, float*);
extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32,
float *, float *, float *);
extern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float,
uint32 *, uint32 *, uint32 *);
extern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*);
extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,
uint32 *, uint32 *, uint32 *);
/****************************************************************************
* O B S O L E T E D I N T E R F A C E S
*
* Don't use this stuff in your applications, it may be removed in the future
* libtiff versions.
****************************************************************************/
typedef struct {
ttag_t field_tag; /* field's tag */
short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */
short field_writecount; /* write count/TIFF_VARIABLE */
TIFFDataType field_type; /* type of associated data */
unsigned short field_bit; /* bit in fieldsset bit vector */
unsigned char field_oktochange; /* if true, can change while writing */
unsigned char field_passcount; /* if true, pass dir count on set */
char *field_name; /* ASCII name */
} TIFFFieldInfo;
extern int TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], uint32);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* _TIFFIO_ */
/* vim: set ts=8 sts=8 sw=8 noet: */
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
| 23,003
|
C++
|
.h
| 506
| 43.6917
| 114
| 0.72194
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
28,159
|
t4.h
|
openMVG_openMVG/src/third_party/tiff/t4.h
|
/* $Id: t4.h,v 1.3 2010-03-10 18:56:48 bfriesen Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#ifndef _T4_
#define _T4_
/*
* CCITT T.4 1D Huffman runlength codes and
* related definitions. Given the small sizes
* of these tables it does not seem
* worthwhile to make code & length 8 bits.
*/
typedef struct tableentry {
unsigned short length; /* bit length of g3 code */
unsigned short code; /* g3 code */
short runlen; /* run length in bits */
} tableentry;
#define EOL 0x001 /* EOL code value - 0000 0000 0000 1 */
/* status values returned instead of a run length */
#define G3CODE_EOL -1 /* NB: ACT_EOL - ACT_WRUNT */
#define G3CODE_INVALID -2 /* NB: ACT_INVALID - ACT_WRUNT */
#define G3CODE_EOF -3 /* end of input data */
#define G3CODE_INCOMP -4 /* incomplete run code */
/*
* Note that these tables are ordered such that the
* index into the table is known to be either the
* run length, or (run length / 64) + a fixed offset.
*
* NB: The G3CODE_INVALID entries are only used
* during state generation (see mkg3states.c).
*/
#ifdef G3CODES
const tableentry TIFFFaxWhiteCodes[] = {
{ 8, 0x35, 0 }, /* 0011 0101 */
{ 6, 0x7, 1 }, /* 0001 11 */
{ 4, 0x7, 2 }, /* 0111 */
{ 4, 0x8, 3 }, /* 1000 */
{ 4, 0xB, 4 }, /* 1011 */
{ 4, 0xC, 5 }, /* 1100 */
{ 4, 0xE, 6 }, /* 1110 */
{ 4, 0xF, 7 }, /* 1111 */
{ 5, 0x13, 8 }, /* 1001 1 */
{ 5, 0x14, 9 }, /* 1010 0 */
{ 5, 0x7, 10 }, /* 0011 1 */
{ 5, 0x8, 11 }, /* 0100 0 */
{ 6, 0x8, 12 }, /* 0010 00 */
{ 6, 0x3, 13 }, /* 0000 11 */
{ 6, 0x34, 14 }, /* 1101 00 */
{ 6, 0x35, 15 }, /* 1101 01 */
{ 6, 0x2A, 16 }, /* 1010 10 */
{ 6, 0x2B, 17 }, /* 1010 11 */
{ 7, 0x27, 18 }, /* 0100 111 */
{ 7, 0xC, 19 }, /* 0001 100 */
{ 7, 0x8, 20 }, /* 0001 000 */
{ 7, 0x17, 21 }, /* 0010 111 */
{ 7, 0x3, 22 }, /* 0000 011 */
{ 7, 0x4, 23 }, /* 0000 100 */
{ 7, 0x28, 24 }, /* 0101 000 */
{ 7, 0x2B, 25 }, /* 0101 011 */
{ 7, 0x13, 26 }, /* 0010 011 */
{ 7, 0x24, 27 }, /* 0100 100 */
{ 7, 0x18, 28 }, /* 0011 000 */
{ 8, 0x2, 29 }, /* 0000 0010 */
{ 8, 0x3, 30 }, /* 0000 0011 */
{ 8, 0x1A, 31 }, /* 0001 1010 */
{ 8, 0x1B, 32 }, /* 0001 1011 */
{ 8, 0x12, 33 }, /* 0001 0010 */
{ 8, 0x13, 34 }, /* 0001 0011 */
{ 8, 0x14, 35 }, /* 0001 0100 */
{ 8, 0x15, 36 }, /* 0001 0101 */
{ 8, 0x16, 37 }, /* 0001 0110 */
{ 8, 0x17, 38 }, /* 0001 0111 */
{ 8, 0x28, 39 }, /* 0010 1000 */
{ 8, 0x29, 40 }, /* 0010 1001 */
{ 8, 0x2A, 41 }, /* 0010 1010 */
{ 8, 0x2B, 42 }, /* 0010 1011 */
{ 8, 0x2C, 43 }, /* 0010 1100 */
{ 8, 0x2D, 44 }, /* 0010 1101 */
{ 8, 0x4, 45 }, /* 0000 0100 */
{ 8, 0x5, 46 }, /* 0000 0101 */
{ 8, 0xA, 47 }, /* 0000 1010 */
{ 8, 0xB, 48 }, /* 0000 1011 */
{ 8, 0x52, 49 }, /* 0101 0010 */
{ 8, 0x53, 50 }, /* 0101 0011 */
{ 8, 0x54, 51 }, /* 0101 0100 */
{ 8, 0x55, 52 }, /* 0101 0101 */
{ 8, 0x24, 53 }, /* 0010 0100 */
{ 8, 0x25, 54 }, /* 0010 0101 */
{ 8, 0x58, 55 }, /* 0101 1000 */
{ 8, 0x59, 56 }, /* 0101 1001 */
{ 8, 0x5A, 57 }, /* 0101 1010 */
{ 8, 0x5B, 58 }, /* 0101 1011 */
{ 8, 0x4A, 59 }, /* 0100 1010 */
{ 8, 0x4B, 60 }, /* 0100 1011 */
{ 8, 0x32, 61 }, /* 0011 0010 */
{ 8, 0x33, 62 }, /* 0011 0011 */
{ 8, 0x34, 63 }, /* 0011 0100 */
{ 5, 0x1B, 64 }, /* 1101 1 */
{ 5, 0x12, 128 }, /* 1001 0 */
{ 6, 0x17, 192 }, /* 0101 11 */
{ 7, 0x37, 256 }, /* 0110 111 */
{ 8, 0x36, 320 }, /* 0011 0110 */
{ 8, 0x37, 384 }, /* 0011 0111 */
{ 8, 0x64, 448 }, /* 0110 0100 */
{ 8, 0x65, 512 }, /* 0110 0101 */
{ 8, 0x68, 576 }, /* 0110 1000 */
{ 8, 0x67, 640 }, /* 0110 0111 */
{ 9, 0xCC, 704 }, /* 0110 0110 0 */
{ 9, 0xCD, 768 }, /* 0110 0110 1 */
{ 9, 0xD2, 832 }, /* 0110 1001 0 */
{ 9, 0xD3, 896 }, /* 0110 1001 1 */
{ 9, 0xD4, 960 }, /* 0110 1010 0 */
{ 9, 0xD5, 1024 }, /* 0110 1010 1 */
{ 9, 0xD6, 1088 }, /* 0110 1011 0 */
{ 9, 0xD7, 1152 }, /* 0110 1011 1 */
{ 9, 0xD8, 1216 }, /* 0110 1100 0 */
{ 9, 0xD9, 1280 }, /* 0110 1100 1 */
{ 9, 0xDA, 1344 }, /* 0110 1101 0 */
{ 9, 0xDB, 1408 }, /* 0110 1101 1 */
{ 9, 0x98, 1472 }, /* 0100 1100 0 */
{ 9, 0x99, 1536 }, /* 0100 1100 1 */
{ 9, 0x9A, 1600 }, /* 0100 1101 0 */
{ 6, 0x18, 1664 }, /* 0110 00 */
{ 9, 0x9B, 1728 }, /* 0100 1101 1 */
{ 11, 0x8, 1792 }, /* 0000 0001 000 */
{ 11, 0xC, 1856 }, /* 0000 0001 100 */
{ 11, 0xD, 1920 }, /* 0000 0001 101 */
{ 12, 0x12, 1984 }, /* 0000 0001 0010 */
{ 12, 0x13, 2048 }, /* 0000 0001 0011 */
{ 12, 0x14, 2112 }, /* 0000 0001 0100 */
{ 12, 0x15, 2176 }, /* 0000 0001 0101 */
{ 12, 0x16, 2240 }, /* 0000 0001 0110 */
{ 12, 0x17, 2304 }, /* 0000 0001 0111 */
{ 12, 0x1C, 2368 }, /* 0000 0001 1100 */
{ 12, 0x1D, 2432 }, /* 0000 0001 1101 */
{ 12, 0x1E, 2496 }, /* 0000 0001 1110 */
{ 12, 0x1F, 2560 }, /* 0000 0001 1111 */
{ 12, 0x1, G3CODE_EOL }, /* 0000 0000 0001 */
{ 9, 0x1, G3CODE_INVALID }, /* 0000 0000 1 */
{ 10, 0x1, G3CODE_INVALID }, /* 0000 0000 01 */
{ 11, 0x1, G3CODE_INVALID }, /* 0000 0000 001 */
{ 12, 0x0, G3CODE_INVALID }, /* 0000 0000 0000 */
};
const tableentry TIFFFaxBlackCodes[] = {
{ 10, 0x37, 0 }, /* 0000 1101 11 */
{ 3, 0x2, 1 }, /* 010 */
{ 2, 0x3, 2 }, /* 11 */
{ 2, 0x2, 3 }, /* 10 */
{ 3, 0x3, 4 }, /* 011 */
{ 4, 0x3, 5 }, /* 0011 */
{ 4, 0x2, 6 }, /* 0010 */
{ 5, 0x3, 7 }, /* 0001 1 */
{ 6, 0x5, 8 }, /* 0001 01 */
{ 6, 0x4, 9 }, /* 0001 00 */
{ 7, 0x4, 10 }, /* 0000 100 */
{ 7, 0x5, 11 }, /* 0000 101 */
{ 7, 0x7, 12 }, /* 0000 111 */
{ 8, 0x4, 13 }, /* 0000 0100 */
{ 8, 0x7, 14 }, /* 0000 0111 */
{ 9, 0x18, 15 }, /* 0000 1100 0 */
{ 10, 0x17, 16 }, /* 0000 0101 11 */
{ 10, 0x18, 17 }, /* 0000 0110 00 */
{ 10, 0x8, 18 }, /* 0000 0010 00 */
{ 11, 0x67, 19 }, /* 0000 1100 111 */
{ 11, 0x68, 20 }, /* 0000 1101 000 */
{ 11, 0x6C, 21 }, /* 0000 1101 100 */
{ 11, 0x37, 22 }, /* 0000 0110 111 */
{ 11, 0x28, 23 }, /* 0000 0101 000 */
{ 11, 0x17, 24 }, /* 0000 0010 111 */
{ 11, 0x18, 25 }, /* 0000 0011 000 */
{ 12, 0xCA, 26 }, /* 0000 1100 1010 */
{ 12, 0xCB, 27 }, /* 0000 1100 1011 */
{ 12, 0xCC, 28 }, /* 0000 1100 1100 */
{ 12, 0xCD, 29 }, /* 0000 1100 1101 */
{ 12, 0x68, 30 }, /* 0000 0110 1000 */
{ 12, 0x69, 31 }, /* 0000 0110 1001 */
{ 12, 0x6A, 32 }, /* 0000 0110 1010 */
{ 12, 0x6B, 33 }, /* 0000 0110 1011 */
{ 12, 0xD2, 34 }, /* 0000 1101 0010 */
{ 12, 0xD3, 35 }, /* 0000 1101 0011 */
{ 12, 0xD4, 36 }, /* 0000 1101 0100 */
{ 12, 0xD5, 37 }, /* 0000 1101 0101 */
{ 12, 0xD6, 38 }, /* 0000 1101 0110 */
{ 12, 0xD7, 39 }, /* 0000 1101 0111 */
{ 12, 0x6C, 40 }, /* 0000 0110 1100 */
{ 12, 0x6D, 41 }, /* 0000 0110 1101 */
{ 12, 0xDA, 42 }, /* 0000 1101 1010 */
{ 12, 0xDB, 43 }, /* 0000 1101 1011 */
{ 12, 0x54, 44 }, /* 0000 0101 0100 */
{ 12, 0x55, 45 }, /* 0000 0101 0101 */
{ 12, 0x56, 46 }, /* 0000 0101 0110 */
{ 12, 0x57, 47 }, /* 0000 0101 0111 */
{ 12, 0x64, 48 }, /* 0000 0110 0100 */
{ 12, 0x65, 49 }, /* 0000 0110 0101 */
{ 12, 0x52, 50 }, /* 0000 0101 0010 */
{ 12, 0x53, 51 }, /* 0000 0101 0011 */
{ 12, 0x24, 52 }, /* 0000 0010 0100 */
{ 12, 0x37, 53 }, /* 0000 0011 0111 */
{ 12, 0x38, 54 }, /* 0000 0011 1000 */
{ 12, 0x27, 55 }, /* 0000 0010 0111 */
{ 12, 0x28, 56 }, /* 0000 0010 1000 */
{ 12, 0x58, 57 }, /* 0000 0101 1000 */
{ 12, 0x59, 58 }, /* 0000 0101 1001 */
{ 12, 0x2B, 59 }, /* 0000 0010 1011 */
{ 12, 0x2C, 60 }, /* 0000 0010 1100 */
{ 12, 0x5A, 61 }, /* 0000 0101 1010 */
{ 12, 0x66, 62 }, /* 0000 0110 0110 */
{ 12, 0x67, 63 }, /* 0000 0110 0111 */
{ 10, 0xF, 64 }, /* 0000 0011 11 */
{ 12, 0xC8, 128 }, /* 0000 1100 1000 */
{ 12, 0xC9, 192 }, /* 0000 1100 1001 */
{ 12, 0x5B, 256 }, /* 0000 0101 1011 */
{ 12, 0x33, 320 }, /* 0000 0011 0011 */
{ 12, 0x34, 384 }, /* 0000 0011 0100 */
{ 12, 0x35, 448 }, /* 0000 0011 0101 */
{ 13, 0x6C, 512 }, /* 0000 0011 0110 0 */
{ 13, 0x6D, 576 }, /* 0000 0011 0110 1 */
{ 13, 0x4A, 640 }, /* 0000 0010 0101 0 */
{ 13, 0x4B, 704 }, /* 0000 0010 0101 1 */
{ 13, 0x4C, 768 }, /* 0000 0010 0110 0 */
{ 13, 0x4D, 832 }, /* 0000 0010 0110 1 */
{ 13, 0x72, 896 }, /* 0000 0011 1001 0 */
{ 13, 0x73, 960 }, /* 0000 0011 1001 1 */
{ 13, 0x74, 1024 }, /* 0000 0011 1010 0 */
{ 13, 0x75, 1088 }, /* 0000 0011 1010 1 */
{ 13, 0x76, 1152 }, /* 0000 0011 1011 0 */
{ 13, 0x77, 1216 }, /* 0000 0011 1011 1 */
{ 13, 0x52, 1280 }, /* 0000 0010 1001 0 */
{ 13, 0x53, 1344 }, /* 0000 0010 1001 1 */
{ 13, 0x54, 1408 }, /* 0000 0010 1010 0 */
{ 13, 0x55, 1472 }, /* 0000 0010 1010 1 */
{ 13, 0x5A, 1536 }, /* 0000 0010 1101 0 */
{ 13, 0x5B, 1600 }, /* 0000 0010 1101 1 */
{ 13, 0x64, 1664 }, /* 0000 0011 0010 0 */
{ 13, 0x65, 1728 }, /* 0000 0011 0010 1 */
{ 11, 0x8, 1792 }, /* 0000 0001 000 */
{ 11, 0xC, 1856 }, /* 0000 0001 100 */
{ 11, 0xD, 1920 }, /* 0000 0001 101 */
{ 12, 0x12, 1984 }, /* 0000 0001 0010 */
{ 12, 0x13, 2048 }, /* 0000 0001 0011 */
{ 12, 0x14, 2112 }, /* 0000 0001 0100 */
{ 12, 0x15, 2176 }, /* 0000 0001 0101 */
{ 12, 0x16, 2240 }, /* 0000 0001 0110 */
{ 12, 0x17, 2304 }, /* 0000 0001 0111 */
{ 12, 0x1C, 2368 }, /* 0000 0001 1100 */
{ 12, 0x1D, 2432 }, /* 0000 0001 1101 */
{ 12, 0x1E, 2496 }, /* 0000 0001 1110 */
{ 12, 0x1F, 2560 }, /* 0000 0001 1111 */
{ 12, 0x1, G3CODE_EOL }, /* 0000 0000 0001 */
{ 9, 0x1, G3CODE_INVALID }, /* 0000 0000 1 */
{ 10, 0x1, G3CODE_INVALID }, /* 0000 0000 01 */
{ 11, 0x1, G3CODE_INVALID }, /* 0000 0000 001 */
{ 12, 0x0, G3CODE_INVALID }, /* 0000 0000 0000 */
};
#else
extern const tableentry TIFFFaxWhiteCodes[];
extern const tableentry TIFFFaxBlackCodes[];
#endif
#endif /* _T4_ */
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
| 11,379
|
C++
|
.h
| 286
| 35.534965
| 78
| 0.514296
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| true
| false
| false
|
28,160
|
tiffconf.vc.h
|
openMVG_openMVG/src/third_party/tiff/tiffconf.vc.h
|
/*
Configuration defines for installed libtiff.
This file maintained for backward compatibility. Do not use definitions
from this file in your programs.
*/
#ifndef _TIFFCONF_
#define _TIFFCONF_
/* Define to 1 if the system has the type `int16'. */
/* #undef HAVE_INT16 */
/* Define to 1 if the system has the type `int32'. */
/* #undef HAVE_INT32 */
/* Define to 1 if the system has the type `int8'. */
/* #undef HAVE_INT8 */
/* The size of a `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* Signed 8-bit type */
#define TIFF_INT8_T signed char
/* Unsigned 8-bit type */
#define TIFF_UINT8_T unsigned char
/* Signed 16-bit type */
#define TIFF_INT16_T signed short
/* Unsigned 16-bit type */
#define TIFF_UINT16_T unsigned short
/* Signed 32-bit type formatter */
#define TIFF_INT32_FORMAT "%d"
/* Signed 32-bit type */
#define TIFF_INT32_T signed int
/* Unsigned 32-bit type formatter */
#define TIFF_UINT32_FORMAT "%u"
/* Unsigned 32-bit type */
#define TIFF_UINT32_T unsigned int
/* Signed 64-bit type formatter */
#define TIFF_INT64_FORMAT "%I64d"
/* Signed 64-bit type */
#define TIFF_INT64_T signed __int64
/* Unsigned 64-bit type formatter */
#define TIFF_UINT64_FORMAT "%I64u"
/* Unsigned 64-bit type */
#define TIFF_UINT64_T unsigned __int64
/* Signed size type */
#if defined(_WIN64)
#define TIFF_SSIZE_T signed __int64
#else
#define TIFF_SSIZE_T signed int
#endif
/* Signed size type formatter */
#if defined(_WIN64)
#define TIFF_SSIZE_FORMAT "%I64d"
#else
#define TIFF_SSIZE_FORMAT "%ld"
#endif
/* Pointer difference type */
#define TIFF_PTRDIFF_T long
/* Compatibility stuff. */
/* Define as 0 or 1 according to the floating point format suported by the
machine */
#define HAVE_IEEEFP 1
/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
#define HOST_FILLORDER FILLORDER_LSB2MSB
/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
(Intel) */
#define HOST_BIGENDIAN 0
/* Support CCITT Group 3 & 4 algorithms */
#define CCITT_SUPPORT 1
/* Support JPEG compression (requires IJG JPEG library) */
/* #undef JPEG_SUPPORT */
/* Support JBIG compression (requires JBIG-KIT library) */
/* #undef JBIG_SUPPORT */
/* Support LogLuv high dynamic range encoding */
#define LOGLUV_SUPPORT 1
/* Support LZW algorithm */
#define LZW_SUPPORT 1
/* Support NeXT 2-bit RLE algorithm */
#define NEXT_SUPPORT 1
/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation
fails with unpatched IJG JPEG library) */
/* #undef OJPEG_SUPPORT */
/* Support Macintosh PackBits algorithm */
#define PACKBITS_SUPPORT 1
/* Support Pixar log-format algorithm (requires Zlib) */
/* #undef PIXARLOG_SUPPORT */
/* Support ThunderScan 4-bit RLE algorithm */
#define THUNDER_SUPPORT 1
/* Support Deflate compression */
/* #undef ZIP_SUPPORT */
/* Support strip chopping (whether or not to convert single-strip uncompressed
images to mutiple strips of ~8Kb to reduce memory usage) */
#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP
/* Enable SubIFD tag (330) support */
#define SUBIFD_SUPPORT 1
/* Treat extra sample as alpha (default enabled). The RGBA interface will
treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
packages produce RGBA files but don't mark the alpha properly. */
#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1
/* Pick up YCbCr subsampling info from the JPEG data stream to support files
lacking the tag (default enabled). */
#define CHECK_JPEG_YCBCR_SUBSAMPLING 1
/* Support MS MDI magic number files as TIFF */
/* #undef MDI_SUPPORT */
/*
* Feature support definitions.
* XXX: These macros are obsoleted. Don't use them in your apps!
* Macros stays here for backward compatibility and should be always defined.
*/
#define COLORIMETRY_SUPPORT
#define YCBCR_SUPPORT
#define CMYK_SUPPORT
#define ICC_SUPPORT
#define PHOTOSHOP_SUPPORT
#define IPTC_SUPPORT
#endif /* _TIFFCONF_ */
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
| 4,016
|
C++
|
.h
| 118
| 32.364407
| 78
| 0.747666
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
28,161
|
tif_config.vc.h
|
openMVG_openMVG/src/third_party/tiff/tif_config.vc.h
|
/* Define to 1 if you have the <assert.h> header file. */
#define HAVE_ASSERT_H 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define as 0 or 1 according to the floating point format suported by the
machine */
#define HAVE_IEEEFP 1
/* Define to 1 if you have the `jbg_newlen' function. */
#define HAVE_JBG_NEWLEN 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <io.h> header file. */
#define HAVE_IO_H 1
/* Define to 1 if you have the <search.h> header file. */
#define HAVE_SEARCH_H 1
/* Define to 1 if you have the `setmode' function. */
#define HAVE_SETMODE 1
/* The size of a `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of a `long', as computed by sizeof. */
#define SIZEOF_LONG 4
/* Signed 64-bit type formatter */
#define TIFF_INT64_FORMAT "%I64d"
/* Signed 64-bit type */
#define TIFF_INT64_T signed __int64
/* Unsigned 64-bit type formatter */
#define TIFF_UINT64_FORMAT "%I64u"
/* Unsigned 64-bit type */
#define TIFF_UINT64_T unsigned __int64
/* Set the native cpu bit order */
#define HOST_FILLORDER FILLORDER_LSB2MSB
#define snprintf _snprintf
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
# ifndef inline
# define inline __inline
# endif
#endif
#define lfind _lfind
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
| 1,790
|
C++
|
.h
| 52
| 32.769231
| 76
| 0.713787
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| true
| false
| false
| false
| false
| false
| false
|
28,162
|
tiffiop.h
|
openMVG_openMVG/src/third_party/tiff/tiffiop.h
|
/* $Id: tiffiop.h,v 1.84 2012-05-30 01:50:17 fwarmerdam Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#ifndef _TIFFIOP_
#define _TIFFIOP_
/*
* ``Library-private'' definitions.
*/
#include "tif_config.h"
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#endif
#ifdef HAVE_ASSERT_H
# include <assert.h>
#else
# define assert(x)
#endif
#ifdef HAVE_SEARCH_H
# include <search.h>
#else
extern void *lfind(const void *, const void *, size_t *, size_t,
int (*)(const void *, const void *));
#endif
#include "tiffio.h"
#include "tif_dir.h"
#ifndef STRIP_SIZE_DEFAULT
# define STRIP_SIZE_DEFAULT 8192
#endif
#define streq(a,b) (strcmp(a,b) == 0)
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
typedef struct client_info {
struct client_info *next;
void *data;
char *name;
} TIFFClientInfoLink;
/*
* Typedefs for ``method pointers'' used internally.
* these are depriciated and provided only for backwards compatibility
*/
typedef unsigned char tidataval_t; /* internal image data value type */
typedef tidataval_t* tidata_t; /* reference to internal image data */
typedef void (*TIFFVoidMethod)(TIFF*);
typedef int (*TIFFBoolMethod)(TIFF*);
typedef int (*TIFFPreMethod)(TIFF*, uint16);
typedef int (*TIFFCodeMethod)(TIFF* tif, uint8* buf, tmsize_t size, uint16 sample);
typedef int (*TIFFSeekMethod)(TIFF*, uint32);
typedef void (*TIFFPostMethod)(TIFF* tif, uint8* buf, tmsize_t size);
typedef uint32 (*TIFFStripMethod)(TIFF*, uint32);
typedef void (*TIFFTileMethod)(TIFF*, uint32*, uint32*);
struct tiff {
char* tif_name; /* name of open file */
int tif_fd; /* open file descriptor */
int tif_mode; /* open mode (O_*) */
uint32 tif_flags;
#define TIFF_FILLORDER 0x00003 /* natural bit fill order for machine */
#define TIFF_DIRTYHEADER 0x00004 /* header must be written on close */
#define TIFF_DIRTYDIRECT 0x00008 /* current directory must be written */
#define TIFF_BUFFERSETUP 0x00010 /* data buffers setup */
#define TIFF_CODERSETUP 0x00020 /* encoder/decoder setup done */
#define TIFF_BEENWRITING 0x00040 /* written 1+ scanlines to file */
#define TIFF_SWAB 0x00080 /* byte swap file information */
#define TIFF_NOBITREV 0x00100 /* inhibit bit reversal logic */
#define TIFF_MYBUFFER 0x00200 /* my raw data buffer; free on close */
#define TIFF_ISTILED 0x00400 /* file is tile, not strip- based */
#define TIFF_MAPPED 0x00800 /* file is mapped into memory */
#define TIFF_POSTENCODE 0x01000 /* need call to postencode routine */
#define TIFF_INSUBIFD 0x02000 /* currently writing a subifd */
#define TIFF_UPSAMPLED 0x04000 /* library is doing data up-sampling */
#define TIFF_STRIPCHOP 0x08000 /* enable strip chopping support */
#define TIFF_HEADERONLY 0x10000 /* read header only, do not process the first directory */
#define TIFF_NOREADRAW 0x20000 /* skip reading of raw uncompressed image data */
#define TIFF_INCUSTOMIFD 0x40000 /* currently writing a custom IFD */
#define TIFF_BIGTIFF 0x80000 /* read/write bigtiff */
#define TIFF_BUF4WRITE 0x100000 /* rawcc bytes are for writing */
#define TIFF_DIRTYSTRIP 0x200000 /* stripoffsets/stripbytecount dirty*/
#define TIFF_PERSAMPLE 0x400000 /* get/set per sample tags as arrays */
#define TIFF_BUFFERMMAP 0x800000 /* read buffer (tif_rawdata) points into mmap() memory */
uint64 tif_diroff; /* file offset of current directory */
uint64 tif_nextdiroff; /* file offset of following directory */
uint64* tif_dirlist; /* list of offsets to already seen directories to prevent IFD looping */
uint16 tif_dirlistsize; /* number of entires in offset list */
uint16 tif_dirnumber; /* number of already seen directories */
TIFFDirectory tif_dir; /* internal rep of current directory */
TIFFDirectory tif_customdir; /* custom IFDs are separated from the main ones */
union {
TIFFHeaderCommon common;
TIFFHeaderClassic classic;
TIFFHeaderBig big;
} tif_header;
uint16 tif_header_size; /* file's header block and its length */
uint32 tif_row; /* current scanline */
uint16 tif_curdir; /* current directory (index) */
uint32 tif_curstrip; /* current strip for read/write */
uint64 tif_curoff; /* current offset for read/write */
uint64 tif_dataoff; /* current offset for writing dir */
/* SubIFD support */
uint16 tif_nsubifd; /* remaining subifds to write */
uint64 tif_subifdoff; /* offset for patching SubIFD link */
/* tiling support */
uint32 tif_col; /* current column (offset by row too) */
uint32 tif_curtile; /* current tile for read/write */
tmsize_t tif_tilesize; /* # of bytes in a tile */
/* compression scheme hooks */
int tif_decodestatus;
TIFFBoolMethod tif_fixuptags; /* called in TIFFReadDirectory */
TIFFBoolMethod tif_setupdecode; /* called once before predecode */
TIFFPreMethod tif_predecode; /* pre- row/strip/tile decoding */
TIFFBoolMethod tif_setupencode; /* called once before preencode */
int tif_encodestatus;
TIFFPreMethod tif_preencode; /* pre- row/strip/tile encoding */
TIFFBoolMethod tif_postencode; /* post- row/strip/tile encoding */
TIFFCodeMethod tif_decoderow; /* scanline decoding routine */
TIFFCodeMethod tif_encoderow; /* scanline encoding routine */
TIFFCodeMethod tif_decodestrip; /* strip decoding routine */
TIFFCodeMethod tif_encodestrip; /* strip encoding routine */
TIFFCodeMethod tif_decodetile; /* tile decoding routine */
TIFFCodeMethod tif_encodetile; /* tile encoding routine */
TIFFVoidMethod tif_close; /* cleanup-on-close routine */
TIFFSeekMethod tif_seek; /* position within a strip routine */
TIFFVoidMethod tif_cleanup; /* cleanup state routine */
TIFFStripMethod tif_defstripsize; /* calculate/constrain strip size */
TIFFTileMethod tif_deftilesize; /* calculate/constrain tile size */
uint8* tif_data; /* compression scheme private data */
/* input/output buffering */
tmsize_t tif_scanlinesize; /* # of bytes in a scanline */
tmsize_t tif_scanlineskew; /* scanline skew for reading strips */
uint8* tif_rawdata; /* raw data buffer */
tmsize_t tif_rawdatasize; /* # of bytes in raw data buffer */
tmsize_t tif_rawdataoff; /* rawdata offset within strip */
tmsize_t tif_rawdataloaded;/* amount of data in rawdata */
uint8* tif_rawcp; /* current spot in raw buffer */
tmsize_t tif_rawcc; /* bytes unread from raw buffer */
/* memory-mapped file support */
uint8* tif_base; /* base of mapped file */
tmsize_t tif_size; /* size of mapped file region (bytes, thus tmsize_t) */
TIFFMapFileProc tif_mapproc; /* map file method */
TIFFUnmapFileProc tif_unmapproc; /* unmap file method */
/* input/output callback methods */
thandle_t tif_clientdata; /* callback parameter */
TIFFReadWriteProc tif_readproc; /* read method */
TIFFReadWriteProc tif_writeproc; /* write method */
TIFFSeekProc tif_seekproc; /* lseek method */
TIFFCloseProc tif_closeproc; /* close method */
TIFFSizeProc tif_sizeproc; /* filesize method */
/* post-decoding support */
TIFFPostMethod tif_postdecode; /* post decoding routine */
/* tag support */
TIFFField** tif_fields; /* sorted table of registered tags */
size_t tif_nfields; /* # entries in registered tag table */
const TIFFField* tif_foundfield; /* cached pointer to already found tag */
TIFFTagMethods tif_tagmethods; /* tag get/set/print routines */
TIFFClientInfoLink* tif_clientinfo; /* extra client information. */
/* Backward compatibility stuff. We need these two fields for
* setting up an old tag extension scheme. */
TIFFFieldArray* tif_fieldscompat;
size_t tif_nfieldscompat;
};
#define isPseudoTag(t) (t > 0xffff) /* is tag value normal or pseudo */
#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0)
#define isMapped(tif) (((tif)->tif_flags & TIFF_MAPPED) != 0)
#define isFillOrder(tif, o) (((tif)->tif_flags & (o)) != 0)
#define isUpSampled(tif) (((tif)->tif_flags & TIFF_UPSAMPLED) != 0)
#define TIFFReadFile(tif, buf, size) \
((*(tif)->tif_readproc)((tif)->tif_clientdata,(buf),(size)))
#define TIFFWriteFile(tif, buf, size) \
((*(tif)->tif_writeproc)((tif)->tif_clientdata,(buf),(size)))
#define TIFFSeekFile(tif, off, whence) \
((*(tif)->tif_seekproc)((tif)->tif_clientdata,(off),(whence)))
#define TIFFCloseFile(tif) \
((*(tif)->tif_closeproc)((tif)->tif_clientdata))
#define TIFFGetFileSize(tif) \
((*(tif)->tif_sizeproc)((tif)->tif_clientdata))
#define TIFFMapFileContents(tif, paddr, psize) \
((*(tif)->tif_mapproc)((tif)->tif_clientdata,(paddr),(psize)))
#define TIFFUnmapFileContents(tif, addr, size) \
((*(tif)->tif_unmapproc)((tif)->tif_clientdata,(addr),(size)))
/*
* Default Read/Seek/Write definitions.
*/
#ifndef ReadOK
#define ReadOK(tif, buf, size) \
(TIFFReadFile((tif),(buf),(size))==(size))
#endif
#ifndef SeekOK
#define SeekOK(tif, off) \
(TIFFSeekFile((tif),(off),SEEK_SET)==(off))
#endif
#ifndef WriteOK
#define WriteOK(tif, buf, size) \
(TIFFWriteFile((tif),(buf),(size))==(size))
#endif
/* NB: the uint32 casts are to silence certain ANSI-C compilers */
#define TIFFhowmany_32(x, y) (((uint32)x < (0xffffffff - (uint32)(y-1))) ? \
((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) : \
0U)
#define TIFFhowmany8_32(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
#define TIFFroundup_32(x, y) (TIFFhowmany_32(x,y)*(y))
#define TIFFhowmany_64(x, y) ((((uint64)(x))+(((uint64)(y))-1))/((uint64)(y)))
#define TIFFhowmany8_64(x) (((x)&0x07)?((uint64)(x)>>3)+1:(uint64)(x)>>3)
#define TIFFroundup_64(x, y) (TIFFhowmany_64(x,y)*(y))
/* Safe multiply which returns zero if there is an integer overflow */
#define TIFFSafeMultiply(t,v,m) ((((t)(m) != (t)0) && (((t)(((v)*(m))/(m))) == (t)(v))) ? (t)((v)*(m)) : (t)0)
#define TIFFmax(A,B) ((A)>(B)?(A):(B))
#define TIFFmin(A,B) ((A)<(B)?(A):(B))
#define TIFFArrayCount(a) (sizeof (a) / sizeof ((a)[0]))
#if defined(__cplusplus)
extern "C" {
#endif
extern int _TIFFgetMode(const char* mode, const char* module);
extern int _TIFFNoRowEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s);
extern int _TIFFNoStripEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s);
extern int _TIFFNoTileEncode(TIFF*, uint8* pp, tmsize_t cc, uint16 s);
extern int _TIFFNoRowDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s);
extern int _TIFFNoStripDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s);
extern int _TIFFNoTileDecode(TIFF*, uint8* pp, tmsize_t cc, uint16 s);
extern void _TIFFNoPostDecode(TIFF* tif, uint8* buf, tmsize_t cc);
extern int _TIFFNoPreCode(TIFF* tif, uint16 s);
extern int _TIFFNoSeek(TIFF* tif, uint32 off);
extern void _TIFFSwab16BitData(TIFF* tif, uint8* buf, tmsize_t cc);
extern void _TIFFSwab24BitData(TIFF* tif, uint8* buf, tmsize_t cc);
extern void _TIFFSwab32BitData(TIFF* tif, uint8* buf, tmsize_t cc);
extern void _TIFFSwab64BitData(TIFF* tif, uint8* buf, tmsize_t cc);
extern int TIFFFlushData1(TIFF* tif);
extern int TIFFDefaultDirectory(TIFF* tif);
extern void _TIFFSetDefaultCompressionState(TIFF* tif);
extern int _TIFFRewriteField(TIFF *, uint16, TIFFDataType, tmsize_t, void *);
extern int TIFFSetCompressionScheme(TIFF* tif, int scheme);
extern int TIFFSetDefaultCompressionState(TIFF* tif);
extern uint32 _TIFFDefaultStripSize(TIFF* tif, uint32 s);
extern void _TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th);
extern int _TIFFDataSize(TIFFDataType type);
extern void _TIFFsetByteArray(void**, void*, uint32);
extern void _TIFFsetString(char**, char*);
extern void _TIFFsetShortArray(uint16**, uint16*, uint32);
extern void _TIFFsetLongArray(uint32**, uint32*, uint32);
extern void _TIFFsetFloatArray(float**, float*, uint32);
extern void _TIFFsetDoubleArray(double**, double*, uint32);
extern void _TIFFprintAscii(FILE*, const char*);
extern void _TIFFprintAsciiTag(FILE*, const char*, const char*);
extern TIFFErrorHandler _TIFFwarningHandler;
extern TIFFErrorHandler _TIFFerrorHandler;
extern TIFFErrorHandlerExt _TIFFwarningHandlerExt;
extern TIFFErrorHandlerExt _TIFFerrorHandlerExt;
extern uint32 _TIFFMultiply32(TIFF*, uint32, uint32, const char*);
extern uint64 _TIFFMultiply64(TIFF*, uint64, uint64, const char*);
extern void* _TIFFCheckMalloc(TIFF*, tmsize_t, tmsize_t, const char*);
extern void* _TIFFCheckRealloc(TIFF*, void*, tmsize_t, tmsize_t, const char*);
extern double _TIFFUInt64ToDouble(uint64);
extern float _TIFFUInt64ToFloat(uint64);
extern int TIFFInitDumpMode(TIFF*, int);
#ifdef PACKBITS_SUPPORT
extern int TIFFInitPackBits(TIFF*, int);
#endif
#ifdef CCITT_SUPPORT
extern int TIFFInitCCITTRLE(TIFF*, int), TIFFInitCCITTRLEW(TIFF*, int);
extern int TIFFInitCCITTFax3(TIFF*, int), TIFFInitCCITTFax4(TIFF*, int);
#endif
#ifdef THUNDER_SUPPORT
extern int TIFFInitThunderScan(TIFF*, int);
#endif
#ifdef NEXT_SUPPORT
extern int TIFFInitNeXT(TIFF*, int);
#endif
#ifdef LZW_SUPPORT
extern int TIFFInitLZW(TIFF*, int);
#endif
#ifdef OJPEG_SUPPORT
extern int TIFFInitOJPEG(TIFF*, int);
#endif
#ifdef JPEG_SUPPORT
extern int TIFFInitJPEG(TIFF*, int);
#endif
#ifdef JBIG_SUPPORT
extern int TIFFInitJBIG(TIFF*, int);
#endif
#ifdef ZIP_SUPPORT
extern int TIFFInitZIP(TIFF*, int);
#endif
#ifdef PIXARLOG_SUPPORT
extern int TIFFInitPixarLog(TIFF*, int);
#endif
#ifdef LOGLUV_SUPPORT
extern int TIFFInitSGILog(TIFF*, int);
#endif
#ifdef LZMA_SUPPORT
extern int TIFFInitLZMA(TIFF*, int);
#endif
#ifdef VMS
extern const TIFFCodec _TIFFBuiltinCODECS[];
#else
extern TIFFCodec _TIFFBuiltinCODECS[];
#endif
#if defined(__cplusplus)
}
#endif
#endif /* _TIFFIOP_ */
/* vim: set ts=8 sts=8 sw=8 noet: */
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
| 15,758
|
C++
|
.h
| 334
| 45.374251
| 112
| 0.689754
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
28,164
|
uvcode.h
|
openMVG_openMVG/src/third_party/tiff/uvcode.h
|
/* Version 1.0 generated April 7, 1997 by Greg Ward Larson, SGI */
#define UV_SQSIZ (float)0.003500
#define UV_NDIVS 16289
#define UV_VSTART (float)0.016940
#define UV_NVS 163
static struct {
float ustart;
short nus, ncum;
} uv_row[UV_NVS] = {
{ (float)0.247663, 4, 0 },
{ (float)0.243779, 6, 4 },
{ (float)0.241684, 7, 10 },
{ (float)0.237874, 9, 17 },
{ (float)0.235906, 10, 26 },
{ (float)0.232153, 12, 36 },
{ (float)0.228352, 14, 48 },
{ (float)0.226259, 15, 62 },
{ (float)0.222371, 17, 77 },
{ (float)0.220410, 18, 94 },
{ (float)0.214710, 21, 112 },
{ (float)0.212714, 22, 133 },
{ (float)0.210721, 23, 155 },
{ (float)0.204976, 26, 178 },
{ (float)0.202986, 27, 204 },
{ (float)0.199245, 29, 231 },
{ (float)0.195525, 31, 260 },
{ (float)0.193560, 32, 291 },
{ (float)0.189878, 34, 323 },
{ (float)0.186216, 36, 357 },
{ (float)0.186216, 36, 393 },
{ (float)0.182592, 38, 429 },
{ (float)0.179003, 40, 467 },
{ (float)0.175466, 42, 507 },
{ (float)0.172001, 44, 549 },
{ (float)0.172001, 44, 593 },
{ (float)0.168612, 46, 637 },
{ (float)0.168612, 46, 683 },
{ (float)0.163575, 49, 729 },
{ (float)0.158642, 52, 778 },
{ (float)0.158642, 52, 830 },
{ (float)0.158642, 52, 882 },
{ (float)0.153815, 55, 934 },
{ (float)0.153815, 55, 989 },
{ (float)0.149097, 58, 1044 },
{ (float)0.149097, 58, 1102 },
{ (float)0.142746, 62, 1160 },
{ (float)0.142746, 62, 1222 },
{ (float)0.142746, 62, 1284 },
{ (float)0.138270, 65, 1346 },
{ (float)0.138270, 65, 1411 },
{ (float)0.138270, 65, 1476 },
{ (float)0.132166, 69, 1541 },
{ (float)0.132166, 69, 1610 },
{ (float)0.126204, 73, 1679 },
{ (float)0.126204, 73, 1752 },
{ (float)0.126204, 73, 1825 },
{ (float)0.120381, 77, 1898 },
{ (float)0.120381, 77, 1975 },
{ (float)0.120381, 77, 2052 },
{ (float)0.120381, 77, 2129 },
{ (float)0.112962, 82, 2206 },
{ (float)0.112962, 82, 2288 },
{ (float)0.112962, 82, 2370 },
{ (float)0.107450, 86, 2452 },
{ (float)0.107450, 86, 2538 },
{ (float)0.107450, 86, 2624 },
{ (float)0.107450, 86, 2710 },
{ (float)0.100343, 91, 2796 },
{ (float)0.100343, 91, 2887 },
{ (float)0.100343, 91, 2978 },
{ (float)0.095126, 95, 3069 },
{ (float)0.095126, 95, 3164 },
{ (float)0.095126, 95, 3259 },
{ (float)0.095126, 95, 3354 },
{ (float)0.088276, 100, 3449 },
{ (float)0.088276, 100, 3549 },
{ (float)0.088276, 100, 3649 },
{ (float)0.088276, 100, 3749 },
{ (float)0.081523, 105, 3849 },
{ (float)0.081523, 105, 3954 },
{ (float)0.081523, 105, 4059 },
{ (float)0.081523, 105, 4164 },
{ (float)0.074861, 110, 4269 },
{ (float)0.074861, 110, 4379 },
{ (float)0.074861, 110, 4489 },
{ (float)0.074861, 110, 4599 },
{ (float)0.068290, 115, 4709 },
{ (float)0.068290, 115, 4824 },
{ (float)0.068290, 115, 4939 },
{ (float)0.068290, 115, 5054 },
{ (float)0.063573, 119, 5169 },
{ (float)0.063573, 119, 5288 },
{ (float)0.063573, 119, 5407 },
{ (float)0.063573, 119, 5526 },
{ (float)0.057219, 124, 5645 },
{ (float)0.057219, 124, 5769 },
{ (float)0.057219, 124, 5893 },
{ (float)0.057219, 124, 6017 },
{ (float)0.050985, 129, 6141 },
{ (float)0.050985, 129, 6270 },
{ (float)0.050985, 129, 6399 },
{ (float)0.050985, 129, 6528 },
{ (float)0.050985, 129, 6657 },
{ (float)0.044859, 134, 6786 },
{ (float)0.044859, 134, 6920 },
{ (float)0.044859, 134, 7054 },
{ (float)0.044859, 134, 7188 },
{ (float)0.040571, 138, 7322 },
{ (float)0.040571, 138, 7460 },
{ (float)0.040571, 138, 7598 },
{ (float)0.040571, 138, 7736 },
{ (float)0.036339, 142, 7874 },
{ (float)0.036339, 142, 8016 },
{ (float)0.036339, 142, 8158 },
{ (float)0.036339, 142, 8300 },
{ (float)0.032139, 146, 8442 },
{ (float)0.032139, 146, 8588 },
{ (float)0.032139, 146, 8734 },
{ (float)0.032139, 146, 8880 },
{ (float)0.027947, 150, 9026 },
{ (float)0.027947, 150, 9176 },
{ (float)0.027947, 150, 9326 },
{ (float)0.023739, 154, 9476 },
{ (float)0.023739, 154, 9630 },
{ (float)0.023739, 154, 9784 },
{ (float)0.023739, 154, 9938 },
{ (float)0.019504, 158, 10092 },
{ (float)0.019504, 158, 10250 },
{ (float)0.019504, 158, 10408 },
{ (float)0.016976, 161, 10566 },
{ (float)0.016976, 161, 10727 },
{ (float)0.016976, 161, 10888 },
{ (float)0.016976, 161, 11049 },
{ (float)0.012639, 165, 11210 },
{ (float)0.012639, 165, 11375 },
{ (float)0.012639, 165, 11540 },
{ (float)0.009991, 168, 11705 },
{ (float)0.009991, 168, 11873 },
{ (float)0.009991, 168, 12041 },
{ (float)0.009016, 170, 12209 },
{ (float)0.009016, 170, 12379 },
{ (float)0.009016, 170, 12549 },
{ (float)0.006217, 173, 12719 },
{ (float)0.006217, 173, 12892 },
{ (float)0.005097, 175, 13065 },
{ (float)0.005097, 175, 13240 },
{ (float)0.005097, 175, 13415 },
{ (float)0.003909, 177, 13590 },
{ (float)0.003909, 177, 13767 },
{ (float)0.002340, 177, 13944 },
{ (float)0.002389, 170, 14121 },
{ (float)0.001068, 164, 14291 },
{ (float)0.001653, 157, 14455 },
{ (float)0.000717, 150, 14612 },
{ (float)0.001614, 143, 14762 },
{ (float)0.000270, 136, 14905 },
{ (float)0.000484, 129, 15041 },
{ (float)0.001103, 123, 15170 },
{ (float)0.001242, 115, 15293 },
{ (float)0.001188, 109, 15408 },
{ (float)0.001011, 103, 15517 },
{ (float)0.000709, 97, 15620 },
{ (float)0.000301, 89, 15717 },
{ (float)0.002416, 82, 15806 },
{ (float)0.003251, 76, 15888 },
{ (float)0.003246, 69, 15964 },
{ (float)0.004141, 62, 16033 },
{ (float)0.005963, 55, 16095 },
{ (float)0.008839, 47, 16150 },
{ (float)0.010490, 40, 16197 },
{ (float)0.016994, 31, 16237 },
{ (float)0.023659, 21, 16268 },
};
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
| 5,635
|
C++
|
.h
| 180
| 29.355556
| 66
| 0.593767
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,165
|
tif_predict.h
|
openMVG_openMVG/src/third_party/tiff/tif_predict.h
|
/* $Id: tif_predict.h,v 1.8 2010-03-10 18:56:49 bfriesen Exp $ */
/*
* Copyright (c) 1995-1997 Sam Leffler
* Copyright (c) 1995-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#ifndef _TIFFPREDICT_
#define _TIFFPREDICT_
/*
* ``Library-private'' Support for the Predictor Tag
*/
/*
* Codecs that want to support the Predictor tag must place
* this structure first in their private state block so that
* the predictor code can cast tif_data to find its state.
*/
typedef struct {
int predictor; /* predictor tag value */
tmsize_t stride; /* sample stride over data */
tmsize_t rowsize; /* tile/strip row size */
TIFFCodeMethod encoderow; /* parent codec encode/decode row */
TIFFCodeMethod encodestrip; /* parent codec encode/decode strip */
TIFFCodeMethod encodetile; /* parent codec encode/decode tile */
TIFFPostMethod encodepfunc; /* horizontal differencer */
TIFFCodeMethod decoderow; /* parent codec encode/decode row */
TIFFCodeMethod decodestrip; /* parent codec encode/decode strip */
TIFFCodeMethod decodetile; /* parent codec encode/decode tile */
TIFFPostMethod decodepfunc; /* horizontal accumulator */
TIFFVGetMethod vgetparent; /* super-class method */
TIFFVSetMethod vsetparent; /* super-class method */
TIFFPrintMethod printdir; /* super-class method */
TIFFBoolMethod setupdecode; /* super-class method */
TIFFBoolMethod setupencode; /* super-class method */
} TIFFPredictorState;
#if defined(__cplusplus)
extern "C" {
#endif
extern int TIFFPredictorInit(TIFF*);
extern int TIFFPredictorCleanup(TIFF*);
#if defined(__cplusplus)
}
#endif
#endif /* _TIFFPREDICT_ */
/* vim: set ts=8 sts=8 sw=8 noet: */
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
| 2,870
|
C++
|
.h
| 69
| 39.724638
| 78
| 0.75009
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
28,166
|
tiffconf.wince.h
|
openMVG_openMVG/src/third_party/tiff/tiffconf.wince.h
|
/* $Id: tiffconf.wince.h,v 1.3 2010-03-10 18:56:49 bfriesen Exp $ */
/*
* Windows CE platform tiffconf.wince.h
* Created by Mateusz Loskot (mateusz@loskot.net)
*
* NOTE: Requires WCELIBCEX library with wceex_* functions,
* It's an extension to C library on Windows CE platform.
* For example, HAVE_STDIO_H definition indicates there are
* following files available:
* stdio.h - from Windows CE / Windows Mobile SDK
* wce_stdio.h - from WCELIBCEX library
*/
/*
Configuration defines for installed libtiff.
This file maintained for backward compatibility. Do not use definitions
from this file in your programs.
*/
#ifndef _WIN32_WCE
# error This version of tif_config.h header is dedicated for Windows CE platform!
#endif
#ifndef _TIFFCONF_
#define _TIFFCONF_
/* Define to 1 if the system has the type `int16'. */
/* #undef HAVE_INT16 */
/* Define to 1 if the system has the type `int32'. */
/* #undef HAVE_INT32 */
/* Define to 1 if the system has the type `int8'. */
/* #undef HAVE_INT8 */
/* The size of a `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* Compatibility stuff. */
/* Define as 0 or 1 according to the floating point format suported by the
machine */
#define HAVE_IEEEFP 1
/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
#define HOST_FILLORDER FILLORDER_LSB2MSB
/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
(Intel) */
#define HOST_BIGENDIAN 0
/* Support CCITT Group 3 & 4 algorithms */
#define CCITT_SUPPORT 1
/* Support JPEG compression (requires IJG JPEG library) */
/* #undef JPEG_SUPPORT */
/* Support LogLuv high dynamic range encoding */
#define LOGLUV_SUPPORT 1
/* Support LZW algorithm */
#define LZW_SUPPORT 1
/* Support NeXT 2-bit RLE algorithm */
#define NEXT_SUPPORT 1
/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation
fails with unpatched IJG JPEG library) */
/* #undef OJPEG_SUPPORT */
/* Support Macintosh PackBits algorithm */
#define PACKBITS_SUPPORT 1
/* Support Pixar log-format algorithm (requires Zlib) */
/* #undef PIXARLOG_SUPPORT */
/* Support ThunderScan 4-bit RLE algorithm */
#define THUNDER_SUPPORT 1
/* Support Deflate compression */
/* #undef ZIP_SUPPORT */
/* Support strip chopping (whether or not to convert single-strip uncompressed
images to mutiple strips of ~8Kb to reduce memory usage) */
#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP
/* Enable SubIFD tag (330) support */
#define SUBIFD_SUPPORT 1
/* Treat extra sample as alpha (default enabled). The RGBA interface will
treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
packages produce RGBA files but don't mark the alpha properly. */
#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1
/* Pick up YCbCr subsampling info from the JPEG data stream to support files
lacking the tag (default enabled). */
#define CHECK_JPEG_YCBCR_SUBSAMPLING 1
/*
* Feature support definitions.
* XXX: These macros are obsoleted. Don't use them in your apps!
* Macros stays here for backward compatibility and should be always defined.
*/
#define COLORIMETRY_SUPPORT
#define YCBCR_SUPPORT
#define CMYK_SUPPORT
#define ICC_SUPPORT
#define PHOTOSHOP_SUPPORT
#define IPTC_SUPPORT
#endif /* _TIFFCONF_ */
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
| 3,346
|
C++
|
.h
| 91
| 34.912088
| 81
| 0.752248
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
28,167
|
tif_config.wince.h
|
openMVG_openMVG/src/third_party/tiff/tif_config.wince.h
|
/* $Id: tif_config.wince.h,v 1.3 2010-03-10 18:56:48 bfriesen Exp $ */
/*
* TIFF library configuration header for Windows CE platform.
*/
#ifndef _WIN32_WCE
# error This version of tif_config.h header is dedicated for Windows CE platform!
#endif
/* Define to 1 if you have the <assert.h> header file. */
#define HAVE_ASSERT_H 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define as 0 or 1 according to the floating point format suported by the
machine */
#define HAVE_IEEEFP 1
/* Define to 1 if you have the `jbg_newlen' function. */
#define HAVE_JBG_NEWLEN 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <io.h> header file. */
#define HAVE_IO_H 1
/* Define to 1 if you have the <search.h> header file. */
#define HAVE_SEARCH_H 1
/* Define to 1 if you have the `setmode' function. */
#define HAVE_SETMODE 1
/* Define to 1 if you have the `bsearch' function. */
#define HAVE_BSEARCH 1
#define bsearch wceex_bsearch
/* Define to 1 if you have the `lfind' function. */
#define HAVE_LFIND 1
#define lfind wceex_lfind
/* The size of a `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* Set the native cpu bit order */
#define HOST_FILLORDER FILLORDER_LSB2MSB
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
# ifndef inline
# define inline __inline
# endif
#endif
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
| 1,852
|
C++
|
.h
| 53
| 33.283019
| 81
| 0.717013
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
28,168
|
tif_dir.h
|
openMVG_openMVG/src/third_party/tiff/tif_dir.h
|
/* $Id: tif_dir.h,v 1.54 2011-02-18 20:53:05 fwarmerdam Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#ifndef _TIFFDIR_
#define _TIFFDIR_
/*
* ``Library-private'' Directory-related Definitions.
*/
typedef struct {
const TIFFField *info;
int count;
void *value;
} TIFFTagValue;
/*
* TIFF Image File Directories are comprised of a table of field
* descriptors of the form shown below. The table is sorted in
* ascending order by tag. The values associated with each entry are
* disjoint and may appear anywhere in the file (so long as they are
* placed on a word boundary).
*
* If the value is 4 bytes or less, in ClassicTIFF, or 8 bytes or less in
* BigTIFF, then it is placed in the offset field to save space. If so,
* it is left-justified in the offset field.
*/
typedef struct {
uint16 tdir_tag; /* see below */
uint16 tdir_type; /* data type; see below */
uint64 tdir_count; /* number of items; length in spec */
union {
uint16 toff_short;
uint32 toff_long;
uint64 toff_long8;
} tdir_offset; /* either offset or the data itself if fits */
} TIFFDirEntry;
/*
* Internal format of a TIFF directory entry.
*/
typedef struct {
#define FIELD_SETLONGS 4
/* bit vector of fields that are set */
unsigned long td_fieldsset[FIELD_SETLONGS];
uint32 td_imagewidth, td_imagelength, td_imagedepth;
uint32 td_tilewidth, td_tilelength, td_tiledepth;
uint32 td_subfiletype;
uint16 td_bitspersample;
uint16 td_sampleformat;
uint16 td_compression;
uint16 td_photometric;
uint16 td_threshholding;
uint16 td_fillorder;
uint16 td_orientation;
uint16 td_samplesperpixel;
uint32 td_rowsperstrip;
uint16 td_minsamplevalue, td_maxsamplevalue;
double* td_sminsamplevalue;
double* td_smaxsamplevalue;
float td_xresolution, td_yresolution;
uint16 td_resolutionunit;
uint16 td_planarconfig;
float td_xposition, td_yposition;
uint16 td_pagenumber[2];
uint16* td_colormap[3];
uint16 td_halftonehints[2];
uint16 td_extrasamples;
uint16* td_sampleinfo;
/* even though the name is misleading, td_stripsperimage is the number
* of striles (=strips or tiles) per plane, and td_nstrips the total
* number of striles */
uint32 td_stripsperimage;
uint32 td_nstrips; /* size of offset & bytecount arrays */
uint64* td_stripoffset;
uint64* td_stripbytecount;
int td_stripbytecountsorted; /* is the bytecount array sorted ascending? */
#if defined(DEFER_STRILE_LOAD)
TIFFDirEntry td_stripoffset_entry; /* for deferred loading */
TIFFDirEntry td_stripbytecount_entry; /* for deferred loading */
#endif
uint16 td_nsubifd;
uint64* td_subifd;
/* YCbCr parameters */
uint16 td_ycbcrsubsampling[2];
uint16 td_ycbcrpositioning;
/* Colorimetry parameters */
uint16* td_transferfunction[3];
float* td_refblackwhite;
/* CMYK parameters */
int td_inknameslen;
char* td_inknames;
int td_customValueCount;
TIFFTagValue *td_customValues;
} TIFFDirectory;
/*
* Field flags used to indicate fields that have been set in a directory, and
* to reference fields when manipulating a directory.
*/
/*
* FIELD_IGNORE is used to signify tags that are to be processed but otherwise
* ignored. This permits antiquated tags to be quietly read and discarded.
* Note that a bit *is* allocated for ignored tags; this is understood by the
* directory reading logic which uses this fact to avoid special-case handling
*/
#define FIELD_IGNORE 0
/* multi-item fields */
#define FIELD_IMAGEDIMENSIONS 1
#define FIELD_TILEDIMENSIONS 2
#define FIELD_RESOLUTION 3
#define FIELD_POSITION 4
/* single-item fields */
#define FIELD_SUBFILETYPE 5
#define FIELD_BITSPERSAMPLE 6
#define FIELD_COMPRESSION 7
#define FIELD_PHOTOMETRIC 8
#define FIELD_THRESHHOLDING 9
#define FIELD_FILLORDER 10
#define FIELD_ORIENTATION 15
#define FIELD_SAMPLESPERPIXEL 16
#define FIELD_ROWSPERSTRIP 17
#define FIELD_MINSAMPLEVALUE 18
#define FIELD_MAXSAMPLEVALUE 19
#define FIELD_PLANARCONFIG 20
#define FIELD_RESOLUTIONUNIT 22
#define FIELD_PAGENUMBER 23
#define FIELD_STRIPBYTECOUNTS 24
#define FIELD_STRIPOFFSETS 25
#define FIELD_COLORMAP 26
#define FIELD_EXTRASAMPLES 31
#define FIELD_SAMPLEFORMAT 32
#define FIELD_SMINSAMPLEVALUE 33
#define FIELD_SMAXSAMPLEVALUE 34
#define FIELD_IMAGEDEPTH 35
#define FIELD_TILEDEPTH 36
#define FIELD_HALFTONEHINTS 37
#define FIELD_YCBCRSUBSAMPLING 39
#define FIELD_YCBCRPOSITIONING 40
#define FIELD_REFBLACKWHITE 41
#define FIELD_TRANSFERFUNCTION 44
#define FIELD_INKNAMES 46
#define FIELD_SUBIFD 49
/* FIELD_CUSTOM (see tiffio.h) 65 */
/* end of support for well-known tags; codec-private tags follow */
#define FIELD_CODEC 66 /* base of codec-private tags */
/*
* Pseudo-tags don't normally need field bits since they are not written to an
* output file (by definition). The library also has express logic to always
* query a codec for a pseudo-tag so allocating a field bit for one is a
* waste. If codec wants to promote the notion of a pseudo-tag being ``set''
* or ``unset'' then it can do using internal state flags without polluting
* the field bit space defined for real tags.
*/
#define FIELD_PSEUDO 0
#define FIELD_LAST (32*FIELD_SETLONGS-1)
#define BITn(n) (((unsigned long)1L)<<((n)&0x1f))
#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n)/32])
#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field))
#define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field))
#define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field))
#define FieldSet(fields, f) (fields[(f)/32] & BITn(f))
#define ResetFieldBit(fields, f) (fields[(f)/32] &= ~BITn(f))
typedef enum {
TIFF_SETGET_UNDEFINED = 0,
TIFF_SETGET_ASCII = 1,
TIFF_SETGET_UINT8 = 2,
TIFF_SETGET_SINT8 = 3,
TIFF_SETGET_UINT16 = 4,
TIFF_SETGET_SINT16 = 5,
TIFF_SETGET_UINT32 = 6,
TIFF_SETGET_SINT32 = 7,
TIFF_SETGET_UINT64 = 8,
TIFF_SETGET_SINT64 = 9,
TIFF_SETGET_FLOAT = 10,
TIFF_SETGET_DOUBLE = 11,
TIFF_SETGET_IFD8 = 12,
TIFF_SETGET_INT = 13,
TIFF_SETGET_UINT16_PAIR = 14,
TIFF_SETGET_C0_ASCII = 15,
TIFF_SETGET_C0_UINT8 = 16,
TIFF_SETGET_C0_SINT8 = 17,
TIFF_SETGET_C0_UINT16 = 18,
TIFF_SETGET_C0_SINT16 = 19,
TIFF_SETGET_C0_UINT32 = 20,
TIFF_SETGET_C0_SINT32 = 21,
TIFF_SETGET_C0_UINT64 = 22,
TIFF_SETGET_C0_SINT64 = 23,
TIFF_SETGET_C0_FLOAT = 24,
TIFF_SETGET_C0_DOUBLE = 25,
TIFF_SETGET_C0_IFD8 = 26,
TIFF_SETGET_C16_ASCII = 27,
TIFF_SETGET_C16_UINT8 = 28,
TIFF_SETGET_C16_SINT8 = 29,
TIFF_SETGET_C16_UINT16 = 30,
TIFF_SETGET_C16_SINT16 = 31,
TIFF_SETGET_C16_UINT32 = 32,
TIFF_SETGET_C16_SINT32 = 33,
TIFF_SETGET_C16_UINT64 = 34,
TIFF_SETGET_C16_SINT64 = 35,
TIFF_SETGET_C16_FLOAT = 36,
TIFF_SETGET_C16_DOUBLE = 37,
TIFF_SETGET_C16_IFD8 = 38,
TIFF_SETGET_C32_ASCII = 39,
TIFF_SETGET_C32_UINT8 = 40,
TIFF_SETGET_C32_SINT8 = 41,
TIFF_SETGET_C32_UINT16 = 42,
TIFF_SETGET_C32_SINT16 = 43,
TIFF_SETGET_C32_UINT32 = 44,
TIFF_SETGET_C32_SINT32 = 45,
TIFF_SETGET_C32_UINT64 = 46,
TIFF_SETGET_C32_SINT64 = 47,
TIFF_SETGET_C32_FLOAT = 48,
TIFF_SETGET_C32_DOUBLE = 49,
TIFF_SETGET_C32_IFD8 = 50,
TIFF_SETGET_OTHER = 51
} TIFFSetGetFieldType;
#if defined(__cplusplus)
extern "C" {
#endif
extern const TIFFFieldArray* _TIFFGetFields(void);
extern const TIFFFieldArray* _TIFFGetExifFields(void);
extern void _TIFFSetupFields(TIFF* tif, const TIFFFieldArray* infoarray);
extern void _TIFFPrintFieldInfo(TIFF*, FILE*);
extern int _TIFFFillStriles(TIFF*);
typedef enum {
tfiatImage,
tfiatExif,
tfiatOther
} TIFFFieldArrayType;
struct _TIFFFieldArray {
TIFFFieldArrayType type; /* array type, will be used to determine if IFD is image and such */
uint32 allocated_size; /* 0 if array is constant, other if modified by future definition extension support */
uint32 count; /* number of elements in fields array */
TIFFField* fields; /* actual field info */
};
struct _TIFFField {
uint32 field_tag; /* field's tag */
short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */
short field_writecount; /* write count/TIFF_VARIABLE */
TIFFDataType field_type; /* type of associated data */
uint32 reserved; /* reserved for future extension */
TIFFSetGetFieldType set_field_type; /* type to be passed to TIFFSetField */
TIFFSetGetFieldType get_field_type; /* type to be passed to TIFFGetField */
unsigned short field_bit; /* bit in fieldsset bit vector */
unsigned char field_oktochange; /* if true, can change while writing */
unsigned char field_passcount; /* if true, pass dir count on set */
char* field_name; /* ASCII name */
TIFFFieldArray* field_subfields; /* if field points to child ifds, child ifd field definition array */
};
extern int _TIFFMergeFields(TIFF*, const TIFFField[], uint32);
extern const TIFFField* _TIFFFindOrRegisterField(TIFF *, uint32, TIFFDataType);
extern TIFFField* _TIFFCreateAnonField(TIFF *, uint32, TIFFDataType);
#if defined(__cplusplus)
}
#endif
#endif /* _TIFFDIR_ */
/* vim: set ts=8 sts=8 sw=8 noet: */
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/
| 10,918
|
C++
|
.h
| 281
| 36.928826
| 115
| 0.705372
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
28,171
|
TestHarness.h
|
openMVG_openMVG/src/third_party/CppUnitLite/TestHarness.h
|
///////////////////////////////////////////////////////////////////////////////
//
// TESTHARNESS.H
//
// The primary include file for the framework.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef TESTHARNESS_H
#define TESTHARNESS_H
#include "Test.h"
#include "TestResult.h"
#include "Failure.h"
#include "TestRegistry.h"
#endif
| 378
|
C++
|
.h
| 14
| 25.642857
| 79
| 0.427778
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
28,285
|
Tracker_opencv_klt.hpp
|
openMVG_openMVG/src/software/VO/Tracker_opencv_klt.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2014 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef TRACKER_OPENCV_KLT_HPP
#define TRACKER_OPENCV_KLT_HPP
// OpenCV Includes
#include <opencv2/core/eigen.hpp> //To Convert Eigen matrix to cv matrix
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/video/tracking.hpp>
#include <software/VO/Abstract_Tracker.hpp>
#include <vector>
namespace openMVG {
namespace VO {
/// OpenCV based KLT tracker
struct Tracker_opencv_KLT : public Abstract_Tracker
{
// data for tracking
cv::Mat current_img_, prev_img_;
std::vector<cv::Point2f> prevPts_, nextPts_;
std::vector<float> error_;
/// Try to track current point set in the provided image
/// return false when tracking failed (=> to send frame to relocalization)
bool track
(
const image::Image<unsigned char> & ima,
const std::vector<features::PointFeature> & pt_to_track,
std::vector<features::PointFeature> & pt_tracked,
std::vector<bool> & status
) override
{
cv::eigen2cv(ima.GetMat(), current_img_);
if (!pt_to_track.empty())
{
prevPts_.resize(pt_to_track.size());
nextPts_.resize(pt_to_track.size());
for (size_t i=0; i < pt_to_track.size(); ++i)
{
prevPts_[i].x = pt_to_track[i].x();
prevPts_[i].y = pt_to_track[i].y();
}
std::vector<unsigned char> status_uchar;
cv::calcOpticalFlowPyrLK(prev_img_, current_img_, prevPts_, nextPts_, status_uchar, error_);
status.assign(status_uchar.begin(), status_uchar.end());
for (size_t i=0; i < nextPts_.size(); ++i)
{
pt_tracked[i].coords() << nextPts_[i].x, nextPts_[i].y;
}
}
// swap frame for next tracking iteration
current_img_.copyTo(prev_img_);
const size_t tracked_point_count = std::accumulate(status.begin(), status.end(), 0);
return (tracked_point_count != 0);
}
// suggest new feature point for tracking (count point are kept)
bool detect
(
const image::Image<unsigned char> & ima,
std::vector<features::PointFeature> & pt_to_track,
const size_t count
) const override
{
cv::Mat current_img;
cv::eigen2cv(ima.GetMat(), current_img);
std::vector<cv::KeyPoint> m_nextKeypoints;
cv::Ptr<cv::FeatureDetector> m_detector = cv::GFTTDetector::create(count);
if (!m_detector)
return false;
m_detector->detect(current_img, m_nextKeypoints);
if (m_nextKeypoints.size() >= count)
{
// shuffle to avoid to sample only in one bucket
std::mt19937 gen(std::mt19937::default_seed);
std::shuffle(m_nextKeypoints.begin(), m_nextKeypoints.end(), gen);
}
const size_t kept_kp_count = std::min(m_nextKeypoints.size(), count);
m_nextKeypoints.resize(kept_kp_count);
pt_to_track.resize(kept_kp_count);
for (size_t i = 0; i < kept_kp_count; ++i)
pt_to_track[i] = features::PointFeature(m_nextKeypoints[i].pt.x, m_nextKeypoints[i].pt.y);
return kept_kp_count != 0;
// Return false if no point can be added
}
};
} // namespace VO
} // namespace openMVG
#endif // TRACKER_OPENCV_KLT_HPP
| 3,348
|
C++
|
.h
| 88
| 33.681818
| 98
| 0.673564
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,286
|
Tracker.hpp
|
openMVG_openMVG/src/software/VO/Tracker.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2014 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef TRACKER_VO_HPP
#define TRACKER_VO_HPP
#include <software/VO/Abstract_Tracker.hpp>
#include <openMVG/features/dipole/dipole_descriptor.hpp>
#include <openMVG/features/fast/fast_detector.hpp>
#include <openMVG/features/feature.hpp>
#include <openMVG/features/feature_container.hpp>
#include "openMVG/matching/metric.hpp"
#include <random>
#include <vector>
namespace openMVG {
namespace VO {
// Implement tracking by description:
// - Each tracked point uses a local description and is tracked thanks to descriptor matching
struct Tracker_fast_dipole final: public Abstract_Tracker
{
// data for tracking
image::Image<unsigned char> _prev_img;
/// Try to track current point set in the provided image
/// return false when tracking failed (=> to send frame to relocalization)
bool track
(
const image::Image<unsigned char> & ima,
const std::vector<features::PointFeature> & pt_to_track,
std::vector<features::PointFeature> & pt_tracked,
std::vector<bool> & status
) override
{
if (!pt_to_track.empty())
{
const features::PointFeatures & _prevPts = pt_to_track;
//-- Compute descriptors for the previous tracked point and perform matching
std::vector<float> prev_descriptors(20*pt_to_track.size());
for (size_t i=0; i < pt_to_track.size(); ++i)
{
features::PickASDipole(_prev_img, _prevPts[i].x(), _prevPts[i].y(), 10.5f, 0.0f, &prev_descriptors[i*20]);
}
features::PointFeatures current_feats;
features::FastCornerDetector fastCornerDetector(9, 5);
fastCornerDetector.detect(ima, current_feats);
std::vector<float> current_descriptors(20*current_feats.size());
for (size_t i=0; i < current_feats.size(); ++i)
{
features::PickASDipole(ima, current_feats[i].x(), current_feats[i].y(), 10.5f, 0.0f, ¤t_descriptors[i*20]);
}
// Compute the matches
{
#ifdef OPENMVG_USE_OPENMP
#pragma omp parallel for schedule(dynamic)
#endif
for (int i=0; i < (int)pt_to_track.size(); ++i)
{
size_t best_idx = std::numeric_limits<size_t>::infinity();
typedef openMVG::matching::L2<float> metricT;
metricT metric;
metricT::ResultType best_distance = 30;//std::numeric_limits<double>::infinity();
for (size_t j=0; j < current_feats.size(); ++j)
{
// Spatial filter
//if ((pt_to_track[i].coords() - current_feats[j].coords()).norm() > 50)
// continue; // Too much distance between the feat, it is not necessary to compute the descriptor distance
metricT::ResultType distance = metric(&prev_descriptors[i*20], ¤t_descriptors[j*20], 20);
if (distance < best_distance)
{
best_idx = j;
best_distance = distance;
}
}
if (best_idx != std::numeric_limits<size_t>::infinity())
{
pt_tracked[i].coords() << current_feats[best_idx].x(), current_feats[best_idx].y();
status[i] = true;
}
else
{
status[i] = false;
}
}
}
}
// swap frame for the next tracking iteration
_prev_img = ima;
const size_t tracked_point_count = std::accumulate(status.begin(), status.end(), 0);
return (tracked_point_count != 0);
}
// suggest new feature point for tracking (count point are kept)
bool detect
(
const image::Image<unsigned char> & ima,
std::vector<features::PointFeature> & pt_to_track,
const size_t count
) const override
{
std::mt19937 gen(std::mt19937::default_seed);
const std::vector<unsigned char> scores = {30, 20, 10, 5};
// use a sequence of scores 'in order to deal with lighting change'
features::PointFeatures feats;
for (const unsigned char fast_score : scores)
{
features::FastCornerDetector fastCornerDetector(9, fast_score);
fastCornerDetector.detect(ima, feats);
if (feats.size() > count)
{
// shuffle to avoid to sample only in one bucket
std::shuffle(feats.begin(), feats.end(), gen);
feats.resize(count); // cut the array to keep only a given count of features
pt_to_track.swap(feats);
return true;
}
feats.clear();
}
return false; // Cannot compute a sufficient number of points for the given image
}
};
} // namespace VO
} // namespace openMVG
#endif // TRACKER_VO_HPP
| 4,836
|
C++
|
.h
| 122
| 33.295082
| 121
| 0.646357
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,287
|
CGlWindow.hpp
|
openMVG_openMVG/src/software/VO/CGlWindow.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2014 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef CGLWINDOW_HPP
#define CGLWINDOW_HPP
//include header file for glfw library so that we can use OpenGL
#if defined(__APPLE__)
#include <OpenGL/gl.h>
#endif
#include <GLFW/glfw3.h>
/// Basic class to handle a GLFW window (no interaction)
/// GLFW have be initialized before calling this class
struct CGlWindow
{
bool _bRunning;
GLFWwindow * _window;
int _width, _height;
CGlWindow() : _window(NULL), _width(-1), _height(-1), _bRunning(false) { }
bool Init(int w, int h, const std::string & sWindowName)
{
glfwWindowHint(GLFW_DEPTH_BITS, 16);
_width = w;
_height = h;
_window = glfwCreateWindow( w, h, sWindowName.c_str(), NULL, NULL );
if (!_window)
{
glfwTerminate();
return false;
}
else
{
_bRunning = true;
}
glfwMakeContextCurrent(_window);
glfwSwapInterval( 1 );
return true;
}
void SetOrtho(int W, int H)
{
//Draw full screen image
glViewport( 0, 0, _width, _height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, W, H, 0.0, -1, 1);
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
}
void DrawFullScreenTexQuad(int W, int H)
{
// Draw a fullscreen Image Quad
glBegin(GL_QUADS);
glColor4f(1.f, 1.f, 1.f, 1.f);
glTexCoord2f(0.0f, 0.0f); glVertex3f(0.f, 0.f, 0.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f(GLfloat(W), 0.0f, 0.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f(GLfloat(W), GLfloat(H), 0.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(0.f, GLfloat(H), 0.0f);
glEnd();
}
void Swap()
{
glfwSwapBuffers(_window);
glfwPollEvents(); // Poll for and process events
}
};
#endif // CGLWINDOW_HPP
| 2,011
|
C++
|
.h
| 67
| 26.208955
| 76
| 0.66459
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,288
|
Monocular_VO.hpp
|
openMVG_openMVG/src/software/VO/Monocular_VO.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2014 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef MONOCULAR_VO_HPP
#define MONOCULAR_VO_HPP
#include <deque>
#include <iostream>
#include <numeric>
#include <set>
#include "openMVG/features/feature.hpp"
#include "openMVG/image/image_container.hpp"
#include "openMVG/numeric/eigen_alias_definition.hpp"
#include "openMVG/sfm/sfm_landmark.hpp"
#include "software/VO/Abstract_Tracker.hpp"
namespace openMVG {
namespace VO {
/// Store an image observation of a landmark
struct Measurement
{
Measurement
(
const uint32_t & frameId,
const Vec2f & p
): frameId_(frameId), pos_(p)
{ }
Measurement( const Measurement & src ) = default;
uint32_t frameId_;
Vec2f pos_;
};
/// A 3D point with it's associated image observations
struct Landmark
{
Landmark():pt_(-1,-1,-1) {}
Vec3 pt_;
std::deque<Measurement> obs_;
};
/// Function that converts VO landmark observations to the OpenMVG sfm landmark format.
inline bool ConvertVOLandmarkToSfMDataLandmark
(
const std::deque<openMVG::VO::Landmark> & vo_landmark,
openMVG::sfm::Landmarks & sfm_landmark
)
{
for (size_t idx = 0; idx < vo_landmark.size(); ++idx)
{
// Create a sfm_landmark
sfm::Landmark landmark;
sfm::Observations & obs = landmark.obs;
for (const auto & track_it : vo_landmark.at(idx).obs_)
{
obs[track_it.frameId_].x = track_it.pos_.cast<double>();
}
sfm_landmark.insert({idx, landmark});
}
return true;
}
/// Monocular test interface
struct VO_Monocular
{
// Structure and visibility
std::deque<Landmark> landmark_;
std::vector<uint32_t> trackedLandmarkIds_;
// Landmark Id per frame (for easier pairing)
std::deque<std::set<uint32_t>> landmarkListPerFrame_;
// Tracking
Abstract_Tracker * tracker_;
uint32_t maxTrackedFeatures_;
std::vector<features::PointFeature> pt_to_track_, pt_tracked_;
std::vector<bool> tracking_status_;
VO_Monocular
(
Abstract_Tracker * tracker,
const uint32_t maxTrackedFeatures = 1500
// Add an abstract camera model here
)
: tracker_(tracker),
maxTrackedFeatures_(maxTrackedFeatures)
{
}
bool nextFrame
(
const image::Image<unsigned char> & ima,
const size_t frameId
)
{
const bool bTrackerStatus = tracker_->track(ima, pt_to_track_, pt_tracked_, tracking_status_);
std::cout << (int) bTrackerStatus << " : tracker status" << std::endl;
landmarkListPerFrame_.emplace_back(std::set<uint32_t>());
if (landmarkListPerFrame_.size()==1 || bTrackerStatus)
{
// Update landmark observation
// Update tracking point set (if necessary)
// Compute pose if ?
// Refine if ?
//-- Update landmark observation
#ifdef OPENMVG_USE_OPENMP
#pragma omp parallel for schedule(dynamic)
#endif
for (int i = 0; i < (int)tracking_status_.size(); ++i)
{
if (tracking_status_[i]) // if the feature has been tracked
{
const features::PointFeature & a = pt_to_track_[i];
const features::PointFeature b = pt_tracked_[i];
// Use a spatial filter to remove features that moved too much
if ((a.coords() - b.coords()).norm() < ima.Width()*.08)
{
const auto tracker_landmark_id = trackedLandmarkIds_[i];
#ifdef OPENMVG_USE_OPENMP
#pragma omp critical
#endif
{
landmark_[tracker_landmark_id].obs_.emplace_back(frameId , b.coords());
landmarkListPerFrame_.back().insert(tracker_landmark_id);
}
pt_to_track_[i] = b; // update the tracked point
}
else // the feature does not longer appear or tracking failed to find the feature
{
tracking_status_[i] = 0;
}
}
else
{
// feature was not tracked
}
}
// Count the number of tracked features
const size_t countTracked = std::accumulate(tracking_status_.cbegin(), tracking_status_.cend(), 0);
std::cout << "#tracked: " << countTracked << std::endl;
// try compute pose and decide if it's a Keyframe
if (frameId > 0 && landmarkListPerFrame_.size() > 1)
{
size_t lastKf = frameId-1;
std::vector<uint32_t> ids;
ids.reserve(std::min(landmarkListPerFrame_[lastKf].size(), landmarkListPerFrame_[frameId].size()));
std::set_intersection(
landmarkListPerFrame_[lastKf].cbegin(), landmarkListPerFrame_[lastKf].cend(),
landmarkListPerFrame_[frameId].cbegin(), landmarkListPerFrame_[frameId].cend(),
std::back_inserter(ids));
std::cout << "Track in common with the last Keyframe: " << ids.size() << std::endl;
}
// Update tracking point set (if necessary)
if (countTracked < maxTrackedFeatures_)
{
if (pt_to_track_.empty())
{
pt_to_track_.resize(maxTrackedFeatures_);
pt_tracked_.resize(maxTrackedFeatures_);
trackedLandmarkIds_.resize(maxTrackedFeatures_);
tracking_status_.resize(maxTrackedFeatures_);
std::fill(tracking_status_.begin(), tracking_status_.end(), false);
}
// add some new feature
const size_t count = maxTrackedFeatures_ - countTracked;
std::vector<features::PointFeature> new_pt;
new_pt.reserve(maxTrackedFeatures_);
if (tracker_->detect(ima, new_pt, count))
{
std::cout << "#features added: " << new_pt.size() << std::endl;
size_t j = 0;
for (size_t i = 0; i < tracking_status_.size(); ++i)
{
if (!tracking_status_[i])
{
// Create a new landmark
Landmark landmark;
landmark.obs_.emplace_back(frameId, new_pt[j].coords());
landmark_.push_back(landmark);
// a new landmark ID have be tracked
trackedLandmarkIds_[i] = landmark_.size()-1;
landmarkListPerFrame_.back().insert(landmark_.size() - 1);
pt_to_track_[i] = new_pt[j];
++j;
}
}
std::cout << "_landmark.size() " << landmark_.size() << std::endl;
}
}
}
if (!bTrackerStatus)
{
// re-localization
}
return bTrackerStatus;
}
};
} // namespace VO
} // namespace openMVG
#endif // MONOCULAR_VO_HPP
| 6,658
|
C++
|
.h
| 192
| 28.260417
| 107
| 0.627466
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,289
|
Abstract_Tracker.hpp
|
openMVG_openMVG/src/software/VO/Abstract_Tracker.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2014 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
namespace openMVG { namespace Image { template<typename T> class Image; } }
namespace openMVG {
namespace VO {
struct Abstract_Tracker
{
Abstract_Tracker() = default;
public:
// Try to track the pt_to_track features
virtual bool track
(
const image::Image<unsigned char> & ima,
const std::vector<features::PointFeature> & pt_to_track,
std::vector<features::PointFeature> & pt_tracked,
std::vector<bool> & status
) = 0;
// suggest new feature point for tracking (count point are kept)
virtual bool detect
(
const image::Image<unsigned char> & ima,
std::vector<features::PointFeature> & pt_to_track,
const size_t count
) const = 0;
};
} // namespace VO
} // namespace openMVG
| 1,061
|
C++
|
.h
| 31
| 31.419355
| 76
| 0.716667
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,290
|
ControlButtonsPanel.hpp
|
openMVG_openMVG/src/software/VO/AlternativeVO/ControlButtonsPanel.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2016 Romuald Perrot
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef ALTERNATIVE_VO_CONTROL_BUTTONS_PANEL_HPP_
#define ALTERNATIVE_VO_CONTROL_BUTTONS_PANEL_HPP_
#include <QWidget>
#include <QPushButton>
namespace alternative_vo
{
class ControlButtonsPanel : public QWidget
{
Q_OBJECT
public:
ControlButtonsPanel( QWidget * parent );
/**
* @brief Enable/disable all buttons
* @param enabled True to enable, false to disable
*/
void EnableButtons( const bool enabled );
/**
* @brief Enable/disable play button
* @param enabled True to enable, false to disable
*/
void EnablePlayBtn( const bool enabled );
/**
* @brief Enable/disable stop button
* @param enabled True to enable, false to disable
*/
void EnableStopBtn( const bool enabled );
/**
* @brief Enable/disable forward button
* @param enabled True to enable, false to disable
*/
void EnableForwardBtn( const bool enabled );
/**
* @brief Enable/disable reset button
* @param enabled True to enable, false to disable
*/
void EnableResetBtn( const bool enabled );
public slots:
// Action executed when user click play button
void onClickPlayBtn( void );
// Action executed when user click stop button
void onClickStopBtn( void );
// Action executed when user click forward button
void onClickForwardBtn( void );
// Action executed when user click reset button
void onClickResetBtn( void );
signals:
// Signal emitted after user click the play button
void hasClickedPlay( void );
// Signal emitted after user click the stop button
void hasClickedStop( void );
// Signal emitted after user click the forward button
void hasClickedForward( void );
// Signal emitted after user click the reset button
void hasClickedReset( void );
private:
void BuildInterface( void );
void MakeConnections( void );
QPushButton * m_btn_reset;
QPushButton * m_btn_stop;
QPushButton * m_btn_play;
QPushButton * m_btn_forward;
};
}
#endif
| 2,346
|
C++
|
.h
| 69
| 29.753623
| 76
| 0.711121
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,291
|
VOFolderProcessor.hpp
|
openMVG_openMVG/src/software/VO/AlternativeVO/VOFolderProcessor.hpp
|
// Copyright (c) 2016 Romuald Perrot
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef ALTERNATIVE_VO_VO_FOLDER_PROCESSOR_HPP_
#define ALTERNATIVE_VO_VO_FOLDER_PROCESSOR_HPP_
#include "software/VO/AlternativeVO/VOViewerDrawableElements.hpp"
#include "software/VO/Monocular_VO.hpp"
#include <string>
#include <vector>
namespace openMVG {
namespace VO {
struct Abstract_Tracker;
}
}
namespace alternative_vo
{
/**
* @brief Class encapsulating VO processing of an image folder
*/
class VOFolderProcessor
{
public:
explicit VOFolderProcessor( const std::string & inputFolder );
/**
* @brief Reset processing to the begining
*/
void Reset( void );
/**
* @brief get current filename beeing processed
*/
std::string CurrentFileName( void );
/**
* @brief get full filename for a given id
* @retval empty string if id is out of range
* @retval full path for given id if id is in valid range
*/
std::string FullFileName( const size_t id );
/**
* @brief get current frame ID
*/
size_t CurrentFrameID( void );
/**
* @brief Get total number of frame
*/
size_t NbFrame( void );
/**
* @brief Try to step forward
* @retval false if process has ended
* @retval true if new image could be processed
*/
bool StepForward( void );
/**
* @brief Get current position of the tracked points
*/
std::vector< VOViewerPoint > GetCurrentTrackedPoints( void ) const;
/**
* @brief Get current position of the newly created points in the last processed frame
*/
std::vector< VOViewerPoint > GetCreatedPoints( void ) const;
/**
* @brief Get for each tracked points, their full trajectories
*/
std::vector< VOViewerLine > GetCurrentTrackTrajectories( void ) const;
private:
std::string m_input_folder;
std::vector< std::string> m_input_files;
std::unique_ptr<openMVG::VO::VO_Monocular> m_monocular_vo;
std::unique_ptr<openMVG::VO::Abstract_Tracker> m_tracker;
size_t m_current_file_ID;
};
}
#endif
| 2,239
|
C++
|
.h
| 73
| 26.753425
| 89
| 0.695936
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,292
|
VOViewerPanel.hpp
|
openMVG_openMVG/src/software/VO/AlternativeVO/VOViewerPanel.hpp
|
// Copyright (c) 2016 Romuald Perrot
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef ALTERNATIVE_VO_VO_VIEWER_PANNEL_HPP_
#define ALTERNATIVE_VO_VO_VIEWER_PANNEL_HPP_
#include "software/VO/AlternativeVO/VOViewerDrawableElements.hpp"
#include "openMVG/numeric/numeric.h"
#include <QLabel>
#include <QWidget>
#include <QImage>
namespace alternative_vo
{
class VOViewerPanel : public QWidget
{
public:
explicit VOViewerPanel( QWidget * parent );
void SetImage( QImage & img );
/**
* @brief Set an image and draw some elements on it
* @param lines List of lines to draw
*/
void SetImage( QImage & img , const std::vector< VOViewerLine > & lines , const std::vector< VOViewerPoint > & points );
private:
void BuildInterface( void );
void MakeConnections( void );
QLabel * m_image_view;
};
}
#endif
| 1,014
|
C++
|
.h
| 30
| 30.833333
| 124
| 0.729618
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,293
|
MainWindow.hpp
|
openMVG_openMVG/src/software/VO/AlternativeVO/MainWindow.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2016 Romuald Perrot
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef ALTERNATIVE_VO_MAIN_WINDOW_HPP_
#define ALTERNATIVE_VO_MAIN_WINDOW_HPP_
#include "software/VO/AlternativeVO/ControlButtonsPanel.hpp"
#include "software/VO/AlternativeVO/VOViewerPanel.hpp"
#include "software/VO/AlternativeVO/VOFolderProcessor.hpp"
#include <QMainWindow>
#include <QMenu>
#include <QAction>
#include <QTimer>
#include <memory>
namespace alternative_vo
{
/**
* @brief Entry point of VO application
*/
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
/**
* @brief default ctr
*/
MainWindow( );
public slots:
/**
* @brief Action to be executed when user open an image folder
*/
void onMenuOpenImageFolder( void );
/**
* @brief Action to be executed when user want to quit the application
* @note : Do nothing, users should love our app and there's no reason to quit us.
*/
void onMenuQuit( void );
/**
* Action to be executed when user press play button
*/
void onPlayVOProcess( void );
/**
* Action to be executed when user press stop/pause button
*/
void onStopVOProcess( void );
/**
* Action to be executed when user press Forward button
*/
void onStepForwardVOProcess( void );
/**
* Action to be executed when user press Reset button
* @note Reset is when user want to start again the process
*/
void onResetVOProcess( void );
/**
* Action to be executed when timer got a tick
* -> Used to play a video (maybe not the best way to do it)
*/
void onTimerTick( void );
private:
void BuildInterface();
void BuildMenus();
void MakeConnections();
std::shared_ptr< VOFolderProcessor > m_vo_processor;
QMenu * m_file_menu;
QAction * m_folder_open_act;
QAction * m_quit_act;
QTimer * m_timer;
VOViewerPanel * m_viewer_panel;
ControlButtonsPanel * m_control_panel;
};
}
#endif
| 2,231
|
C++
|
.h
| 74
| 26.22973
| 85
| 0.698264
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,294
|
VOViewerDrawableElements.hpp
|
openMVG_openMVG/src/software/VO/AlternativeVO/VOViewerDrawableElements.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2016 Romuald Perrot
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef ALTERNATIVE_VO_VO_VIEWER_DRAWABLE_ELEMENTS_HPP_
#define ALTERNATIVE_VO_VO_VIEWER_DRAWABLE_ELEMENTS_HPP_
#include "openMVG/numeric/numeric.h"
#include <QColor>
#include <vector>
namespace alternative_vo
{
/**
* @brief Helper structure use to represent a line and it's associated color
* @brief a line is composed of a list of points
*/
struct VOViewerLine
{
/// Positions of the points
std::vector< openMVG::Vec2f > m_pts;
/// Color of the elements
QColor m_color;
/// Default color for a line
static const QColor DEFAULT_LINE_COLOR;
};
/**
* Helper structure used to represent a point and it's associated color
*/
struct VOViewerPoint
{
/// Position of the point
openMVG::Vec2f m_pt;
/// Color of the point
QColor m_color;
/// Default color for a tracked point
static const QColor DEFAULT_TRACKED_POINT_COLOR;
/// Default color for a newly added point
static const QColor DEFAULT_NEW_POINT_COLOR;
};
}
#endif
| 1,275
|
C++
|
.h
| 41
| 29.073171
| 76
| 0.751639
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,295
|
document.hpp
|
openMVG_openMVG/src/software/ui/SfM/adjacency_matrix_viewer/document.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2017 <Zillow Inc.> Pierre Moulon
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include "openMVG/sfm/sfm.hpp"
// Basic storage of OpenMVG data related to a scene
struct Document
{
openMVG::sfm::SfM_Data sfm_data;
std::shared_ptr<openMVG::sfm::Features_Provider> feats_provider;
std::shared_ptr<openMVG::sfm::Matches_Provider> matches_provider;
};
| 621
|
C++
|
.h
| 14
| 42.571429
| 76
| 0.749169
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,296
|
mainwindow.h
|
openMVG_openMVG/src/software/ui/SfM/adjacency_matrix_viewer/mainwindow.h
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2017 <Zillow Inc.> Pierre Moulon
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include <QWidget>
#include <document.hpp>
class QGraphicsScene;
class MainFrame;
class MainWindow : public QWidget
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
private slots:
void open();
private:
// Open the openMVG data and create the QT item to visualize the pair
void populateScene
(
const std::string & sSfM_Data_Filename,
const std::string & sMatchesDir,
const std::string & sMatchFile
);
QGraphicsScene * scene;
MainFrame * view;
Document doc;
};
| 851
|
C++
|
.h
| 29
| 26.724138
| 76
| 0.736128
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,297
|
mainframe.h
|
openMVG_openMVG/src/software/ui/SfM/adjacency_matrix_viewer/mainframe.h
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2017 <Zillow Inc.> Pierre Moulon
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include <QFrame>
#include <QGraphicsView>
#include "mainwindow.h"
class MatchingPairGraphicsView;
class QSlider;
class QToolButton;
class MainFrame : public QFrame
{
Q_OBJECT
public:
explicit MainFrame
(
const QString &name,
const Document & doc,
QWidget *parent = nullptr
);
QGraphicsView *view() const;
public slots:
void zoomIn(int level = 1);
void zoomOut(int level = 1);
void resetView();
private slots:
void setResetButtonEnabled();
void setupMatrix();
void togglePointerMode();
void toggleOpenGL();
void toggleAntialiasing();
private:
MatchingPairGraphicsView *matching_pair_view;
QToolButton
*select_mode_button,
*opengl_button,
*antialias_button,
*reset_button;
QSlider *zoom_slider;
const Document & doc;
};
| 1,135
|
C++
|
.h
| 43
| 23.674419
| 76
| 0.744444
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,298
|
pairgraphicsitem.h
|
openMVG_openMVG/src/software/ui/SfM/adjacency_matrix_viewer/pairgraphicsitem.h
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2017 <Zillow Inc.> Pierre Moulon
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include <QColor>
#include <QGraphicsItem>
//
// QTGraphicsItem to represent an image pair
//
class PairGraphicsItem : public QGraphicsItem
{
public:
PairGraphicsItem
(
const QColor &color,
unsigned int x, // View index
unsigned int y, // View index
unsigned int matches_count
);
void paint
(
QPainter *painter,
const QStyleOptionGraphicsItem *item,
QWidget *widget
) Q_DECL_OVERRIDE;
QRectF boundingRect() const Q_DECL_OVERRIDE;
QPainterPath shape() const Q_DECL_OVERRIDE;
unsigned int get_x() const {return x;}
unsigned int get_y() const {return y;}
private:
unsigned int x;
unsigned int y;
unsigned int matches_count;
QColor color;
};
| 1,087
|
C++
|
.h
| 37
| 25.486486
| 76
| 0.70317
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,299
|
matchingpairgraphicsview.h
|
openMVG_openMVG/src/software/ui/SfM/adjacency_matrix_viewer/matchingpairgraphicsview.h
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2017 <Zillow Inc.> Pierre Moulon
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include <QGraphicsView>
//class MainFrame;
#include "mainframe.h"
class Document;
class MatchingPairGraphicsView : public QGraphicsView
{
Q_OBJECT
public:
MatchingPairGraphicsView
(
MainFrame *v,
const Document & doc
);
protected:
#ifndef QT_NO_WHEELEVENT
void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
#endif
void mousePressEvent(QMouseEvent * event) Q_DECL_OVERRIDE;
private:
MainFrame *main_frame;
const Document &doc;
};
| 801
|
C++
|
.h
| 28
| 26.464286
| 76
| 0.762092
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,300
|
ControlPointTableView.hpp
|
openMVG_openMVG/src/software/ui/SfM/control_points_registration/ControlPointTableView.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2015 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef CONTROLPOINTTABLEVIEW_HPP
#define CONTROLPOINTTABLEVIEW_HPP
#include <QDialog>
#include <QTableWidget>
#include "openMVG/sfm/sfm_data.hpp"
namespace control_point_GUI {
/// QT Interface to edit Landmarks GCP data:
/// Allow to edit X,Y,Z Ground Control Point coordinates
/// Allow to delete GCP
class ControlPointTableView : public QDialog
{
public:
ControlPointTableView
(
const openMVG::sfm::SfM_Data * sfm_data,
QWidget *parent = nullptr
);
/// Update control points X,Y,Z data (if valid datum is provided)
void updateControlPoints(openMVG::sfm::Landmarks & control_points);
/// Delete selected control_points row(s) on Key_Delete event
void keyReleaseEvent(QKeyEvent* event);
private:
// Input SfM scene data & Control points data
const openMVG::sfm::SfM_Data * sfm_data_;
// Copy of sfm_data_ control_points (work on a copy, to do not break existing ones)
openMVG::sfm::Landmarks control_points_;
/// The graphic interface allowing to delete and edit control points data
QTableWidget * table_;
};
} // namespace control_point_GUI
#endif /* CONTROLPOINTTABLEVIEW_HPP */
| 1,443
|
C++
|
.h
| 36
| 37.833333
| 85
| 0.755014
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,301
|
document.hpp
|
openMVG_openMVG/src/software/ui/SfM/control_points_registration/document.hpp
|
#ifndef DOCUMENT_HPP
#define DOCUMENT_HPP
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2015 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include "openMVG/sfm/sfm_data.hpp"
#include "openMVG/sfm/sfm_data_io.hpp"
#include <fstream>
#include <cereal/archives/json.hpp>
#include <cereal/types/map.hpp>
#include "third_party/stlplus3/filesystemSimplified/file_system.hpp"
struct Document
{
openMVG::sfm::SfM_Data _sfm_data;
bool loadData(const std::string & sfm_data_ProjectPath)
{
return openMVG::sfm::Load(_sfm_data,
sfm_data_ProjectPath,
openMVG::sfm::ESfM_Data(openMVG::sfm::ALL));
}
bool saveData(const std::string & sFileName)
{
return openMVG::sfm::Save(_sfm_data,
sFileName,
openMVG::sfm::ESfM_Data(openMVG::sfm::ALL));
}
};
#endif /* DOCUMENT_HPP */
| 1,142
|
C++
|
.h
| 31
| 30.903226
| 76
| 0.661818
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,304
|
ControlPoint2DNode.hpp
|
openMVG_openMVG/src/software/ui/SfM/control_points_registration/ControlPoint2DNode.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2015 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef CONTROLPOINT2DNODE_HPP
#define CONTROLPOINT2DNODE_HPP
#include <QGraphicsItem>
#include <QPointF>
class GraphWidget;
class QGraphicsSceneMouseEvent;
// Graphical movable QtGraphicItem to represent a control_point image observation
// A dynamic update of the control_point observation coordinates is performed thanks to variable reference.
class ControlPoint2DNode : public QGraphicsItem
{
public:
ControlPoint2DNode(const QPointF& pos, double & x, double & y, size_t id_control_point);
size_t controlPointId() const;
QRectF boundingRect() const;
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
protected:
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
private:
size_t _id_control_point;
double & _x;
double & _y;
};
#endif /* CONTROLPOINT2DNODE_HPP */
| 1,314
|
C++
|
.h
| 31
| 40.290323
| 107
| 0.79229
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,310
|
io_readGTBlendedMVS.hpp
|
openMVG_openMVG/src/software/SfM/import/io_readGTBlendedMVS.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2020 Pierre Moulon.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IO_READ_GT_BLENDED_MVS_HPP
#define IO_READ_GT_BLENDED_MVS_HPP
#include "io_readGTInterface.hpp"
#include "io_loadImages.hpp"
#include "openMVG/cameras/PinholeCamera.hpp"
// BlendedMVS [1] Data importer:
// [1] BlendedMVS: A Large-scale Dataset for Generalized Multi-view Stereo Networks},
// Yao, Yao and Luo, Zixin and Li, Shiwei and Zhang, Jingyang and Ren,
// Yufan and Zhou, Lei and Fang, Tian and Quan, Long,
// Computer Vision and Pattern Recognition (CVPR), 2020
//--------------
// Data storage:
//--------------
// ./cams
// | id.txt
// | ...
// ./blended_images
// | id.jpg
// | id_masked.jpg
//
// Note: id encoded on 8 digits
// Camera information:
// extrinsic
// [P] = [R |t]
// [0 0 0 1]
//
// intrinsic
// [K]
//
// DEPTH_MIN DEPTH_INTERVAL (DEPTH_NUM DEPTH_MAX) // Ignored here
class SfM_Data_GT_Loader_BlendedMVS : public SfM_Data_GT_Loader_Interface
{
private:
std::vector<cameras::PinholeCamera> cameras_data_; // Store all the camera information
public:
bool loadGT() override
{
// Check if there is any camera files under the path
std::vector<std::string> gt_files = stlplus::folder_wildcard(this->gt_dir_, "*_cam.txt");
std::sort(gt_files.begin(), gt_files.end());
if (gt_files.empty())
{
OPENMVG_LOG_ERROR << "The provided GT directory does not have any *_cam.txt file.";
return false;
}
cameras_data_.reserve(gt_files.size());
// Load the gt_data from the file
for ( const auto & iter_gt_file : gt_files)
{
std::ifstream camera_data_file( stlplus::create_filespec(this->gt_dir_, iter_gt_file).c_str(), std::ifstream::in);
if (!camera_data_file)
{
OPENMVG_LOG_ERROR << "Error: Failed to open file '" << iter_gt_file << "' for reading";
continue;
}
// Read Projection and intrinsic matrices
Mat3 R, K;
Vec3 t;
std::string line;
std::getline(camera_data_file, line);
if (line == "extrinsic")
{
std::vector<double> val;
for (int i=0; i < 16; ++i)
{
double valT;
camera_data_file >> valT;
val.push_back(valT);
}
R << val[0], val[1], val[2],
val[4], val[5], val[6],
val[8], val[9], val[10];
t << val[3], val[7], val[11];
}
std::getline(camera_data_file, line);
std::getline(camera_data_file, line);
std::getline(camera_data_file, line);
if (line == "intrinsic")
{
std::vector<double> val;
for (int i=0; i < 9; ++i)
{
double valT;
camera_data_file >> valT;
val.push_back(valT);
}
K << val[0], val[1], val[2],
val[3], val[4], val[5],
val[6], val[7], val[8];
}
Mat34 P;
P_From_KRt(K, R, t, &P);
cameras_data_.emplace_back(P);
camera_data_file.close();
const std::string image_name = stlplus::basename_part(iter_gt_file).substr(0, 8) + ".jpg";
images_.emplace_back( image_name );
}
return true;
}
bool loadImages() override
{
return LoadImages(this->image_dir_, this->images_, this->cameras_data_, this->sfm_data_);
}
};
#endif // IO_READ_GT_BLENDED_MVS_HPP
| 3,575
|
C++
|
.h
| 110
| 27.354545
| 120
| 0.601393
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,312
|
io_readGTInterface.hpp
|
openMVG_openMVG/src/software/SfM/import/io_readGTInterface.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2018 Yan Qingsong, Pierre Moulon.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IO_READ_GT_INTERFACE_HPP
#define IO_READ_GT_INTERFACE_HPP
#include "openMVG/sfm/sfm_data.hpp"
#include "third_party/stlplus3/filesystemSimplified/file_system.hpp"
#include <iostream>
#include <string>
#include <vector>
using namespace openMVG;
using namespace openMVG::sfm;
class SfM_Data_GT_Loader_Interface
{
protected:
SfM_Data sfm_data_;
std::string gt_dir_; // Path to the GT (ground truth) files
std::string image_dir_; // Path store to the images
std::vector<std::string> images_; // Store GT image names list
virtual bool loadGT() = 0; // Load GT from gt_dir and get all the image names
virtual bool loadImages() = 0; // Load images from image_dir
public:
bool run(const std::string >_dir,const std::string &image_dir)
{
this->gt_dir_ = gt_dir;
this->image_dir_ = image_dir;
if (!loadGT())
{
OPENMVG_LOG_ERROR << "Error: Failed to Load Ground Truth!";
return false;
};
if (!loadImages())
{
OPENMVG_LOG_ERROR << "Error: Failed to Load Images!";
return false;
};
return true;
}
SfM_Data GetSfMData() const
{
return this->sfm_data_;
}
int GetImageNumber() const
{
return this->images_.size();
}
};
#endif // IO_READ_GT_INTERFACE_HPP
| 1,590
|
C++
|
.h
| 50
| 28.56
| 79
| 0.696592
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,313
|
io_readGTMultiface.hpp
|
openMVG_openMVG/src/software/SfM/import/io_readGTMultiface.hpp
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2020 Pierre Moulon.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include "io_readGTInterface.hpp"
#include "io_loadImages.hpp"
#include "openMVG/cameras/PinholeCamera.hpp"
class SfM_Data_GT_Loader_Multiface : public SfM_Data_GT_Loader_Interface
{
private:
std::vector<cameras::PinholeCamera> cameras_data_; // Store all the camera information
public:
bool loadGT() override
{
this->images_ = stlplus::folder_wildcard(this->image_dir_, "*.png");
std::sort(this->images_.begin(), this->images_.end());
const size_t nImages = images_.size();
cameras_data_.resize(nImages);
std::ifstream krt_file(this->gt_dir_ + "/KRT");
if (!krt_file)
{
OPENMVG_LOG_ERROR << "File << " << (this->gt_dir_ + "/KRT") << " could not be found.";
return false;
}
std::istringstream iss;
for (size_t i = 0; i < nImages; ++i)
{
std::string line[9];
for (int j = 0; j < 9; ++j)
std::getline(krt_file, line[j]);
bool found = false;
for (size_t j = 0; j < nImages; ++j)
{
if (stlplus::basename_part(this->images_[j]) == line[0])
{
Mat3 R, K;
Vec3 t;
iss = std::istringstream{line[1]}; iss >> K(0, 0) >> K(0, 1) >> K(0, 2);
iss = std::istringstream{line[2]}; iss >> K(1, 0) >> K(1, 1) >> K(1, 2);
iss = std::istringstream{line[3]}; iss >> K(2, 0) >> K(2, 1) >> K(2, 2);
iss = std::istringstream{line[5]}; iss >> R(0, 0) >> R(0, 1) >> R(0, 2) >> t[0];
iss = std::istringstream{line[6]}; iss >> R(1, 0) >> R(1, 1) >> R(1, 2) >> t[1];
iss = std::istringstream{line[7]}; iss >> R(2, 0) >> R(2, 1) >> R(2, 2) >> t[2];
cameras_data_[j] = cameras::PinholeCamera(K, R, t);
found = true;
break;
}
}
if (!found)
{
OPENMVG_LOG_ERROR << "Camera " << line[0] << " could not find its corresponding image.";
return false;
}
}
return true;
}
bool loadImages() override
{
return LoadImages(this->image_dir_, this->images_, this->cameras_data_, this->sfm_data_);
}
};
| 2,395
|
C++
|
.h
| 63
| 32.079365
| 96
| 0.570194
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,321
|
testing.h
|
openMVG_openMVG/src/testing/testing.h
|
// Copyright (c) 2007, 2008 libmv authors.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2012, 2013 Pierre MOULON.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef TESTING_TESTING_H_
#define TESTING_TESTING_H_
#include "openMVG/numeric/eigen_alias_definition.hpp"
#include "openMVG/numeric/numeric.h"
#include "third_party/CppUnitLite/TestHarness.h"
#define EXPECT_MATRIX_NEAR(a, b, tolerance) \
do { \
bool dims_match = (a.rows() == b.rows()) && (a.cols() == b.cols()); \
CHECK_EQUAL(a.rows(),b.rows()); \
CHECK_EQUAL(a.cols(),b.cols()); \
if (dims_match) { \
for (int r = 0; r < a.rows(); ++r) { \
for (int c = 0; c < a.cols(); ++c) { \
DOUBLES_EQUAL(a(r, c), b(r, c), tolerance); \
} \
} \
} \
} while(false);
#define EXPECT_MATRIX_NEAR_ZERO(a, tolerance) \
do { \
for (int r = 0; r < a.rows(); ++r) { \
for (int c = 0; c < a.cols(); ++c) { \
DOUBLES_EQUAL(0.0, a(r, c), tolerance) \
} \
} \
} while(false);
#define EXPECT_MATRIX_EQ(a, b) \
do { \
bool dims_match = (a.rows() == b.rows()) && (a.cols() == b.cols()); \
CHECK_EQUAL(a.rows(),b.rows()); \
CHECK_EQUAL(a.cols(),b.cols()); \
if (dims_match) { \
for (int r = 0; r < a.rows(); ++r) { \
for (int c = 0; c < a.cols(); ++c) { \
CHECK_EQUAL(a(r, c), b(r, c)) \
} \
} \
} \
} while(false);
#define EXPECT_NEAR(expected,actual,threshold) \
DOUBLES_EQUAL(expected,actual,threshold);
#define EXPECT_TRUE(condition) \
CHECK(condition);
#define EXPECT_FALSE(condition) \
CHECK(!condition);
#define EXPECT_EQ(a, b) CHECK_EQUAL(a,b);
// Check that sin(angle(a, b)) < tolerance.
#define EXPECT_MATRIX_PROP(a, b, tolerance) \
do { \
bool dims_match = (a.rows() == b.rows()) && (a.cols() == b.cols()); \
CHECK_EQUAL(a.rows(), b.rows()); \
CHECK_EQUAL(a.cols(), b.cols()); \
if (dims_match) { \
double c = CosinusBetweenMatrices(a, b); \
if (c * c < 1) { \
double s = sqrt(1 - c * c); \
DOUBLES_EQUAL(0.0, s, tolerance); \
} \
} \
} while(false);
#endif // TESTING_TESTING_H_
| 3,357
|
C++
|
.h
| 85
| 36.729412
| 79
| 0.65387
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
28,324
|
mser.h
|
openMVG_openMVG/src/nonFree/sift/vl/mser.h
|
/** @file mser.h
** @brief MSER (@ref mser)
** @author Andrea Vedaldi
**/
/*
Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
All rights reserved.
This file is part of the VLFeat library and is made available under
the terms of the BSD license (see the COPYING file).
*/
#ifndef VL_MSER
#define VL_MSER
#include "generic.h"
/** @brief MSER image data type
**
** This is the data type of the image pixels. It has to be an
** integer.
**/
typedef vl_uint8 vl_mser_pix ;
/** @brief Maximum value
**
** Maximum value of the integer type ::vl_mser_pix.
**/
#define VL_MSER_PIX_MAXVAL 256
/** @brief MSER Filter
**
** The MSER filter computes the Maximally Stable Extremal Regions of
** an image.
**
** This structure is @ref main-glossary "opaque".
**
** @sa @ref mser
**/
typedef struct _VlMserFilt VlMserFilt ;
/** @brief MSER filter statistics */
typedef struct _VlMserStats VlMserStats ;
/** @brief MSER filter statistics definition */
struct _VlMserStats
{
int num_extremal ; /**< number of extremal regions */
int num_unstable ; /**< number of unstable extremal regions */
int num_abs_unstable ; /**< number of regions that failed the absolute stability test */
int num_too_big ; /**< number of regions that failed the maximum size test */
int num_too_small ; /**< number of regions that failed the minimum size test */
int num_duplicates ; /**< number of regions that failed the duplicate test */
} ;
/** @name Construction and Destruction
** @{
**/
VL_EXPORT VlMserFilt* vl_mser_new (int ndims, int const* dims) ;
VL_EXPORT void vl_mser_delete (VlMserFilt *f) ;
/** @} */
/** @name Processing
** @{
**/
VL_EXPORT void vl_mser_process (VlMserFilt *f,
vl_mser_pix const *im) ;
VL_EXPORT void vl_mser_ell_fit (VlMserFilt *f) ;
/** @} */
/** @name Retrieving data
** @{
**/
VL_INLINE vl_uint vl_mser_get_regions_num (VlMserFilt const *f) ;
VL_INLINE vl_uint const* vl_mser_get_regions (VlMserFilt const *f) ;
VL_INLINE float const* vl_mser_get_ell (VlMserFilt const *f) ;
VL_INLINE vl_uint vl_mser_get_ell_num (VlMserFilt const *f) ;
VL_INLINE vl_uint vl_mser_get_ell_dof (VlMserFilt const *f) ;
VL_INLINE VlMserStats const* vl_mser_get_stats (VlMserFilt const *f) ;
/** @} */
/** @name Retrieving parameters
** @{
**/
VL_INLINE vl_mser_pix vl_mser_get_delta (VlMserFilt const *f) ;
VL_INLINE double vl_mser_get_min_area (VlMserFilt const *f) ;
VL_INLINE double vl_mser_get_max_area (VlMserFilt const *f) ;
VL_INLINE double vl_mser_get_max_variation (VlMserFilt const *f) ;
VL_INLINE double vl_mser_get_min_diversity (VlMserFilt const *f) ;
/** @} */
/** @name Setting parameters
** @{
**/
VL_INLINE void vl_mser_set_delta (VlMserFilt *f, vl_mser_pix x) ;
VL_INLINE void vl_mser_set_min_area (VlMserFilt *f, double x) ;
VL_INLINE void vl_mser_set_max_area (VlMserFilt *f, double x) ;
VL_INLINE void vl_mser_set_max_variation (VlMserFilt *f, double x) ;
VL_INLINE void vl_mser_set_min_diversity (VlMserFilt *f, double x) ;
/** @} */
/* ====================================================================
* INLINE DEFINITIONS
* ================================================================== */
/** @internal @brief MSER accumulator data type
**
** This is a large integer type. It should be large enough to contain
** a number equal to the area (volume) of the image by the image
** width by the image height (for instance, if the image is a square
** of side 256, the maximum value is 256 x 256 x 256).
**/
typedef float vl_mser_acc ;
/** @internal @brief Basic region flag: null region */
#ifdef VL_COMPILER_MSC
#define VL_MSER_VOID_NODE ((1ui64<<32) - 1)
#else
#define VL_MSER_VOID_NODE ((1ULL<<32) - 1)
#endif
/* ----------------------------------------------------------------- */
/** @internal @brief MSER: basic region (declaration)
**
** Extremal regions and maximally stable extremal regions are
** instances of image regions.
**
** There is an image region for each pixel of the image. Each region
** is represented by an instance of this structure. Regions are
** stored into an array in pixel order.
**
** Regions are arranged into a forest. VlMserReg::parent points to
** the parent node, or to the node itself if the node is a root.
** VlMserReg::parent is the index of the node in the node array
** (which therefore is also the index of the corresponding
** pixel). VlMserReg::height is the distance of the fartest leaf. If
** the node itself is a leaf, then VlMserReg::height is zero.
**
** VlMserReg::area is the area of the image region corresponding to
** this node.
**
** VlMserReg::region is the extremal region identifier. Not all
** regions are extremal regions however; if the region is NOT
** extremal, this field is set to ....
**/
struct _VlMserReg
{
vl_uint parent ; /**< points to the parent region. */
vl_uint shortcut ; /**< points to a region closer to a root. */
vl_uint height ; /**< region height in the forest. */
vl_uint area ; /**< area of the region. */
} ;
/** @internal @brief MSER: basic region */
typedef struct _VlMserReg VlMserReg ;
/* ----------------------------------------------------------------- */
/** @internal @brief MSER: extremal region (declaration)
**
** Extremal regions (ER) are extracted from the region forest. Each
** region is represented by an instance of this structure. The
** structures are stored into an array, in arbitrary order.
**
** ER are arranged into a tree. @a parent points to the parent ER, or
** to itself if the ER is the root.
**
** An instance of the structure represents the extremal region of the
** level set of intensity VlMserExtrReg::value and containing the
** pixel VlMserExtReg::index.
**
** VlMserExtrReg::area is the area of the extremal region and
** VlMserExtrReg::area_top is the area of the extremal region
** containing this region in the level set of intensity
** VlMserExtrReg::area + @c delta.
**
** VlMserExtrReg::variation is the relative area variation @c
** (area_top-area)/area.
**
** VlMserExtrReg::max_stable is a flag signaling whether this extremal
** region is also maximally stable.
**/
struct _VlMserExtrReg
{
int parent ; /**< index of the parent region */
int index ; /**< index of pivot pixel */
vl_mser_pix value ; /**< value of pivot pixel */
vl_uint shortcut ; /**< shortcut used when building a tree */
vl_uint area ; /**< area of the region */
float variation ; /**< rel. area variation */
vl_uint max_stable ; /**< max stable number (=0 if not maxstable) */
} ;
/** @internal @brief MSER: extremal region */
typedef struct _VlMserExtrReg VlMserExtrReg ;
/* ----------------------------------------------------------------- */
/** @internal @brief MSER filter
** @see @ref mser
**/
struct _VlMserFilt
{
/** @name Image data and meta data @internal */
/*@{*/
int ndims ; /**< number of dimensions */
int *dims ; /**< dimensions */
int nel ; /**< number of image elements (pixels) */
int *subs ; /**< N-dimensional subscript */
int *dsubs ; /**< another subscript */
int *strides ; /**< strides to move in image data */
/*@}*/
vl_uint *perm ; /**< pixel ordering */
vl_uint *joins ; /**< sequence of join ops */
int njoins ; /**< number of join ops */
/** @name Regions */
/*@{*/
VlMserReg *r ; /**< basic regions */
VlMserExtrReg *er ; /**< extremal tree */
vl_uint *mer ; /**< maximally stable extremal regions */
int ner ; /**< number of extremal regions */
int nmer ; /**< number of maximally stable extr. reg. */
int rer ; /**< size of er buffer */
int rmer ; /**< size of mer buffer */
/*@}*/
/** @name Ellipsoids fitting */
/*@{*/
float *acc ; /**< moment accumulator. */
float *ell ; /**< ellipsoids list. */
int rell ; /**< size of ell buffer */
int nell ; /**< number of ellipsoids extracted */
int dof ; /**< number of dof of ellipsoids. */
/*@}*/
/** @name Configuration */
/*@{*/
vl_bool verbose ; /**< be verbose */
int delta ; /**< delta filter parameter */
double max_area ; /**< badness test parameter */
double min_area ; /**< badness test parameter */
double max_variation ; /**< badness test parameter */
double min_diversity ; /**< minimum diversity */
/*@}*/
VlMserStats stats ; /** run statistic */
} ;
/* ----------------------------------------------------------------- */
/** @brief Get delta
** @param f MSER filter.
** @return value of @c delta.
**/
VL_INLINE vl_mser_pix
vl_mser_get_delta (VlMserFilt const *f)
{
return f-> delta ;
}
/** @brief Set delta
** @param f MSER filter.
** @param x value of @c delta.
**/
VL_INLINE void
vl_mser_set_delta (VlMserFilt *f, vl_mser_pix x)
{
f-> delta = x ;
}
/* ----------------------------------------------------------------- */
/** @brief Get minimum diversity
** @param f MSER filter.
** @return value of @c minimum diversity.
**/
VL_INLINE double
vl_mser_get_min_diversity (VlMserFilt const *f)
{
return f-> min_diversity ;
}
/** @brief Set minimum diversity
** @param f MSER filter.
** @param x value of @c minimum diversity.
**/
VL_INLINE void
vl_mser_set_min_diversity (VlMserFilt *f, double x)
{
f-> min_diversity = x ;
}
/* ----------------------------------------------------------------- */
/** @brief Get statistics
** @param f MSER filter.
** @return statistics.
**/
VL_INLINE VlMserStats const*
vl_mser_get_stats (VlMserFilt const *f)
{
return & f-> stats ;
}
/* ----------------------------------------------------------------- */
/** @brief Get maximum region area
** @param f MSER filter.
** @return maximum region area.
**/
VL_INLINE double
vl_mser_get_max_area (VlMserFilt const *f)
{
return f-> max_area ;
}
/** @brief Set maximum region area
** @param f MSER filter.
** @param x maximum region area.
**/
VL_INLINE void
vl_mser_set_max_area (VlMserFilt *f, double x)
{
f-> max_area = x ;
}
/* ----------------------------------------------------------------- */
/** @brief Get minimum region area
** @param f MSER filter.
** @return minimum region area.
**/
VL_INLINE double
vl_mser_get_min_area (VlMserFilt const *f)
{
return f-> min_area ;
}
/** @brief Set minimum region area
** @param f MSER filter.
** @param x minimum region area.
**/
VL_INLINE void
vl_mser_set_min_area (VlMserFilt *f, double x)
{
f-> min_area = x ;
}
/* ----------------------------------------------------------------- */
/** @brief Get maximum region variation
** @param f MSER filter.
** @return maximum region variation.
**/
VL_INLINE double
vl_mser_get_max_variation (VlMserFilt const *f)
{
return f-> max_variation ;
}
/** @brief Set maximum region variation
** @param f MSER filter.
** @param x maximum region variation.
**/
VL_INLINE void
vl_mser_set_max_variation (VlMserFilt *f, double x)
{
f-> max_variation = x ;
}
/* ----------------------------------------------------------------- */
/** @brief Get maximally stable extremal regions
** @param f MSER filter.
** @return array of MSER pivots.
**/
VL_INLINE vl_uint const *
vl_mser_get_regions (VlMserFilt const* f)
{
return f-> mer ;
}
/** @brief Get number of maximally stable extremal regions
** @param f MSER filter.
** @return number of MSERs.
**/
VL_INLINE vl_uint
vl_mser_get_regions_num (VlMserFilt const* f)
{
return f-> nmer ;
}
/* ----------------------------------------------------------------- */
/** @brief Get ellipsoids
** @param f MSER filter.
** @return ellipsoids.
**/
VL_INLINE float const *
vl_mser_get_ell (VlMserFilt const* f)
{
return f-> ell ;
}
/** @brief Get number of degrees of freedom of ellipsoids
** @param f MSER filter.
** @return number of degrees of freedom.
**/
VL_INLINE vl_uint
vl_mser_get_ell_dof (VlMserFilt const* f)
{
return f-> dof ;
}
/** @brief Get number of ellipsoids
** @param f MSER filter.
** @return number of ellipsoids
**/
VL_INLINE vl_uint
vl_mser_get_ell_num (VlMserFilt const* f)
{
return f-> nell ;
}
/* VL_MSER */
#endif
| 13,516
|
C++
|
.h
| 375
| 34.064
| 91
| 0.559221
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
28,325
|
generic.h
|
openMVG_openMVG/src/nonFree/sift/vl/generic.h
|
/** @file generic.h
** @brief Generic (@ref generic)
** @author Andrea Vedaldi
**/
/*
Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
All rights reserved.
This file is part of the VLFeat library and is made available under
the terms of the BSD license (see the COPYING file).
*/
#ifndef VL_GENERIC_H
#define VL_GENERIC_H
#include "host.h"
#include "random.h"
#include <stdlib.h>
#include <stddef.h>
#include <time.h>
#include <assert.h>
#if defined(VL_OS_WIN)
#include <Windows.h>
#endif
#if ! defined(VL_DISABLE_THREADS) && defined(VL_THREADS_POSIX)
#include <pthread.h>
#endif
/** @brief Library version string */
#define VL_VERSION_STRING "0.9.16"
/** @brief Maximum length (in characters) of an error message */
#define VL_ERR_MSG_LEN 1024
/** @name Type identidifers for atomic data types
** @{ */
#define VL_TYPE_FLOAT 1 /**< @c float type */
#define VL_TYPE_DOUBLE 2 /**< @c double type */
#define VL_TYPE_INT8 3 /**< @c ::vl_int8 type */
#define VL_TYPE_UINT8 4 /**< @c ::vl_uint8 type */
#define VL_TYPE_INT16 5 /**< @c ::vl_int16 type */
#define VL_TYPE_UINT16 6 /**< @c ::vl_uint16 type */
#define VL_TYPE_INT32 7 /**< @c ::vl_int32 type */
#define VL_TYPE_UINT32 8 /**< @c ::vl_uint32 type */
#define VL_TYPE_INT64 9 /**< @c ::vl_int64 type */
#define VL_TYPE_UINT64 10 /**< @c ::vl_uint64 type */
typedef vl_uint32 vl_type ;
/** @brief Get the name of a data type.
** @param type data type.
** @return data name of the data type.
**
** @c type is one of ::VL_TYPE_FLOAT, ::VL_TYPE_DOUBLE,
** ::VL_TYPE_INT8, ::VL_TYPE_INT16, ::VL_TYPE_INT32, ::VL_TYPE_INT64,
** ::VL_TYPE_UINT8, ::VL_TYPE_UINT16, ::VL_TYPE_UINT32, ::VL_TYPE_UINT64.
**/
VL_INLINE char const *
vl_get_type_name (vl_type type)
{
switch (type) {
case VL_TYPE_FLOAT : return "float" ;
case VL_TYPE_DOUBLE : return "double" ;
case VL_TYPE_INT8 : return "int8" ;
case VL_TYPE_INT16 : return "int16" ;
case VL_TYPE_INT32 : return "int32" ;
case VL_TYPE_INT64 : return "int64" ;
case VL_TYPE_UINT8 : return "int8" ;
case VL_TYPE_UINT16 : return "int16" ;
case VL_TYPE_UINT32 : return "int32" ;
case VL_TYPE_UINT64 : return "int64" ;
default: return NULL ;
}
}
/** @brief Get data type size.
** @param type data type.
** @return size (in byte)
**
** @c type is one of ::VL_TYPE_FLOAT, ::VL_TYPE_DOUBLE,
** ::VL_TYPE_INT8, ::VL_TYPE_INT16, ::VL_TYPE_INT32, ::VL_TYPE_INT64,
** ::VL_TYPE_UINT8, ::VL_TYPE_UINT16, ::VL_TYPE_UINT32, ::VL_TYPE_UINT64.
**/
VL_INLINE vl_size
vl_get_type_size (vl_type type)
{
vl_size dataSize = 0 ;
switch (type) {
case VL_TYPE_DOUBLE : dataSize = sizeof(double) ; break ;
case VL_TYPE_FLOAT : dataSize = sizeof(float) ; break ;
case VL_TYPE_INT64 : case VL_TYPE_UINT64 : dataSize = sizeof(vl_int64) ; break ;
case VL_TYPE_INT32 : case VL_TYPE_UINT32 : dataSize = sizeof(vl_int32) ; break ;
case VL_TYPE_INT16 : case VL_TYPE_UINT16 : dataSize = sizeof(vl_int16) ; break ;
case VL_TYPE_INT8 : case VL_TYPE_UINT8 : dataSize = sizeof(vl_int8) ; break ;
default:
abort() ;
}
return dataSize ;
}
/** @} */
/** ------------------------------------------------------------------
** @name Library state and configuration
** @{ */
/** @internal @brief VLFeat thread state */
typedef struct _VlThreadSpecificState
{
/* errors */
int lastError ;
char lastErrorMessage [VL_ERR_MSG_LEN] ;
/* random number generator */
VlRand rand ;
/* time */
#if defined(VL_OS_WIN)
LARGE_INTEGER ticFreq ;
LARGE_INTEGER ticMark ;
#else
clock_t ticMark ;
#endif
} VlThreadSpecificState ;
/** @internal @brief VLFeat global state */
typedef struct _VlState
{
#if ! defined(VL_DISABLE_THREADS)
#if defined(VL_THREADS_POSIX)
pthread_key_t threadKey ;
pthread_mutex_t mutex ;
pthread_t mutexOwner ;
pthread_cond_t mutexCondition ;
size_t mutexCount ;
#elif defined(VL_THREADS_WIN)
DWORD tlsIndex ;
CRITICAL_SECTION mutex ;
#endif
#else
VlThreadSpecificState * threadState ;
#endif
int (*printf_func) (char const * format, ...) ;
void *(*malloc_func) (size_t) ;
void *(*realloc_func) (void*,size_t) ;
void *(*calloc_func) (size_t, size_t) ;
void (*free_func) (void*) ;
#if defined(VL_ARCH_IX86) || defined(VL_ARCH_X64) || defined(VL_ARCH_IA64)
VlX86CpuInfo cpuInfo ;
#endif
vl_size numCPUs ;
vl_bool simdEnabled ;
vl_size maxNumThreads ;
} VlState ;
/** @internal @brief VLFeat global state */
VL_EXPORT VlState _vl_state ;
VL_INLINE VlState * vl_get_state () ;
VL_INLINE VlThreadSpecificState * vl_get_thread_specific_state () ;
VL_EXPORT void vl_lock_state () ;
VL_EXPORT void vl_unlock_state () ;
VL_EXPORT VlThreadSpecificState * vl_thread_specific_state_new () ;
VL_EXPORT void vl_thread_specific_state_delete (VlThreadSpecificState * self) ;
VL_EXPORT char const * vl_get_version_string () ;
VL_EXPORT char * vl_configuration_to_string_copy () ;
VL_INLINE void vl_set_simd_enabled (vl_bool x) ;
VL_INLINE vl_bool vl_get_simd_enabled () ;
VL_INLINE vl_bool vl_cpu_has_sse3 () ;
VL_INLINE vl_bool vl_cpu_has_sse2 () ;
VL_INLINE vl_size vl_get_num_cpus () ;
VL_EXPORT VlRand * vl_get_rand () ;
/** @} */
/** ------------------------------------------------------------------
** @name Error handling
** @{ */
#define VL_ERR_OK 0 /**< No error */
#define VL_ERR_OVERFLOW 1 /**< Buffer overflow error */
#define VL_ERR_ALLOC 2 /**< Resource allocation error */
#define VL_ERR_BAD_ARG 3 /**< Bad argument or illegal data error */
#define VL_ERR_IO 4 /**< Input/output error */
#define VL_ERR_EOF 5 /**< End-of-file or end-of-sequence error */
#define VL_ERR_NO_MORE 5 /**< End-of-sequence @deprecated */
VL_INLINE int vl_get_last_error () ;
VL_INLINE char const * vl_get_last_error_message () ;
VL_EXPORT int vl_set_last_error (int error, char const * errorMessage, ...) ;
/** @} */
/** ------------------------------------------------------------------
** @name Memory allocation
** @{ */
VL_EXPORT void
vl_set_alloc_func (void *(*malloc_func) (size_t),
void *(*realloc_func) (void*,size_t),
void *(*calloc_func) (size_t, size_t),
void (*free_func) (void*)) ;
VL_INLINE void *vl_malloc (size_t n) ;
VL_INLINE void *vl_realloc (void *ptr, size_t n) ;
VL_INLINE void *vl_calloc (size_t n, size_t size) ;
VL_INLINE void vl_free (void* ptr) ;
/** @} */
/** ------------------------------------------------------------------
** @name Logging
** @{ */
/** ------------------------------------------------------------------
** @brief Customizable printf function pointer type */
typedef int(*printf_func_t) (char const *format, ...) ;
/** @brief Set printf function
** @param printf_func pointer to @c printf.
** Let @c print_func be NULL to disable printf.
**/
VL_EXPORT void vl_set_printf_func (printf_func_t printf_func) ;
/** @def VL_PRINTF
** @brief Call user-customizable @c printf function
**
** The function calls the user customizable @c printf.
**/
#define VL_PRINTF (*vl_get_state()->printf_func)
/** @def VL_PRINT
** @brief Same as ::VL_PRINTF (legacy code)
**/
#define VL_PRINT (*vl_get_state()->printf_func)
/** @} */
/** ------------------------------------------------------------------
** @name Common operations
** @{ */
/** @brief Min operation
** @param x value
** @param y value
** @return the minimum of @a x and @a y.
**/
#define VL_MIN(x,y) (((x)<(y))?(x):(y))
/** @brief Max operation
** @param x value.
** @param y value.
** @return the maximum of @a x and @a y.
**/
#define VL_MAX(x,y) (((x)>(y))?(x):(y))
/** @brief Signed left shift operation
**
** The macro is equivalent to the builtin @c << operator, but it
** supports negative shifts too.
**
** @param x value.
** @param n number of shift positions.
** @return @c x << n .
**/
#define VL_SHIFT_LEFT(x,n) (((n)>=0)?((x)<<(n)):((x)>>-(n)))
/* @} */
/** ------------------------------------------------------------------
** @name Measuring time
** @{
**/
VL_EXPORT void vl_tic () ;
VL_EXPORT double vl_toc () ;
VL_EXPORT double vl_get_cpu_time () ;
/** @} */
VL_EXPORT void vl_constructor () ;
VL_EXPORT void vl_destructor () ;
/* -------------------------------------------------------------------
* Inline functions
* ---------------------------------------------------------------- */
VL_INLINE VlState *
vl_get_state ()
{
return &_vl_state ;
}
VL_INLINE VlThreadSpecificState *
vl_get_thread_specific_state ()
{
#ifdef VL_DISABLE_THREADS
return vl_get_state()->threadState ;
#else
VlState * state ;
VlThreadSpecificState * threadState ;
vl_lock_state() ;
state = vl_get_state() ;
#if defined(VL_THREADS_POSIX)
threadState = (VlThreadSpecificState *) pthread_getspecific(state->threadKey) ;
#elif defined(VL_THREADS_WIN)
threadState = (VlThreadSpecificState *) TlsGetValue(state->tlsIndex) ;
#endif
if (! threadState) {
threadState = vl_thread_specific_state_new () ;
}
#if defined(VL_THREADS_POSIX)
pthread_setspecific(state->threadKey, threadState) ;
#elif defined(VL_THREADS_WIN)
TlsSetValue(state->tlsIndex, threadState) ;
#endif
vl_unlock_state() ;
return threadState ;
#endif
}
VL_INLINE void
vl_set_simd_enabled (vl_bool x)
{
vl_get_state()->simdEnabled = x ;
}
VL_INLINE vl_bool
vl_get_simd_enabled ()
{
return vl_get_state()->simdEnabled ;
}
VL_INLINE vl_bool
vl_cpu_has_sse3 ()
{
#if defined(VL_ARCH_IX86) || defined(VL_ARCH_X64) || defined(VL_ARCH_IA64)
return vl_get_state()->cpuInfo.hasSSE3 ;
#else
return 0 ;
#endif
}
VL_INLINE vl_bool
vl_cpu_has_sse2 ()
{
#if defined(VL_ARCH_IX86) || defined(VL_ARCH_X64) || defined(VL_ARCH_IA64)
return vl_get_state()->cpuInfo.hasSSE2 ;
#else
return 0 ;
#endif
}
VL_INLINE vl_size
vl_get_num_cpus ()
{
return vl_get_state()->numCPUs ;
}
VL_INLINE int
vl_get_last_error () {
return vl_get_thread_specific_state()->lastError ;
}
VL_INLINE char const *
vl_get_last_error_message ()
{
return vl_get_thread_specific_state()->lastErrorMessage ;
}
VL_INLINE void*
vl_malloc (size_t n)
{
return (vl_get_state()->malloc_func)(n) ;
}
VL_INLINE void*
vl_realloc (void* ptr, size_t n)
{
return (vl_get_state()->realloc_func)(ptr, n) ;
}
VL_INLINE void*
vl_calloc (size_t n, size_t size)
{
return (vl_get_state()->calloc_func)(n, size) ;
}
VL_INLINE void
vl_free (void *ptr)
{
(vl_get_state()->free_func)(ptr) ;
}
/* VL_GENERIC_H */
#endif
| 10,613
|
C++
|
.h
| 340
| 29.073529
| 85
| 0.619253
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
28,326
|
imopv_sse2.h
|
openMVG_openMVG/src/nonFree/sift/vl/imopv_sse2.h
|
/** @file imopv_sse2.h
** @brief Vectorized image operations - SSE2
** @author Andrea Vedaldi
**/
/*
Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
All rights reserved.
This file is part of the VLFeat library and is made available under
the terms of the BSD license (see the COPYING file).
*/
#ifndef VL_IMOPV_SSE2_H
#define VL_IMOPV_SSE2_H
#include "generic.h"
#ifndef VL_DISABLE_SSE2
VL_EXPORT
void _vl_imconvcol_vf_sse2 (float* dst, vl_size dst_stride,
float const* src,
vl_size src_width, vl_size src_height, vl_size src_stride,
float const* filt, vl_index filt_begin, vl_index filt_end,
int step, unsigned int flags) ;
VL_EXPORT
void _vl_imconvcol_vd_sse2 (double* dst, vl_size dst_stride,
double const* src,
vl_size src_width, vl_size src_height, vl_size src_stride,
double const* filt, vl_index filt_begin, vl_index filt_end,
int step, unsigned int flags) ;
/*
VL_EXPORT
void _vl_imconvcoltri_vf_sse2 (float* dst, int dst_stride,
float const* src,
int src_width, int src_height, int src_stride,
int filt_size,
int step, unsigned int flags) ;
VL_EXPORT
void _vl_imconvcoltri_vd_sse2 (double* dst, int dst_stride,
double const* src,
int src_width, int src_height, int src_stride,
int filt_size,
int step, unsigned int flags) ;
*/
#endif
/* VL_IMOPV_SSE2_H */
#endif
| 1,768
|
C++
|
.h
| 43
| 28.813953
| 87
| 0.549592
|
openMVG/openMVG
| 5,671
| 1,671
| 273
|
MPL-2.0
|
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
| true
| true
| false
| false
| false
| false
| false
| false
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.