YARP
Yet Another Robot Platform
ImageFile.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef YARP_SIG_IMAGEFILE_H
8 #define YARP_SIG_IMAGEFILE_H
9 
10 #include <string>
11 #include <yarp/sig/Image.h>
12 
13 namespace yarp {
14  namespace sig{
20  namespace file
21  {
23  {
32  };
33 
34  // read methods
35  bool YARP_sig_API read(ImageOf<PixelRgb>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
36  bool YARP_sig_API read(ImageOf<PixelBgr>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
37  bool YARP_sig_API read(ImageOf<PixelRgba>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
38  bool YARP_sig_API read(ImageOf<PixelMono>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
39  bool YARP_sig_API read(ImageOf<PixelFloat>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
40 
41  // write methods
42  bool YARP_sig_API write(const ImageOf<PixelRgb>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
43  bool YARP_sig_API write(const ImageOf<PixelBgr>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
44  bool YARP_sig_API write(const ImageOf<PixelRgba>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
45  bool YARP_sig_API write(const ImageOf<PixelMono>& src, const std::string& dest, image_fileformat format = FORMAT_PGM);
46  bool YARP_sig_API write(const ImageOf<PixelFloat>& src, const std::string& dest, image_fileformat format = FORMAT_NUMERIC);
47  bool YARP_sig_API write(const Image& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
48  }
49  }
50 }
51 
52 #endif // YARP_SIG_IMAGEFILE_H
Base class for storing images.
Definition: Image.h:82
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:923
@ FORMAT_NUMERIC_COMPRESSED
Definition: ImageFile.h:30
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:1099
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_sig_API
Definition: api.h:18