YARP
Yet Another Robot Platform
IFrameGrabberImage.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_DEV_IFRAMEGRABBERIMAGE_H
8 #define YARP_DEV_IFRAMEGRABBERIMAGE_H
9 
10 #include <yarp/dev/api.h>
11 #include <yarp/sig/Image.h>
12 #include <yarp/sig/Vector.h>
13 
14 typedef enum {
15  YARP_CROP_RECT = 0, // Rectangular region of interest style, requires the two corner as a parameter
16  YARP_CROP_LIST // Unordered list of points, the returned image will be a nx1 image with n the
17  // number of points required by user (size of input vector), with the corresponding
18  // pixel color.
20 
21 namespace yarp {
22 namespace dev {
23 
30 {
31 public:
36 
41  virtual int height() const = 0;
42 
47  virtual int width() const = 0;
48 };
49 
50 template <typename ImageType>
53 {
54 public:
61  virtual bool getImage(ImageType& image) = 0;
62 
77  virtual bool getImageCrop(cropType_id_t cropType,
78  yarp::sig::VectorOf<std::pair<int, int>> vertices,
79  ImageType& image);
80 };
81 
84 
89 
90 } // namespace dev
91 } // namespace yarp
92 
93 #endif // YARP_DEV_IFRAMEGRABBERIMAGE_H
cropType_id_t
@ YARP_CROP_LIST
@ YARP_CROP_RECT
contains the definition of a Vector type
Read a YARP-format image from a device.
virtual int width() const =0
Return the width of each frame.
virtual int height() const =0
Return the height of each frame.
virtual ~IFrameGrabberImageBase()
Destructor.
virtual bool getImageCrop(cropType_id_t cropType, yarp::sig::VectorOf< std::pair< int, int >> vertices, ImageType &image)
Get a crop of the image from the frame grabber.
virtual bool getImage(ImageType &image)=0
Get an image from the frame grabber.
Provides:
Definition: Vector.h:119
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18
#define YARP_dev_EXTERN
Definition: api.h:19