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::dev {
22 
29 {
30 public:
35 
40  virtual int height() const = 0;
41 
46  virtual int width() const = 0;
47 };
48 
49 template <typename ImageType>
52 {
53 public:
60  virtual bool getImage(ImageType& image) = 0;
61 
76  virtual bool getImageCrop(cropType_id_t cropType,
77  yarp::sig::VectorOf<std::pair<int, int>> vertices,
78  ImageType& image);
79 };
80 
83 
88 
89 } // namespace yarp::dev
90 
91 #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:117
For streams capable of holding different kinds of content, check what they actually have.
#define YARP_dev_API
Definition: api.h:18
#define YARP_dev_EXTERN
Definition: api.h:19