YARP
Yet Another Robot Platform
ImageFile.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 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  {
34  };
35 
36  // read methods
37  bool YARP_sig_API read(ImageOf<PixelRgb>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
38  bool YARP_sig_API read(ImageOf<PixelBgr>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
39  bool YARP_sig_API read(ImageOf<PixelRgba>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
40  bool YARP_sig_API read(ImageOf<PixelMono>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
41  bool YARP_sig_API read(ImageOf<PixelFloat>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
42 
43  // write methods
44  bool YARP_sig_API write(const ImageOf<PixelRgb>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
45  bool YARP_sig_API write(const ImageOf<PixelBgr>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
46  bool YARP_sig_API write(const ImageOf<PixelRgba>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
47  bool YARP_sig_API write(const ImageOf<PixelMono>& src, const std::string& dest, image_fileformat format = FORMAT_PGM);
48  bool YARP_sig_API write(const ImageOf<PixelFloat>& src, const std::string& dest, image_fileformat format = FORMAT_NUMERIC);
49  bool YARP_sig_API write(const Image& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
50  }
51  }
52 }
53 
54 #endif // YARP_SIG_IMAGEFILE_H
Base class for storing images.
Definition: Image.h:85
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:656
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:804
The main, catch-all namespace for YARP.
Definition: environment.h:18
#define YARP_sig_API
Definition: api.h:19