All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
buffer.cc
Go to the documentation of this file.
1 /*
2  * This file is part of the rc_genicam_api package.
3  *
4  * Copyright (c) 2017 Roboception GmbH
5  * All rights reserved
6  *
7  * Author: Heiko Hirschmueller
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright notice,
16  * this list of conditions and the following disclaimer in the documentation
17  * and/or other materials provided with the distribution.
18  *
19  * 3. Neither the name of the copyright holder nor the names of its contributors
20  * may be used to endorse or promote products derived from this software without
21  * specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #include "buffer.h"
37 #include "stream.h"
38 #include "config.h"
39 
40 #include "gentl_wrapper.h"
41 #include "exception.h"
42 
43 #include <GenApi/ChunkAdapterGEV.h>
44 #include <GenApi/ChunkAdapterU3V.h>
46 
47 namespace rcg
48 {
49 
50 namespace
51 {
52 
53 template<class T> inline T getBufferValue(const std::shared_ptr<const GenTLWrapper> &gentl,
54  void *stream, void *buffer, GenTL::BUFFER_INFO_CMD cmd)
55 {
56  T ret=0;
57 
59  size_t size=sizeof(T);
60 
61  if (stream != 0 && buffer != 0)
62  {
63  if (gentl->DSGetBufferInfo(stream, buffer, cmd, &type, &ret, &size) != GenTL::GC_ERR_SUCCESS)
64  {
65  ret=0;
66  }
67  }
68 
69  return ret;
70 }
71 
72 inline bool getBufferBool(const std::shared_ptr<const GenTLWrapper> &gentl,
73  void *stream, void *buffer, GenTL::BUFFER_INFO_CMD cmd)
74 {
75  bool8_t ret=0;
76 
78  size_t size=sizeof(ret);
79 
80  if (stream != 0 && buffer != 0)
81  {
82  gentl->DSGetBufferInfo(stream, buffer, cmd, &type, &ret, &size);
83  }
84 
85  return ret != 0;
86 }
87 
88 inline std::string getBufferString(const std::shared_ptr<const GenTLWrapper> &gentl,
89  void *stream, void *buffer, GenTL::BUFFER_INFO_CMD cmd)
90 {
91  std::string ret;
92 
94  char tmp[1024]="";
95  size_t size=sizeof(tmp);
96 
97  if (stream != 0 && buffer != 0)
98  {
99  if (gentl->DSGetBufferInfo(stream, buffer, cmd, &type, &tmp, &size) == GenTL::GC_ERR_SUCCESS)
100  {
101  if (type == GenTL::INFO_DATATYPE_STRING)
102  {
103  ret=tmp;
104  }
105  }
106  }
107 
108  return ret;
109 }
110 
111 template<class T> inline T getBufferPartValue(const std::shared_ptr<const GenTLWrapper> &gentl,
112  void *stream, void *buffer, uint32_t part,
114 {
115  T ret=0;
116 
118  size_t size=sizeof(T);
119 
120  if (stream != 0 && buffer != 0)
121  {
122  gentl->DSGetBufferPartInfo(stream, buffer, part, cmd, &type, &ret, &size);
123  }
124 
125  return ret;
126 }
127 
128 }
129 
130 Buffer::Buffer(const std::shared_ptr<const GenTLWrapper> &_gentl, Stream *_parent)
131 {
132  parent=_parent;
133  gentl=_gentl;
134  buffer=0;
135  multipart=false;
136 }
137 
139 {
140  if (chunkadapter)
141  {
142  chunkadapter->DetachBuffer();
143  }
144 }
145 
146 void Buffer::setNodemap(const std::shared_ptr<GenApi::CNodeMapRef> _nodemap, const std::string &tltype)
147 {
148  nodemap=_nodemap;
149  chunkadapter.reset();
150 
151  if (nodemap != 0)
152  {
153  if (getBoolean(nodemap, "ChunkModeActive", false))
154  {
155  if (tltype == "GEV")
156  {
157  chunkadapter=std::shared_ptr<GenApi::CChunkAdapter>(new GenApi::CChunkAdapterGEV(nodemap->_Ptr));
158  }
159  else if (tltype == "U3V")
160  {
161  chunkadapter=std::shared_ptr<GenApi::CChunkAdapter>(new GenApi::CChunkAdapterU3V(nodemap->_Ptr));
162  }
163  else
164  {
165  chunkadapter=std::shared_ptr<GenApi::CChunkAdapter>(new GenApi::CChunkAdapterGeneric(nodemap->_Ptr));
166  }
167  }
168  }
169 }
170 
171 void Buffer::setHandle(void *handle)
172 {
173  buffer=handle;
174 
176  multipart=false;
177 
178  if (buffer != 0)
179  {
180  payload_type=getBufferValue<size_t>(gentl, parent->getHandle(), buffer,
182 
183  multipart=getBufferValue<size_t>(gentl, parent->getHandle(), buffer,
185 
186  if (chunkadapter && !getBufferBool(gentl, parent->getHandle(), buffer,
188  {
189  chunkadapter->AttachBuffer(reinterpret_cast<uint8_t *>(
190  getBufferValue<void *>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_BASE)),
191  static_cast<int64_t>(getBufferValue<size_t>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_SIZE_FILLED)));
192  }
193  }
194  else
195  {
196  if (chunkadapter)
197  {
198  chunkadapter->DetachBuffer();
199  }
200  }
201 }
202 
203 uint32_t Buffer::getNumberOfParts() const
204 {
205  uint32_t ret=0;
206 
207  if (multipart)
208  {
209  gentl->DSGetNumBufferParts(parent->getHandle(), buffer, &ret);
210  }
211  else
212  {
213  size_t type=getBufferValue<size_t>(gentl, parent->getHandle(), buffer,
215 
216  if (type != PAYLOAD_TYPE_CHUNK_ONLY)
217  {
218  ret=1;
219  }
220  }
221 
222  return ret;
223 }
224 
226 {
227  return getBufferValue<void *>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_BASE);
228 }
229 
230 size_t Buffer::getGlobalSize() const
231 {
232  return getBufferValue<size_t>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_SIZE);
233 }
234 
235 void *Buffer::getBase(uint32_t part) const
236 {
237  if (multipart)
238  {
239  return getBufferPartValue<void *>(gentl, parent->getHandle(), buffer, part,
241  }
242  else
243  {
244  void *ret=getBufferValue<void *>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_BASE);
245 
246  size_t offset=getBufferValue<size_t>(gentl, parent->getHandle(), buffer,
248 
249  if (offset > 0)
250  {
251  ret=reinterpret_cast<char *>(ret)+offset;
252  }
253 
254  return ret;
255  }
256 }
257 
258 size_t Buffer::getSize(uint32_t part) const
259 {
260  if (multipart)
261  {
262  return getBufferPartValue<size_t>(gentl, parent->getHandle(), buffer, part,
264  }
265  else
266  {
267  size_t size=getBufferValue<size_t>(gentl, parent->getHandle(), buffer,
269 
270  size_t offset=getBufferValue<size_t>(gentl, parent->getHandle(), buffer,
272 
273  return size-offset;
274  }
275 }
276 
277 void *Buffer::getUserPtr() const
278 {
279  return getBufferValue<void *>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_USER_PTR);
280 }
281 
282 uint64_t Buffer::getTimestamp() const
283 {
285  {
286  try
287  {
288  return getInteger(nodemap, "ChunkTimestamp", 0, 0, true);
289  }
290  catch (const std::exception &)
291  {
292  // ignore error and try getBufferValue()
293  }
294  }
295 
296  return getBufferValue<uint64_t>(gentl, parent->getHandle(), buffer,
298 }
299 
300 bool Buffer::getNewData() const
301 {
302  return getBufferBool(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_NEW_DATA);
303 }
304 
306 {
307  return getBufferBool(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_IS_QUEUED);
308 }
309 
311 {
312  return getBufferBool(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_IS_ACQUIRING);
313 }
314 
316 {
317  return getBufferBool(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_IS_INCOMPLETE);
318 }
319 
320 std::string Buffer::getTLType() const
321 {
322  return getBufferString(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_TLTYPE);
323 }
324 
325 size_t Buffer::getSizeFilled() const
326 {
327  return getBufferValue<size_t>(gentl, parent->getHandle(), buffer,
329 }
330 
331 size_t Buffer::getPartDataType(uint32_t part) const
332 {
333  if (multipart)
334  {
335  return getBufferPartValue<size_t>(gentl, parent->getHandle(), buffer, part,
337  }
338  else
339  {
340  return 0;
341  }
342 }
343 
344 size_t Buffer::getWidth(uint32_t part) const
345 {
346  if (multipart)
347  {
348  return getBufferPartValue<size_t>(gentl, parent->getHandle(), buffer, part,
350  }
351  else
352  {
354  {
355  try
356  {
357  return getInteger(nodemap, "ChunkWidth", 0, 0, true);
358  }
359  catch (const std::exception &)
360  {
361  // ignore error and try getBufferValue()
362  }
363  }
364 
365  return getBufferValue<size_t>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_WIDTH);
366  }
367 }
368 
369 size_t Buffer::getHeight(uint32_t part) const
370 {
371  if (multipart)
372  {
373  return getBufferPartValue<size_t>(gentl, parent->getHandle(), buffer, part,
375  }
376  else
377  {
379  {
380  try
381  {
382  return getInteger(nodemap, "ChunkHeight", 0, 0, true);
383  }
384  catch (const std::exception &)
385  {
386  // ignore error and try getBufferValue()
387  }
388  }
389 
390  return getBufferValue<size_t>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_HEIGHT);
391  }
392 }
393 
394 size_t Buffer::getXOffset(uint32_t part) const
395 {
396  if (multipart)
397  {
398  return getBufferPartValue<size_t>(gentl, parent->getHandle(), buffer, part,
400  }
401  else
402  {
404  {
405  try
406  {
407  return getInteger(nodemap, "ChunkOffsetX", 0, 0, true);
408  }
409  catch (const std::exception &)
410  {
411  // ignore error and try getBufferValue()
412  }
413  }
414 
415  return getBufferValue<size_t>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_XOFFSET);
416  }
417 }
418 
419 size_t Buffer::getYOffset(uint32_t part) const
420 {
421  if (multipart)
422  {
423  return getBufferPartValue<size_t>(gentl, parent->getHandle(), buffer, part,
425  }
426  else
427  {
429  {
430  try
431  {
432  return getInteger(nodemap, "ChunkOffsetY", 0, 0, true);
433  }
434  catch (const std::exception &)
435  {
436  // ignore error and try getBufferValue()
437  }
438  }
439 
440  return getBufferValue<size_t>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_YOFFSET);
441  }
442 }
443 
444 size_t Buffer::getXPadding(uint32_t part) const
445 {
446  if (multipart)
447  {
448  return getBufferPartValue<size_t>(gentl, parent->getHandle(), buffer, part,
450  }
451  else
452  {
453  return getBufferValue<size_t>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_XPADDING);
454  }
455 }
456 
457 size_t Buffer::getYPadding() const
458 {
459  if (multipart)
460  {
461  return 0;
462  }
463 
464  return getBufferValue<size_t>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_YPADDING);
465 }
466 
467 uint64_t Buffer::getFrameID() const
468 {
469  return getBufferValue<uint64_t>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_FRAMEID);
470 }
471 
472 bool Buffer::getImagePresent(uint32_t part) const
473 {
474  if (multipart)
475  {
476  size_t type=getBufferPartValue<size_t>(gentl, parent->getHandle(), buffer, part,
478 
479  bool ret;
480 
481  switch (type)
482  {
492  ret=true;
493  break;
494 
495  default:
496  ret=false;
497  break;
498  }
499 
500  return ret;
501  }
502  else
503  {
505  {
506  return true;
507  }
508 
509  return getBufferBool(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_IMAGEPRESENT);
510  }
511 }
512 
514 {
515  return getBufferValue<size_t>(gentl, parent->getHandle(), buffer,
517 }
518 
519 uint64_t Buffer::getPixelFormat(uint32_t part) const
520 {
521  if (multipart)
522  {
523  return getBufferPartValue<uint64_t>(gentl, parent->getHandle(), buffer, part,
525  }
526  else
527  {
529  {
530  try
531  {
532  return getInteger(nodemap, "ChunkPixelFormat", 0, 0, true);
533  }
534  catch (const std::exception &)
535  {
536  // ignore error and try getBufferValue()
537  }
538  }
539 
540  return getBufferValue<uint64_t>(gentl, parent->getHandle(), buffer,
542  }
543 }
544 
545 uint64_t Buffer::getPixelFormatNamespace(uint32_t part) const
546 {
547  if (multipart)
548  {
549  return getBufferPartValue<uint64_t>(gentl, parent->getHandle(), buffer, part,
551  }
552  else
553  {
554  return getBufferValue<uint64_t>(gentl, parent->getHandle(), buffer,
556  }
557 }
558 
559 uint64_t Buffer::getPartSourceID(uint32_t part) const
560 {
561  if (multipart)
562  {
563  return getBufferPartValue<uint64_t>(gentl, parent->getHandle(), buffer, part,
565  }
566  else
567  {
568  return 0;
569  }
570 }
571 
572 uint64_t Buffer::getPartRegionID(uint32_t part) const
573 {
574  if (multipart)
575  {
576  return getBufferPartValue<uint64_t>(gentl, parent->getHandle(), buffer, part,
578  }
579  else
580  {
581  return 0;
582  }
583 }
584 
585 uint64_t Buffer::getPartDataPurposeID(uint32_t part) const
586 {
587  if (multipart)
588  {
589  return getBufferPartValue<uint64_t>(gentl, parent->getHandle(), buffer, part,
591  }
592  else
593  {
594  return 0;
595  }
596 }
597 
598 size_t Buffer::getDeliveredImageHeight(uint32_t part) const
599 {
600  if (multipart)
601  {
602  return getBufferPartValue<size_t>(gentl, parent->getHandle(), buffer, part,
604  }
605  else
606  {
608  {
609  try
610  {
611  return getInteger(nodemap, "ChunkHeight", 0, 0, true);
612  }
613  catch (const std::exception &)
614  {
615  // ignore error and try getBufferValue()
616  }
617  }
618 
619  return getBufferValue<size_t>(gentl, parent->getHandle(), buffer,
621  }
622 }
623 
625 {
626  return getBufferValue<size_t>(gentl, parent->getHandle(), buffer,
628 }
629 
630 uint64_t Buffer::getChunkLayoutID() const
631 {
632  return getBufferValue<uint64_t>(gentl, parent->getHandle(), buffer,
634 }
635 
636 std::string Buffer::getFilename() const
637 {
638  return getBufferString(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_FILENAME);
639 }
640 
642 {
643  bool ret=false;
644 
646  int32_t v;
647  size_t size=sizeof(v);
649 
650  if (parent->getHandle() != 0 && buffer != 0)
651  {
653  &type, &v, &size);
654 
655  if (err == GenTL::GC_ERR_SUCCESS && type == GenTL::INFO_DATATYPE_INT32 &&
657  {
658  ret=true;
659  }
660  }
661 
662  return ret;
663 }
664 
665 size_t Buffer::getDataSize() const
666 {
667  return getBufferValue<size_t>(gentl, parent->getHandle(), buffer, GenTL::BUFFER_INFO_DATA_SIZE);
668 }
669 
670 uint64_t Buffer::getTimestampNS() const
671 {
672  uint64_t ret=getBufferValue<uint64_t>(gentl, parent->getHandle(), buffer,
674 
675  // if timestamp in nano seconds is not available, then compute it from
676  // timestamp and device frequency
677 
678  if (ret == 0)
679  {
680  const uint64_t ns_freq=1000000000ul;
681  uint64_t freq=parent->getParent()->getTimestampFrequency();
682 
683  if (freq == 0)
684  {
685  freq=ns_freq;
686  }
687 
688  ret=getBufferValue<uint64_t>(gentl, parent->getHandle(), buffer,
690 
691  if (freq != ns_freq)
692  {
693  ret=ret/freq*ns_freq+(ns_freq*(ret%freq))/freq;
694  }
695  }
696 
697  return ret;
698 }
699 
701 {
702  return getBufferBool(gentl, parent->getHandle(), buffer,
704 }
705 
707 {
709  {
710  return true;
711  }
712 
713  return getBufferBool(gentl, parent->getHandle(), buffer,
715 }
716 
717 void *Buffer::getHandle() const
718 {
719  return buffer;
720 }
721 
723 {
724  int p=1;
725  char *c=reinterpret_cast<char *>(&p);
726 
727  if (c[0] == 1)
728  {
729  return false;
730  }
731 
732  return true;
733 }
734 
735 }
BUFFER_PART_INFO_WIDTH
@ BUFFER_PART_INFO_WIDTH
Definition: GenTL_v1_6.h:450
INFO_DATATYPE
int32_t INFO_DATATYPE
Definition: GenTL_v1_6.h:261
BUFFER_INFO_SIZE
@ BUFFER_INFO_SIZE
Definition: GenTL_v1_6.h:405
INFO_DATATYPE_STRING
@ INFO_DATATYPE_STRING
Definition: GenTL_v1_6.h:244
rcg::Buffer::getDeliveredImageHeight
size_t getDeliveredImageHeight(uint32_t part) const
Returns the number of lines that are delivered in this buffer.
Definition: buffer.cc:598
rcg::Buffer::getChunkLayoutID
uint64_t getChunkLayoutID() const
Returns the chunk layout id, which serves as an indicator that the chunk layout has changed and the a...
Definition: buffer.cc:630
rcg::Buffer::getGlobalSize
size_t getGlobalSize() const
Returns the global size of the buffer.
Definition: buffer.cc:230
BUFFER_INFO_TLTYPE
@ BUFFER_INFO_TLTYPE
Definition: GenTL_v1_6.h:412
rcg::PAYLOAD_TYPE_UNKNOWN
@ PAYLOAD_TYPE_UNKNOWN
Definition: buffer.h:58
ChunkAdapterU3V.h
Declaration of the CChunkAdapterU3V class.
BUFFER_INFO_CMD
int32_t BUFFER_INFO_CMD
Definition: GenTL_v1_6.h:439
rcg::isHostBigEndian
bool isHostBigEndian()
Definition: buffer.cc:722
rcg::Buffer::setNodemap
void setNodemap(const std::shared_ptr< GenApi::CNodeMapRef > nodemap, const std::string &tltype)
Set the device nodemap.
Definition: buffer.cc:146
BUFFER_PART_INFO_XOFFSET
@ BUFFER_PART_INFO_XOFFSET
Definition: GenTL_v1_6.h:452
rcg::Buffer::getImagePresent
bool getImagePresent(uint32_t part) const
Returns if a 2D, 3D or confidence image is present in the specified part.
Definition: buffer.cc:472
ChunkAdapterGEV.h
Declaration of the CChunkAdapterGEV class.
rcg::getBoolean
bool getBoolean(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, bool exception, bool igncache)
Get the value of a boolean feature of the given nodemap.
Definition: config.cc:589
rcg::Buffer::getPartDataType
size_t getPartDataType(uint32_t part) const
Returns the data type id of the specified part as defined in PARTDATATYPE_IDS.
Definition: buffer.cc:331
rcg::Buffer::getDeliveredChunkPayloadSize
size_t getDeliveredChunkPayloadSize() const
Returnes the delivered chung payload size.
Definition: buffer.cc:624
rcg::Buffer::getTLType
std::string getTLType() const
Returns the type the used transport layer.
Definition: buffer.cc:320
rcg::Buffer::parent
Stream * parent
Definition: buffer.h:491
rcg::Buffer::getFilename
std::string getFilename() const
Returns the filename in case the payload contains a file.
Definition: buffer.cc:636
BUFFER_INFO_PIXELFORMAT
@ BUFFER_INFO_PIXELFORMAT
Definition: GenTL_v1_6.h:424
rcg::Buffer::setHandle
void setHandle(void *handle)
Set the buffer handle that this object should manage.
Definition: buffer.cc:171
rcg::PART_DATATYPE_3D_IMAGE
@ PART_DATATYPE_3D_IMAGE
Definition: buffer.h:101
BUFFER_PART_INFO_REGION_ID
@ BUFFER_PART_INFO_REGION_ID
Definition: GenTL_v1_6.h:457
rcg::PART_DATATYPE_3D_PLANE_QUADPLANAR
@ PART_DATATYPE_3D_PLANE_QUADPLANAR
Definition: buffer.h:104
rcg::Stream
The stream class encapsulates a Genicam stream.
Definition: stream.h:55
rcg::Buffer::payload_type
size_t payload_type
Definition: buffer.h:494
rcg::Buffer::getTimestampNS
uint64_t getTimestampNS() const
Returns the acquisition timestamp of the data in this buffer in ns.
Definition: buffer.cc:670
rcg::Buffer::getHandle
void * getHandle() const
Get internal stream handle.
Definition: buffer.cc:717
rcg::Buffer::getPartRegionID
uint64_t getPartRegionID(uint32_t part) const
Returns the region id of the specified part.
Definition: buffer.cc:572
rcg::Buffer::getNumberOfParts
uint32_t getNumberOfParts() const
Returns the number of parts, excluding chunk data.
Definition: buffer.cc:203
rcg::Buffer::getYPadding
size_t getYPadding() const
Returns vertical padding of the data in the buffer in bytes.
Definition: buffer.cc:457
rcg::PART_DATATYPE_CONFIDENCE_MAP
@ PART_DATATYPE_CONFIDENCE_MAP
Definition: buffer.h:105
rcg::Buffer::getUserPtr
void * getUserPtr() const
Returns the private data pointer of the GenTL Consumer.
Definition: buffer.cc:277
BUFFER_INFO_XPADDING
@ BUFFER_INFO_XPADDING
Definition: GenTL_v1_6.h:418
BUFFER_INFO_CHUNKLAYOUTID
@ BUFFER_INFO_CHUNKLAYOUTID
Definition: GenTL_v1_6.h:428
GC_ERROR
int32_t GC_ERROR
Definition: GenTL_v1_6.h:185
rcg::Buffer::getIsIncomplete
bool getIsIncomplete() const
Signals if the buffer is incomplete due to an error.
Definition: buffer.cc:315
rcg
Definition: buffer.cc:47
rcg::Buffer::getContainsChunkdata
bool getContainsChunkdata() const
Returns if the buffer contains chunk data.
Definition: buffer.cc:706
BUFFER_INFO_PAYLOADTYPE
@ BUFFER_INFO_PAYLOADTYPE
Definition: GenTL_v1_6.h:423
BUFFER_PART_INFO_DATA_SIZE
@ BUFFER_PART_INFO_DATA_SIZE
Definition: GenTL_v1_6.h:446
rcg::Stream::getHandle
void * getHandle() const
Get internal stream handle.
Definition: stream.cc:557
rcg::Buffer::getDataLargerThanBuffer
bool getDataLargerThanBuffer() const
Signals if the memory that was allocated for this buffer is too small.
Definition: buffer.cc:700
rcg::Buffer::getTimestamp
uint64_t getTimestamp() const
Returns the timestamp of the buffer.
Definition: buffer.cc:282
BUFFER_PART_INFO_CMD
int32_t BUFFER_PART_INFO_CMD
Definition: GenTL_v1_6.h:461
rcg::PART_DATATYPE_2D_PLANE_BIPLANAR
@ PART_DATATYPE_2D_PLANE_BIPLANAR
Definition: buffer.h:98
BUFFER_INFO_IMAGEPRESENT
@ BUFFER_INFO_IMAGEPRESENT
Definition: GenTL_v1_6.h:421
BUFFER_PART_INFO_DELIVERED_IMAGEHEIGHT
@ BUFFER_PART_INFO_DELIVERED_IMAGEHEIGHT
Definition: GenTL_v1_6.h:456
rcg::Buffer::getHeight
size_t getHeight(uint32_t part) const
Returns the height of the image in pixel.
Definition: buffer.cc:369
rcg::Buffer::~Buffer
~Buffer()
Definition: buffer.cc:138
BUFFER_PART_INFO_DATA_FORMAT
@ BUFFER_PART_INFO_DATA_FORMAT
Definition: GenTL_v1_6.h:448
rcg::Buffer::getPayloadType
size_t getPayloadType() const
Returns the payload type according to PAYLOADTYPE_INFO_IDS.
Definition: buffer.cc:513
BUFFER_INFO_PIXELFORMAT_NAMESPACE
@ BUFFER_INFO_PIXELFORMAT_NAMESPACE
Definition: GenTL_v1_6.h:425
rcg::PAYLOAD_TYPE_CHUNK_ONLY
@ PAYLOAD_TYPE_CHUNK_ONLY
Definition: buffer.h:66
rcg::Buffer::getFrameID
uint64_t getFrameID() const
Returns the sequentially incremented number of the frame.
Definition: buffer.cc:467
GC_ERR_SUCCESS
@ GC_ERR_SUCCESS
Definition: GenTL_v1_6.h:158
rcg::Buffer::getSize
size_t getSize(uint32_t part) const
Returns the size of the specified part of the mult-part buffer.
Definition: buffer.cc:258
BUFFER_INFO_XOFFSET
@ BUFFER_INFO_XOFFSET
Definition: GenTL_v1_6.h:416
BUFFER_INFO_NEW_DATA
@ BUFFER_INFO_NEW_DATA
Definition: GenTL_v1_6.h:408
BUFFER_INFO_IS_ACQUIRING
@ BUFFER_INFO_IS_ACQUIRING
Definition: GenTL_v1_6.h:410
BUFFER_INFO_CONTAINS_CHUNKDATA
@ BUFFER_INFO_CONTAINS_CHUNKDATA
Definition: GenTL_v1_6.h:434
GENAPI_NAMESPACE::CChunkAdapterGEV
Connects a chunked DCAM buffer to a node map.
Definition: ChunkAdapterGEV.h:57
ChunkAdapterGeneric.h
Declaration of the CChunkAdapterGeneric class.
rcg::Buffer::getIsAcquiring
bool getIsAcquiring() const
Signals if the buffer is currently being filled with data.
Definition: buffer.cc:310
BUFFER_INFO_IMAGEOFFSET
@ BUFFER_INFO_IMAGEOFFSET
Definition: GenTL_v1_6.h:422
BUFFER_INFO_WIDTH
@ BUFFER_INFO_WIDTH
Definition: GenTL_v1_6.h:414
bool8_t
uint8_t bool8_t
Definition: GenTL_v1_6.h:108
stream.h
BUFFER_PART_INFO_DATA_TYPE
@ BUFFER_PART_INFO_DATA_TYPE
Definition: GenTL_v1_6.h:447
rcg::Buffer::getPartDataPurposeID
uint64_t getPartDataPurposeID(uint32_t part) const
Returns the data purpose id of the specified part.
Definition: buffer.cc:585
rcg::Buffer::getXOffset
size_t getXOffset(uint32_t part) const
Returns the horizontal offset of the data in the buffer in pixels from the image origin to handle are...
Definition: buffer.cc:394
rcg::Buffer::getSizeFilled
size_t getSizeFilled() const
Returns the number of bytes written into the buffer last time it has been filled.
Definition: buffer.cc:325
BUFFER_INFO_DATA_LARGER_THAN_BUFFER
@ BUFFER_INFO_DATA_LARGER_THAN_BUFFER
Definition: GenTL_v1_6.h:433
rcg::PART_DATATYPE_2D_IMAGE
@ PART_DATATYPE_2D_IMAGE
Definition: buffer.h:97
rcg::Buffer::getYOffset
size_t getYOffset(uint32_t part) const
Returns the vertical offset of the data in the buffer in lines from the image origin to handle areas ...
Definition: buffer.cc:419
rcg::Stream::getParent
std::shared_ptr< Device > getParent() const
Returns the pointer to the parent device object.
Definition: stream.cc:88
rcg::PAYLOAD_TYPE_MULTI_PART
@ PAYLOAD_TYPE_MULTI_PART
Definition: buffer.h:68
GENAPI_NAMESPACE::CChunkAdapterU3V
Connects a chunked U3V buffer to a node map.
Definition: ChunkAdapterU3V.h:56
rcg::Buffer::isBigEndian
bool isBigEndian() const
Returns if the data is given as big or little endian.
Definition: buffer.cc:641
BUFFER_PART_INFO_YOFFSET
@ BUFFER_PART_INFO_YOFFSET
Definition: GenTL_v1_6.h:453
rcg::PART_DATATYPE_3D_PLANE_TRIPLANAR
@ PART_DATATYPE_3D_PLANE_TRIPLANAR
Definition: buffer.h:103
BUFFER_INFO_PIXEL_ENDIANNESS
@ BUFFER_INFO_PIXEL_ENDIANNESS
Definition: GenTL_v1_6.h:430
rcg::Buffer::Buffer
Buffer(const std::shared_ptr< const GenTLWrapper > &gentl, Stream *parent)
Constructs a buffer class as wrapper around a buffer handle.
Definition: buffer.cc:130
buffer.h
rcg::Buffer::getXPadding
size_t getXPadding(uint32_t part) const
Returns horizontal padding of the data in the buffer in bytes.
Definition: buffer.cc:444
BUFFER_PART_INFO_DATA_PURPOSE_ID
@ BUFFER_PART_INFO_DATA_PURPOSE_ID
Definition: GenTL_v1_6.h:458
BUFFER_INFO_YPADDING
@ BUFFER_INFO_YPADDING
Definition: GenTL_v1_6.h:419
BUFFER_INFO_DATA_SIZE
@ BUFFER_INFO_DATA_SIZE
Definition: GenTL_v1_6.h:431
rcg::Buffer::gentl
std::shared_ptr< const GenTLWrapper > gentl
Definition: buffer.h:492
rcg::Buffer::getGlobalBase
void * getGlobalBase() const
Returns the global base address of the buffer memory.
Definition: buffer.cc:225
BUFFER_PART_INFO_SOURCE_ID
@ BUFFER_PART_INFO_SOURCE_ID
Definition: GenTL_v1_6.h:455
BUFFER_INFO_HEIGHT
@ BUFFER_INFO_HEIGHT
Definition: GenTL_v1_6.h:415
BUFFER_INFO_USER_PTR
@ BUFFER_INFO_USER_PTR
Definition: GenTL_v1_6.h:406
config.h
rcg::Buffer::chunkadapter
std::shared_ptr< GenApi::CChunkAdapter > chunkadapter
Definition: buffer.h:498
rcg::Buffer::getDataSize
size_t getDataSize() const
Returns the size of data intended to the written to the buffer the last time it has been filled.
Definition: buffer.cc:665
GENAPI_NAMESPACE::CChunkAdapterGeneric
Connects a generic chunked buffer to a node map.
Definition: ChunkAdapterGeneric.h:64
BUFFER_PART_INFO_XPADDING
@ BUFFER_PART_INFO_XPADDING
Definition: GenTL_v1_6.h:454
INFO_DATATYPE_INT32
@ INFO_DATATYPE_INT32
Definition: GenTL_v1_6.h:248
int64_t
__int64 int64_t
Definition: config-win32.h:21
BUFFER_INFO_DELIVERED_IMAGEHEIGHT
@ BUFFER_INFO_DELIVERED_IMAGEHEIGHT
Definition: GenTL_v1_6.h:426
rcg::Buffer::getNewData
bool getNewData() const
Returns if the buffer contains new data.
Definition: buffer.cc:300
BUFFER_INFO_SIZE_FILLED
@ BUFFER_INFO_SIZE_FILLED
Definition: GenTL_v1_6.h:413
BUFFER_INFO_DELIVERED_CHUNKPAYLOADSIZE
@ BUFFER_INFO_DELIVERED_CHUNKPAYLOADSIZE
Definition: GenTL_v1_6.h:427
rcg::Buffer::nodemap
std::shared_ptr< GenApi::CNodeMapRef > nodemap
Definition: buffer.h:497
rcg::PART_DATATYPE_3D_PLANE_BIPLANAR
@ PART_DATATYPE_3D_PLANE_BIPLANAR
Definition: buffer.h:102
rcg::Buffer::multipart
bool multipart
Definition: buffer.h:495
rcg::PART_DATATYPE_2D_PLANE_QUADPLANAR
@ PART_DATATYPE_2D_PLANE_QUADPLANAR
Definition: buffer.h:100
BUFFER_INFO_YOFFSET
@ BUFFER_INFO_YOFFSET
Definition: GenTL_v1_6.h:417
rcg::PAYLOAD_TYPE_CHUNK_DATA
@ PAYLOAD_TYPE_CHUNK_DATA
Definition: buffer.h:62
BUFFER_INFO_TIMESTAMP_NS
@ BUFFER_INFO_TIMESTAMP_NS
Definition: GenTL_v1_6.h:432
BUFFER_INFO_IS_QUEUED
@ BUFFER_INFO_IS_QUEUED
Definition: GenTL_v1_6.h:409
rcg::Buffer::getIsQueued
bool getIsQueued() const
Signals if the buffer is associated to the input or output queue.
Definition: buffer.cc:305
rcg::Buffer::getWidth
size_t getWidth(uint32_t part) const
Returns the width of the image in pixel.
Definition: buffer.cc:344
exception.h
rcg::getInteger
int64_t getInteger(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, int64_t *vmin, int64_t *vmax, bool exception, bool igncache)
Get the value of an integer feature of the given nodemap.
Definition: config.cc:634
BUFFER_INFO_BASE
@ BUFFER_INFO_BASE
Definition: GenTL_v1_6.h:404
BUFFER_INFO_FRAMEID
@ BUFFER_INFO_FRAMEID
Definition: GenTL_v1_6.h:420
BUFFER_PART_INFO_BASE
@ BUFFER_PART_INFO_BASE
Definition: GenTL_v1_6.h:445
rcg::Buffer::getPartSourceID
uint64_t getPartSourceID(uint32_t part) const
Returns the source id of the specified part.
Definition: buffer.cc:559
BUFFER_INFO_TIMESTAMP
@ BUFFER_INFO_TIMESTAMP
Definition: GenTL_v1_6.h:407
rcg::PART_DATATYPE_2D_PLANE_TRIPLANAR
@ PART_DATATYPE_2D_PLANE_TRIPLANAR
Definition: buffer.h:99
BUFFER_INFO_FILENAME
@ BUFFER_INFO_FILENAME
Definition: GenTL_v1_6.h:429
PIXELENDIANNESS_BIG
@ PIXELENDIANNESS_BIG
Definition: GenTL_v1_6.h:501
BUFFER_PART_INFO_DATA_FORMAT_NAMESPACE
@ BUFFER_PART_INFO_DATA_FORMAT_NAMESPACE
Definition: GenTL_v1_6.h:449
gentl_wrapper.h
BUFFER_INFO_IS_INCOMPLETE
@ BUFFER_INFO_IS_INCOMPLETE
Definition: GenTL_v1_6.h:411
BUFFER_PART_INFO_HEIGHT
@ BUFFER_PART_INFO_HEIGHT
Definition: GenTL_v1_6.h:451
rcg::Buffer::buffer
void * buffer
Definition: buffer.h:493
rcg::Buffer::getBase
void * getBase(uint32_t part) const
Returns the base address of the specified part of the multi-part buffer.
Definition: buffer.cc:235
rcg::Buffer::getPixelFormat
uint64_t getPixelFormat(uint32_t part) const
Returns the pixel format of the specified part as defined in the PFNC.
Definition: buffer.cc:519
rcg::Buffer::getPixelFormatNamespace
uint64_t getPixelFormatNamespace(uint32_t part) const
Returns the pixel format namespace, which preferably should be PIXELFORMAT_NAMESPACE_PFNC_32BIT.
Definition: buffer.cc:545


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:11