YARP
Yet Another Robot Platform
ImageUtils.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_SIG_IMAGEUTILS_H
7 #define YARP_SIG_IMAGEUTILS_H
8 
9 #include <utility> // std::pair
10 #include <yarp/sig/Image.h>
11 
12 namespace yarp {
13 namespace sig{
19 namespace utils
20 {
21 
30 bool YARP_sig_API vertSplit(const yarp::sig::Image& inImg, yarp::sig::Image& outImgL, yarp::sig::Image& outImgR);
31 
40 bool YARP_sig_API horzSplit(const yarp::sig::Image& inImg, yarp::sig::Image& outImgUp, yarp::sig::Image& outImgDown);
41 
51 bool YARP_sig_API horzConcat(const yarp::sig::Image& inImgL, const yarp::sig::Image& inImgR, yarp::sig::Image& outImg);
52 
62 bool YARP_sig_API vertConcat(const yarp::sig::Image& inImgUp, const yarp::sig::Image& inImgDown, yarp::sig::Image& outImg);
63 
74 bool YARP_sig_API cropRect(const yarp::sig::Image& inImg,
75  const std::pair<unsigned int, unsigned int>& vertex1,
76  const std::pair<unsigned int, unsigned int>& vertex2,
77  yarp::sig::Image& outImg);
78 } // namespace utils
79 } // namespace sig
80 } // namespace yarp
81 
82 #endif // YARP_SIG_IMAGEUTILS_H
Base class for storing images.
Definition: Image.h:82
bool vertSplit(const yarp::sig::Image &inImg, yarp::sig::Image &outImgL, yarp::sig::Image &outImgR)
Split vertically an image in two images of the same size.
Definition: ImageUtils.cpp:23
bool cropRect(const yarp::sig::Image &inImg, const std::pair< unsigned int, unsigned int > &vertex1, const std::pair< unsigned int, unsigned int > &vertex2, yarp::sig::Image &outImg)
Crop a rectangle area out of an image given two opposite vertices.
Definition: ImageUtils.cpp:113
bool horzSplit(const yarp::sig::Image &inImg, yarp::sig::Image &outImgUp, yarp::sig::Image &outImgDown)
Split horizontally an image in two images of the same size.
Definition: ImageUtils.cpp:50
bool vertConcat(const yarp::sig::Image &inImgUp, const yarp::sig::Image &inImgDown, yarp::sig::Image &outImg)
Concatenate vertically two images of the same size in one with double height.
Definition: ImageUtils.cpp:98
bool horzConcat(const yarp::sig::Image &inImgL, const yarp::sig::Image &inImgR, yarp::sig::Image &outImg)
Concatenate horizontally two images of the same size in one with double width.
Definition: ImageUtils.cpp:67
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_sig_API
Definition: api.h:18