YARP
Yet Another Robot Platform
ImageFile.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_SIG_IMAGEFILE_H
11 #define YARP_SIG_IMAGEFILE_H
12 
13 #include <string>
14 #include <yarp/sig/Image.h>
15 
16 namespace yarp {
17  namespace sig{
23  namespace file
24  {
26  {
33  };
34 
35  // PPM/PGM format
36  bool YARP_sig_API read(ImageOf<PixelRgb>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
37  bool YARP_sig_API read(ImageOf<PixelBgr>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
38  bool YARP_sig_API read(ImageOf<PixelRgba>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
39  bool YARP_sig_API read(ImageOf<PixelMono>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
40  bool YARP_sig_API read(ImageOf<PixelFloat>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
41 
42  // PPM/PGM format
43  bool YARP_sig_API write(const ImageOf<PixelRgb>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
44  bool YARP_sig_API write(const ImageOf<PixelBgr>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
45  bool YARP_sig_API write(const ImageOf<PixelRgba>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
46  bool YARP_sig_API write(const ImageOf<PixelMono>& src, const std::string& dest, image_fileformat format = FORMAT_PGM);
47  bool YARP_sig_API write(const ImageOf<PixelFloat>& src, const std::string& dest, image_fileformat format = FORMAT_NUMERIC);
48  bool YARP_sig_API write(const Image& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
49  }
50  }
51 }
52 
53 #endif // YARP_SIG_IMAGEFILE_H
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:430
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:393
The main, catch-all namespace for YARP.
Definition: numeric.h:47
#define YARP_sig_API
Definition: api.h:19
Base class for storing images.
Definition: Image.h:85