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  {
35  };
36 
37  // read methods
38  bool YARP_sig_API read(ImageOf<PixelRgb>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
39  bool YARP_sig_API read(ImageOf<PixelBgr>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
40  bool YARP_sig_API read(ImageOf<PixelRgba>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
41  bool YARP_sig_API read(ImageOf<PixelMono>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
42  bool YARP_sig_API read(ImageOf<PixelFloat>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
43 
44  // write methods
45  bool YARP_sig_API write(const ImageOf<PixelRgb>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
46  bool YARP_sig_API write(const ImageOf<PixelBgr>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
47  bool YARP_sig_API write(const ImageOf<PixelRgba>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
48  bool YARP_sig_API write(const ImageOf<PixelMono>& src, const std::string& dest, image_fileformat format = FORMAT_PGM);
49  bool YARP_sig_API write(const ImageOf<PixelFloat>& src, const std::string& dest, image_fileformat format = FORMAT_NUMERIC);
50  bool YARP_sig_API write(const Image& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
51  }
52  }
53 }
54 
55 #endif // YARP_SIG_IMAGEFILE_H
yarp::sig::file::read
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:827
yarp::sig::file::FORMAT_ANY
@ FORMAT_ANY
Definition: ImageFile.h:28
yarp::sig::file::FORMAT_PGM
@ FORMAT_PGM
Definition: ImageFile.h:29
yarp::sig::file::FORMAT_JPG
@ FORMAT_JPG
Definition: ImageFile.h:31
yarp::sig::ImageOf< PixelRgb >
yarp::sig::file::image_fileformat
image_fileformat
Definition: ImageFile.h:26
yarp::sig::file::FORMAT_NUMERIC
@ FORMAT_NUMERIC
Definition: ImageFile.h:32
YARP_sig_API
#define YARP_sig_API
Definition: api.h:19
yarp::sig::file::FORMAT_NUMERIC_COMPRESSED
@ FORMAT_NUMERIC_COMPRESSED
Definition: ImageFile.h:33
yarp::sig::file::FORMAT_NULL
@ FORMAT_NULL
Definition: ImageFile.h:27
Image.h
yarp::sig::file::FORMAT_PPM
@ FORMAT_PPM
Definition: ImageFile.h:30
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::sig::Image
Base class for storing images.
Definition: Image.h:85
yarp::sig::file::FORMAT_PNG
@ FORMAT_PNG
Definition: ImageFile.h:34
yarp::sig::file::write
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:971