Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpImageIoBackend.h
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2025 by Inria. All rights reserved.
4 *
5 * This software is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * See the file LICENSE.txt at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using ViSP with software that can not be combined with the GNU
13 * GPL, please contact Inria about acquiring a ViSP Professional
14 * Edition License.
15 *
16 * See https://visp.inria.fr for more information.
17 *
18 * This software was developed at:
19 * Inria Rennes - Bretagne Atlantique
20 * Campus Universitaire de Beaulieu
21 * 35042 Rennes Cedex
22 * France
23 *
24 * If you have questions regarding the use of this file, please contact
25 * Inria at visp@inria.fr
26 *
27 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29 *
30 * Description:
31 * Backend functions implementation for image I/O operations.
32 */
33
38
39#ifndef _vpImageIoBackend_h_
40#define _vpImageIoBackend_h_
41
42#include <visp3/core/vpImage.h>
43
45
46// Portable FloatMap format (PFM)
47// Portable Graymap format (PGM)
48// Portable Pixmap format (PPM)
49void vp_writePFM(const vpImage<float> &I, const std::string &filename);
50void vp_writePFM_HDR(const vpImage<float> &I, const std::string &filename);
51void vp_writePFM_HDR(const vpImage<vpRGBf> &I, const std::string &filename);
52void vp_writePGM(const vpImage<unsigned char> &I, const std::string &filename);
53void vp_writePGM(const vpImage<short> &I, const std::string &filename);
54void vp_writePGM(const vpImage<vpRGBa> &I, const std::string &filename);
55void vp_readPFM(vpImage<float> &I, const std::string &filename);
56void vp_readPFM_HDR(vpImage<float> &I, const std::string &filename);
57void vp_readPFM_HDR(vpImage<vpRGBf> &I, const std::string &filename);
58void vp_readPGM(vpImage<unsigned char> &I, const std::string &filename);
59void vp_readPGM(vpImage<vpRGBa> &I, const std::string &filename);
60void vp_readPPM(vpImage<unsigned char> &I, const std::string &filename);
61void vp_readPPM(vpImage<vpRGBa> &I, const std::string &filename);
62void vp_writePPM(const vpImage<unsigned char> &I, const std::string &filename);
63void vp_writePPM(const vpImage<vpRGBa> &I, const std::string &filename);
64
65// libjpeg
66void readJPEGLibjpeg(vpImage<unsigned char> &I, const std::string &filename);
67void readJPEGLibjpeg(vpImage<vpRGBa> &I, const std::string &filename);
68
69void writeJPEGLibjpeg(const vpImage<unsigned char> &I, const std::string &filename, int quality);
70void writeJPEGLibjpeg(const vpImage<vpRGBa> &I, const std::string &filename, int quality);
71
72// libpng
73void readPNGLibpng(vpImage<unsigned char> &I, const std::string &filename);
74void readPNGLibpng(vpImage<vpRGBa> &I, const std::string &filename);
75
76void writePNGLibpng(const vpImage<unsigned char> &I, const std::string &filename);
77void writePNGLibpng(const vpImage<vpRGBa> &I, const std::string &filename);
78
79#if defined(VISP_HAVE_OPENCV) && \
80 (((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_IMGCODECS)) || \
81 ((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI) && defined(HAVE_OPENCV_IMGPROC)))
82// OpenCV
83void readOpenCV(vpImage<unsigned char> &I, const std::string &filename);
84void readOpenCV(vpImage<vpRGBa> &I, const std::string &filename);
85void readOpenCV(vpImage<float> &I, const std::string &filename);
86void readOpenCV(vpImage<vpRGBf> &I, const std::string &filename);
87
88void writeOpenCV(const vpImage<unsigned char> &I, const std::string &filename, int quality);
89void writeOpenCV(const vpImage<vpRGBa> &I, const std::string &filename, int quality);
90void writeOpenCV(const vpImage<float> &I, const std::string &filename);
91void writeOpenCV(const vpImage<vpRGBf> &I, const std::string &filename);
92
93void readPNGfromMemOpenCV(const std::vector<unsigned char> &buffer, vpImage<unsigned char> &I);
94void readPNGfromMemOpenCV(const std::vector<unsigned char> &buffer, vpImage<vpRGBa> &I);
95
96void writePNGtoMemOpenCV(const vpImage<unsigned char> &I, std::vector<unsigned char> &buffer);
97void writePNGtoMemOpenCV(const vpImage<vpRGBa> &I, std::vector<unsigned char> &buffer, bool saveAlpha);
98#endif
99
100#if defined(VISP_HAVE_SIMDLIB)
101// Simd lib
102void readSimdlib(vpImage<unsigned char> &I, const std::string &filename);
103void readSimdlib(vpImage<vpRGBa> &I, const std::string &filename);
104
105void writeJPEGSimdlib(const vpImage<unsigned char> &I, const std::string &filename, int quality);
106void writeJPEGSimdlib(const vpImage<vpRGBa> &I, const std::string &filename, int quality);
107
108void writePNGSimdlib(const vpImage<unsigned char> &I, const std::string &filename);
109void writePNGSimdlib(const vpImage<vpRGBa> &I, const std::string &filename);
110#endif
111
112#if defined(VISP_HAVE_TINYEXR)
113// TinyEXR lib
114void readEXRTiny(vpImage<float> &I, const std::string &filename);
115void readEXRTiny(vpImage<vpRGBf> &I, const std::string &filename);
116
117void writeEXRTiny(const vpImage<float> &I, const std::string &filename);
118void writeEXRTiny(const vpImage<vpRGBf> &I, const std::string &filename);
119#endif
120
121#if defined(VISP_HAVE_STBIMAGE)
122// stb_image lib
123void readStb(vpImage<unsigned char> &I, const std::string &filename);
124void readStb(vpImage<vpRGBa> &I, const std::string &filename);
125
126void writeJPEGStb(const vpImage<unsigned char> &I, const std::string &filename, int quality);
127void writeJPEGStb(const vpImage<vpRGBa> &I, const std::string &filename, int quality);
128
129void writePNGStb(const vpImage<unsigned char> &I, const std::string &filename);
130void writePNGStb(const vpImage<vpRGBa> &I, const std::string &filename);
131
132void readPNGfromMemStb(const std::vector<unsigned char> &buffer, vpImage<unsigned char> &I);
133void readPNGfromMemStb(const std::vector<unsigned char> &buffer, vpImage<vpRGBa> &I);
134
135void writePNGtoMemStb(const vpImage<unsigned char> &I, std::vector<unsigned char> &buffer);
136void writePNGtoMemStb(const vpImage<vpRGBa> &I, std::vector<unsigned char> &buffer, bool saveAlpha);
137#endif
138
139END_VISP_NAMESPACE
140
141#endif
Definition of the vpImage class member functions.
Definition vpImage.h:131