13 #ifndef MLPACK_CORE_DATA_IMAGE_INFO_HPP
14 #define MLPACK_CORE_DATA_IMAGE_INFO_HPP
21 #ifdef HAS_STB // Compile this only if stb is present.
23 #define STB_IMAGE_STATIC
24 #define STB_IMAGE_IMPLEMENTATION
25 #include <stb_image.h>
27 #define STB_IMAGE_WRITE_STATIC
28 #define STB_IMAGE_WRITE_IMPLEMENTATION
29 #include <stb_image_write.h>
36 #ifdef HAS_STB // Compile this only if stb is present.
44 inline bool ImageFormatSupported(
const std::string& fileName,
45 const bool save =
false);
66 const size_t height = 0,
67 const size_t channels = 3,
68 const size_t quality = 90);
71 const size_t&
Width()
const {
return width; }
73 size_t&
Width() {
return width; }
76 const size_t&
Height()
const {
return height; }
81 const size_t&
Channels()
const {
return channels; }
86 const size_t&
Quality()
const {
return quality; }
108 #include "image_info_impl.hpp"
const size_t & Width() const
Get the image width.
size_t & Channels()
Modify the image channels.
size_t & Width()
Modify the image width.
Implements meta-data of images required by data::Load and data::Save for loading and saving images in...
size_t & Height()
Modify the image height.
const size_t & Channels() const
Get the image channels.
The core includes that mlpack expects; standard C++ includes and Armadillo.
ImageInfo(const size_t width=0, const size_t height=0, const size_t channels=3, const size_t quality=90)
Instantiate the ImageInfo object with the given image width, height, number of channels and quality p...
size_t & Quality()
Modify the image quality.
const size_t & Quality() const
Get the image quality.
const size_t & Height() const
Get the image height.