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
13namespace yarp::sig::file {
15{
24};
25
26// read methods
27bool YARP_sig_API read(ImageOf<PixelRgb>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
28bool YARP_sig_API read(ImageOf<PixelBgr>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
29bool YARP_sig_API read(ImageOf<PixelRgba>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
30bool YARP_sig_API read(ImageOf<PixelMono>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
31bool YARP_sig_API read(ImageOf<PixelFloat>& dest, const std::string& src, image_fileformat format = FORMAT_ANY);
32
33// write methods
34bool YARP_sig_API write(const ImageOf<PixelRgb>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
35bool YARP_sig_API write(const ImageOf<PixelBgr>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
36bool YARP_sig_API write(const ImageOf<PixelRgba>& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
37bool YARP_sig_API write(const ImageOf<PixelMono>& src, const std::string& dest, image_fileformat format = FORMAT_PGM);
38bool YARP_sig_API write(const ImageOf<PixelFloat>& src, const std::string& dest, image_fileformat format = FORMAT_NUMERIC);
39bool YARP_sig_API write(const Image& src, const std::string& dest, image_fileformat format = FORMAT_PPM);
40} // namespace yarp::sig::file
41
42#endif // YARP_SIG_IMAGEFILE_H
Base class for storing images.
Definition: Image.h:79
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:915
@ FORMAT_NUMERIC_COMPRESSED
Definition: ImageFile.h:22
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:1091
#define YARP_sig_API
Definition: api.h:18