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 
00041 namespace rcg
00042 {
00043 
00044 class Stream;
00045 class GenTLWrapper;
00046 
00052 enum PAYLOADTYPE_INFO_IDS
00053 {
00054   PAYLOAD_TYPE_UNKNOWN         =  0,   /* GenTL v1.2 */
00055   PAYLOAD_TYPE_IMAGE           =  1,   /* GenTL v1.2 */
00056   PAYLOAD_TYPE_RAW_DATA        =  2,   /* GenTL v1.2 */
00057   PAYLOAD_TYPE_FILE            =  3,   /* GenTL v1.2 */
00058   PAYLOAD_TYPE_CHUNK_DATA      =  4,   /* GenTL v1.2, Deprecated in GenTL 1.5*/
00059   PAYLOAD_TYPE_JPEG            =  5,   /* GenTL v1.4 */
00060   PAYLOAD_TYPE_JPEG2000        =  6,   /* GenTL v1.4 */
00061   PAYLOAD_TYPE_H264            =  7,   /* GenTL v1.4 */
00062   PAYLOAD_TYPE_CHUNK_ONLY      =  8,   /* GenTL v1.4 */
00063   PAYLOAD_TYPE_DEVICE_SPECIFIC =  9,   /* GenTL v1.4 */
00064   PAYLOAD_TYPE_MULTI_PART      =  10,  /* GenTL v1.5 */
00065 
00066   PAYLOAD_TYPE_CUSTOM_ID       = 1000  /* Starting value for GenTL Producer custom IDs. */
00067 };
00068 
00074 enum PIXELFORMAT_NAMESPACE_IDS
00075 {
00076   PIXELFORMAT_NAMESPACE_UNKNOWN      = 0,   /* GenTL v1.2 */
00077   PIXELFORMAT_NAMESPACE_GEV          = 1,   /* GenTL v1.2 */
00078   PIXELFORMAT_NAMESPACE_IIDC         = 2,   /* GenTL v1.2 */
00079   PIXELFORMAT_NAMESPACE_PFNC_16BIT   = 3,   /* GenTL v1.4 */
00080   PIXELFORMAT_NAMESPACE_PFNC_32BIT   = 4,   /* GenTL v1.4 */
00081 
00082   PIXELFORMAT_NAMESPACE_CUSTOM_ID    = 1000 /* Starting value for GenTL Producer custom IDs. */
00083 };
00084 
00091 class Buffer
00092 {
00093   public:
00094 
00100     Buffer(const std::shared_ptr<const GenTLWrapper> &gentl, Stream *parent);
00101 
00107     void setHandle(void *handle);
00108 
00115     std::shared_ptr<Stream> getParent() const;
00116 
00123     void *getBase() const;
00124 
00131     size_t getSize() const;
00132 
00139     void *getUserPtr() const;
00140 
00147     uint64_t getTimestamp() const;
00148 
00156     bool getNewData() const;
00157 
00165     bool getIsQueued() const;
00166 
00174     bool getIsAcquiring() const;
00175 
00183     bool getIsIncomplete() const;
00184 
00192     std::string getTLType() const;
00193 
00202     size_t getSizeFilled() const;
00203 
00204     size_t getWidth() const;
00205     size_t getHeight() const;
00206     size_t getXOffset() const;
00207     size_t getYOffset() const;
00208     size_t getXPadding() const;
00209     size_t getYPadding() const;
00210     uint64_t getFrameID() const;
00211     bool getImagePresent() const;
00212     size_t getImageOffset() const;
00213     size_t getPayloadType() const; // see PAYLOADTYPE_INFO_IDS above
00214     uint64_t getPixelFormat() const; // see pixel_formats.h if namespace is PIXELFORMAT_NAMESPACE_PFNC_32BIT
00215     uint64_t getPixelFormatNamespace() const; // see PIXELFORMAT_NAMESPACE_IDS above
00216     size_t getDeliveredImageHeight() const;
00217     size_t getDeliveredChunkPayloadSize() const;
00218     uint64_t getChunkLayoutID() const;
00219     std::string getFilename() const;
00220     bool isBigEndian() const;
00221     size_t getDataSize() const;
00222     uint64_t getTimestampNS() const;
00223     bool getDataLargerThanBuffer() const;
00224     bool getContainsChunkdata() const;
00225 
00232     void *getHandle() const;
00233 
00234   private:
00235 
00236     Buffer(class Buffer &); // forbidden
00237     Buffer &operator=(const Buffer &); // forbidden
00238 
00239     Stream *parent;
00240     std::shared_ptr<const GenTLWrapper> gentl;
00241     void *buffer;
00242 };
00243 
00244 bool isHostBigEndian();
00245 
00246 }
00247 
00248 #endif


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:01