DGtal 1.4.2
Loading...
Searching...
No Matches
STBReader.h
1
17#pragma once
18
31#if defined(STBReader_RECURSES)
32#error Recursive header files inclusion detected in STBReader.h
33#else // defined(STBReader_RECURSES)
35#define STBReader_RECURSES
36
37#if !defined STBReader_h
39#define STBReader_h
40
42// Inclusions
43#include <iostream>
44#include "DGtal/base/Common.h"
45#include "DGtal/io/colormaps/BasicColorToScalarFunctors.h"
46
48
49namespace DGtal
50{
52 // template class STBReader
60 template <typename TImageContainer,typename TFunctor=functors::ColorRGBEncoder<typename TImageContainer::Value> >
62 {
63 // ----------------------- Standard services ------------------------------
64 public:
67 typedef typename TImageContainer::Value Value;
68 typedef TFunctor Functor ;
69
70 BOOST_STATIC_ASSERT( (ImageContainer::Domain::dimension == 2));
72
82 static ImageContainer import(const std::string & filename,
83 const Functor & aFunctor = Functor());
84 }; // end of class STBReader
85
86
87
88} // namespace DGtal
89
90
92// Includes inline functions.
93#include "DGtal/io/readers//STBReader.ih"
94// //
96#endif // !defined STBReader_h
97
98#undef STBReader_RECURSES
99#endif // else defined(STBReader_RECURSES)
Aim: Image reader using the stb_image.h header only code.
Definition STBReader.h:62
TImageContainer ImageContainer
Definition STBReader.h:65
TFunctor Functor
Definition STBReader.h:68
TImageContainer::Value Value
Definition STBReader.h:67
TImageContainer::Domain::Vector Vector
Definition STBReader.h:66
BOOST_STATIC_ASSERT((ImageContainer::Domain::dimension==2))
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< TFunctor, DGtal::Color, Value >))
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Defines a unary functor, which associates arguments to results.