segmentation
All Data Structures Namespaces Files Functions Variables Modules Pages
Pixel.h
1 /*
2  * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 // Autogenerated by Thrift Compiler (0.12.0-yarped)
10 //
11 // This is an automatically generated file.
12 // It could get re-generated if the ALLOW_IDL_GENERATION flag is on.
13 
14 #ifndef YARP_THRIFT_GENERATOR_STRUCT_PIXEL_H
15 #define YARP_THRIFT_GENERATOR_STRUCT_PIXEL_H
16 
17 #include <yarp/os/Wire.h>
18 #include <yarp/os/idl/WireTypes.h>
19 
20 namespace yarp {
21 namespace sig {
22 
26 class Pixel :
27  public yarp::os::idl::WirePortable
28 {
29 public:
30  // Fields
34  std::int32_t x;
38  std::int32_t y;
39 
40  // Default constructor
41  Pixel();
42 
43  // Constructor with field values
44  Pixel(const std::int32_t x,
45  const std::int32_t y);
46 
47  // Read structure on a Wire
48  bool read(yarp::os::idl::WireReader& reader) override;
49 
50  // Read structure on a Connection
51  bool read(yarp::os::ConnectionReader& connection) override;
52 
53  // Write structure on a Wire
54  bool write(const yarp::os::idl::WireWriter& writer) const override;
55 
56  // Write structure on a Connection
57  bool write(yarp::os::ConnectionWriter& connection) const override;
58 
59  // Convert to a printable string
60  std::string toString() const;
61 
62  // If you want to serialize this class without nesting, use this helper
63  typedef yarp::os::idl::Unwrapped<Pixel> unwrapped;
64 
65  class Editor :
66  public yarp::os::Wire,
67  public yarp::os::PortWriter
68  {
69  public:
70  // Editor: default constructor
71  Editor();
72 
73  // Editor: constructor with base class
74  Editor(Pixel& obj);
75 
76  // Editor: destructor
77  ~Editor() override;
78 
79  // Editor: Deleted constructors and operator=
80  Editor(const Editor& rhs) = delete;
81  Editor(Editor&& rhs) = delete;
82  Editor& operator=(const Editor& rhs) = delete;
83  Editor& operator=(Editor&& rhs) = delete;
84 
85  // Editor: edit
86  bool edit(Pixel& obj, bool dirty = true);
87 
88  // Editor: validity check
89  bool isValid() const;
90 
91  // Editor: state
92  Pixel& state();
93 
94  // Editor: start editing
95  void start_editing();
96 
97 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
98  YARP_DEPRECATED_MSG("Use start_editing() instead")
99  void begin()
100  {
101  start_editing();
102  }
103 #endif // YARP_NO_DEPRECATED
104 
105  // Editor: stop editing
106  void stop_editing();
107 
108 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
109  YARP_DEPRECATED_MSG("Use stop_editing() instead")
110  void end()
111  {
112  stop_editing();
113  }
114 #endif // YARP_NO_DEPRECATED
115 
116  // Editor: x field
117  void set_x(const std::int32_t x);
118  std::int32_t get_x() const;
119  virtual bool will_set_x();
120  virtual bool did_set_x();
121 
122  // Editor: y field
123  void set_y(const std::int32_t y);
124  std::int32_t get_y() const;
125  virtual bool will_set_y();
126  virtual bool did_set_y();
127 
128  // Editor: clean
129  void clean();
130 
131  // Editor: read
132  bool read(yarp::os::ConnectionReader& connection) override;
133 
134  // Editor: write
135  bool write(yarp::os::ConnectionWriter& connection) const override;
136 
137  private:
138  // Editor: state
139  Pixel* obj;
140  bool obj_owned;
141  int group;
142 
143  // Editor: dirty variables
144  bool is_dirty;
145  bool is_dirty_x;
146  bool is_dirty_y;
147  int dirty_count;
148 
149  // Editor: send if possible
150  void communicate();
151 
152  // Editor: mark dirty overall
153  void mark_dirty();
154 
155  // Editor: mark dirty single fields
156  void mark_dirty_x();
157  void mark_dirty_y();
158 
159  // Editor: dirty_flags
160  void dirty_flags(bool flag);
161  };
162 
163 private:
164  // read/write x field
165  bool read_x(yarp::os::idl::WireReader& reader);
166  bool write_x(const yarp::os::idl::WireWriter& writer) const;
167  bool nested_read_x(yarp::os::idl::WireReader& reader);
168  bool nested_write_x(const yarp::os::idl::WireWriter& writer) const;
169 
170  // read/write y field
171  bool read_y(yarp::os::idl::WireReader& reader);
172  bool write_y(const yarp::os::idl::WireWriter& writer) const;
173  bool nested_read_y(yarp::os::idl::WireReader& reader);
174  bool nested_write_y(const yarp::os::idl::WireWriter& writer) const;
175 };
176 
177 } // namespace yarp
178 } // namespace sig
179 
180 #endif // YARP_THRIFT_GENERATOR_STRUCT_PIXEL_H
Pixel position in the image frame.
Definition: Pixel.h:28
std::int32_t y
Index of pixel along vertical axis.
Definition: Pixel.h:38
std::int32_t x
Index of pixel along horizontal axis.
Definition: Pixel.h:34