buffer.h
Go to the documentation of this file.
00001 /*
00002  * This file is part of the rc_genicam_api package.
00003  *
00004  * Copyright (c) 2017 Roboception GmbH
00005  * All rights reserved
00006  *
00007  * Author: Heiko Hirschmueller
00008  *
00009  * Redistribution and use in source and binary forms, with or without
00010  * modification, are permitted provided that the following conditions are met:
00011  *
00012  * 1. Redistributions of source code must retain the above copyright notice,
00013  * this list of conditions and the following disclaimer.
00014  *
00015  * 2. Redistributions in binary form must reproduce the above copyright notice,
00016  * this list of conditions and the following disclaimer in the documentation
00017  * and/or other materials provided with the distribution.
00018  *
00019  * 3. Neither the name of the copyright holder nor the names of its contributors
00020  * may be used to endorse or promote products derived from this software without
00021  * specific prior written permission.
00022  *
00023  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00026  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
00027  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00028  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00029  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00030  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00031  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00032  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00033  * POSSIBILITY OF SUCH DAMAGE.
00034  */
00035 
00036 #ifndef RC_GENICAM_API_BUFFER
00037 #define RC_GENICAM_API_BUFFER
00038 
00039 #include <memory>
00040 #include <string>
00041 
00042 namespace rcg
00043 {
00044 
00045 class Stream;
00046 class GenTLWrapper;
00047 
00053 enum PAYLOADTYPE_INFO_IDS
00054 {
00055   PAYLOAD_TYPE_UNKNOWN         =  0,   /* GenTL v1.2 */
00056   PAYLOAD_TYPE_IMAGE           =  1,   /* GenTL v1.2 */
00057   PAYLOAD_TYPE_RAW_DATA        =  2,   /* GenTL v1.2 */
00058   PAYLOAD_TYPE_FILE            =  3,   /* GenTL v1.2 */
00059   PAYLOAD_TYPE_CHUNK_DATA      =  4,   /* GenTL v1.2, Deprecated in GenTL 1.5*/
00060   PAYLOAD_TYPE_JPEG            =  5,   /* GenTL v1.4 */
00061   PAYLOAD_TYPE_JPEG2000        =  6,   /* GenTL v1.4 */
00062   PAYLOAD_TYPE_H264            =  7,   /* GenTL v1.4 */
00063   PAYLOAD_TYPE_CHUNK_ONLY      =  8,   /* GenTL v1.4 */
00064   PAYLOAD_TYPE_DEVICE_SPECIFIC =  9,   /* GenTL v1.4 */
00065   PAYLOAD_TYPE_MULTI_PART      =  10,  /* GenTL v1.5 */
00066 
00067   PAYLOAD_TYPE_CUSTOM_ID       = 1000  /* Starting value for GenTL Producer custom IDs. */
00068 };
00069 
00075 enum PIXELFORMAT_NAMESPACE_IDS
00076 {
00077   PIXELFORMAT_NAMESPACE_UNKNOWN      = 0,   /* GenTL v1.2 */
00078   PIXELFORMAT_NAMESPACE_GEV          = 1,   /* GenTL v1.2 */
00079   PIXELFORMAT_NAMESPACE_IIDC         = 2,   /* GenTL v1.2 */
00080   PIXELFORMAT_NAMESPACE_PFNC_16BIT   = 3,   /* GenTL v1.4 */
00081   PIXELFORMAT_NAMESPACE_PFNC_32BIT   = 4,   /* GenTL v1.4 */
00082 
00083   PIXELFORMAT_NAMESPACE_CUSTOM_ID    = 1000 /* Starting value for GenTL Producer custom IDs. */
00084 };
00085 
00091 enum PARTDATATYPE_IDS
00092 {
00093   PART_DATATYPE_UNKNOWN              =  0,   /* Unknown data type */
00094   PART_DATATYPE_2D_IMAGE             =  1,   /* Color or monochrome 2D image. */
00095   PART_DATATYPE_2D_PLANE_BIPLANAR    =  2,   /* Single color plane of a planar 2D image consisting of 2 planes. */
00096   PART_DATATYPE_2D_PLANE_TRIPLANAR   =  3,   /* Single color plane of a planar 2D image consisting of 3 planes. */
00097   PART_DATATYPE_2D_PLANE_QUADPLANAR  =  4,   /* Single color plane of a planar 2D image consisting of 4 planes. */
00098   PART_DATATYPE_3D_IMAGE             =  5,   /* 3D image (pixel coordinates). */
00099   PART_DATATYPE_3D_PLANE_BIPLANAR    =  6,   /* Single plane of a planar 3D image consisting of 2 planes. */
00100   PART_DATATYPE_3D_PLANE_TRIPLANAR   =  7,   /* Single plane of a planar 3D image consisting of 3 planes. */
00101   PART_DATATYPE_3D_PLANE_QUADPLANAR  =  8,   /* Single plane of a planar 3D image consisting of 4 planes. */
00102   PART_DATATYPE_CONFIDENCE_MAP       =  9,   /* Confidence of the individual pixel values. */
00103   PART_DATATYPE_CHUNKDATA            = 10,   /* Chunk data type */
00104 
00105   PART_DATATYPE_CUSTOM_ID            = 1000  /* Starting value for GenTL Producer custom IDs. */
00106 };
00107 
00115 class Buffer
00116 {
00117   public:
00118 
00124     Buffer(const std::shared_ptr<const GenTLWrapper> &gentl, Stream *parent);
00125 
00133     void setHandle(void *handle);
00134 
00142     std::uint32_t getNumberOfParts() const;
00143 
00150     void *getGlobalBase() const;
00151 
00158     size_t getGlobalSize() const;
00159 
00166     void *getBase(std::uint32_t part) const;
00167 
00174     size_t getSize(std::uint32_t part) const;
00175 
00182     void *getUserPtr() const;
00183 
00190     uint64_t getTimestamp() const;
00191 
00199     bool getNewData() const;
00200 
00208     bool getIsQueued() const;
00209 
00217     bool getIsAcquiring() const;
00218 
00226     bool getIsIncomplete() const;
00227 
00234     std::string getTLType() const;
00235 
00244     size_t getSizeFilled() const;
00245 
00253     size_t getPartDataType(uint32_t part) const;
00254 
00262     size_t getWidth(std::uint32_t part) const;
00263 
00271     size_t getHeight(std::uint32_t part) const;
00272 
00281     size_t getXOffset(std::uint32_t part) const;
00282 
00291     size_t getYOffset(std::uint32_t part) const;
00292 
00300     size_t getXPadding(std::uint32_t part) const;
00301 
00308     size_t getYPadding() const;
00309 
00317     uint64_t getFrameID() const;
00318 
00326     bool getImagePresent(std::uint32_t part) const;
00327 
00334     size_t getPayloadType() const;
00335 
00345     uint64_t getPixelFormat(std::uint32_t part) const;
00346 
00355     uint64_t getPixelFormatNamespace(std::uint32_t part) const;
00356 
00365     uint64_t getPartSourceID(std::uint32_t part) const;
00366 
00376     size_t getDeliveredImageHeight(std::uint32_t part) const;
00377 
00384     size_t getDeliveredChunkPayloadSize() const;
00385 
00394     uint64_t getChunkLayoutID() const;
00395 
00402     std::string getFilename() const;
00403 
00410     bool isBigEndian() const;
00411 
00421     size_t getDataSize() const;
00422 
00429     uint64_t getTimestampNS() const;
00430 
00437     bool getDataLargerThanBuffer() const;
00438 
00445     bool getContainsChunkdata() const;
00446 
00453     void *getHandle() const;
00454 
00455   private:
00456 
00457     Buffer(class Buffer &); // forbidden
00458     Buffer &operator=(const Buffer &); // forbidden
00459 
00460     Stream *parent;
00461     std::shared_ptr<const GenTLWrapper> gentl;
00462     void *buffer;
00463     bool multipart;
00464 };
00465 
00466 bool isHostBigEndian();
00467 
00468 }
00469 
00470 #endif


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 18:42:46