YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
12#include <yarp/os/Portable.h>
13
14#include <yarp/sig/Image.h>
15#include <yarp/sig/Vector.h>
16
17#include <yarp/dev/api.h>
19
20namespace yarp::dev
21{
22 typedef enum
23 {
24 YARP_CROP_RECT = 0, // Rectangular region of interest style, requires the two corner as a parameter
25 YARP_CROP_LIST // Unordered list of points, the returned image will be a nx1 image with n the
26 // number of points required by user (size of input vector), with the corresponding
27 // pixel color.
29
31 {
32 public:
33 virtual ~vertex_t();
34 vertex_t() = default;
35 vertex_t(int x, int y);
36
37 int x=0;
38 int y=0;
39
40 bool read(yarp::os::ConnectionReader& connection) override;
41 bool write(yarp::os::ConnectionWriter& connection) const override;
42
43 };
44} // namespace yarp::dev
45
46namespace yarp::dev {
47
54{
55public:
60
65 virtual int height() const = 0;
66
71 virtual int width() const = 0;
72};
73
79template <typename ImageType>
82{
83public:
91
107 std::vector<vertex_t> vertices,
109};
110
113
118
119} // namespace yarp::dev
120
121#endif // YARP_DEV_IFRAMEGRABBERIMAGE_H
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.
Read a YARP-format image (of a specific type) from a device.
virtual yarp::dev::ReturnValue getImageCrop(yarp::dev::cropType_id_t cropType, std::vector< vertex_t > vertices, ImageType &image)
Get a crop of the image from the frame grabber.
virtual yarp::dev::ReturnValue getImage(ImageType &image)=0
Get an image from the frame grabber.
An interface for reading from a network connection.
An interface for writing to a network connection.
This is a base class for objects that can be both read from and be written to the YARP network.
Definition Portable.h:25
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