Frame.h
Go to the documentation of this file.
1 /*=============================================================================
2  Copyright (C) 2012 Allied Vision Technologies. All Rights Reserved.
3 
4  Redistribution of this file, in original or modified form, without
5  prior written consent of Allied Vision Technologies is prohibited.
6 
7 -------------------------------------------------------------------------------
8 
9  File: Frame.h
10 
11  Description: Definition of class AVT::VmbAPI::Frame.
12 
13 -------------------------------------------------------------------------------
14 
15  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
16  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
17  NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18  DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
23  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 =============================================================================*/
27 
28 #ifndef AVT_VMBAPI_FRAME_H
29 #define AVT_VMBAPI_FRAME_H
30 
31 #include <VimbaC/Include/VimbaC.h>
36 #include <vector>
37 
38 namespace AVT {
39 namespace VmbAPI {
40 
41 class Frame
42 {
43  friend class Camera;
44 
45  public:
46  //
47  // Method: Frame constructor
48  //
49  // Purpose: Creates an instance of class Frame of a certain size
50  //
51  // Parameters: [in ] VmbInt64_t bufferSize The size of the underlying buffer
52  //
53  IMEXPORT explicit Frame( VmbInt64_t bufferSize );
54 
55  //
56  // Method: Frame constructor
57  //
58  // Purpose: Creates an instance of class Frame with the given user buffer of the given size
59  //
60  // Parameters: [in ] VmbUchar_t* pBuffer A pointer to an allocated buffer
61  // Parameters: [in ] VmbInt64_t bufferSize The size of the underlying buffer
62  //
63  IMEXPORT Frame( VmbUchar_t *pBuffer, VmbInt64_t bufferSize );
64 
65  //
66  // Method: Frame destructor
67  //
68  // Purpose: Destroys an instance of class Frame
69  //
70  IMEXPORT ~Frame();
71 
72  //
73  // Method: RegisterObserver()
74  //
75  // Purpose: Registers an observer that will be called whenever a new frame arrives
76  //
77  // Parameters: [in ] const IFrameObserverPtr& pObserver An object that implements the IObserver interface
78  //
79  // Returns:
80  //
81  // - VmbErrorSuccess: If no error
82  // - VmbErrorBadParameter: "pObserver" is NULL.
83  // - VmbErrorResources: The observer was in use
84  //
85  // Details: As new frames arrive, the observer's FrameReceived method will be called.
86  // Only one observer can be registered.
87  //
88  IMEXPORT VmbErrorType RegisterObserver( const IFrameObserverPtr &pObserver );
89 
90  //
91  // Method: UnregisterObserver()
92  //
93  // Purpose: Unregisters the observer that was called whenever a new frame arrived
94  //
96 
97  //
98  // Method: GetAncillaryData()
99  //
100  // Purpose: Returns the part of a frame that describes the chunk data as an object
101  //
102  // Parameters: [out] AncillaryDataPtr& pAncillaryData The wrapped chunk data
103  //
104  // Returns:
105  //
106  // - VmbErrorSuccess: If no error
107  // - VmbErrorNotFound: No chunk data present
108  //
109  IMEXPORT VmbErrorType GetAncillaryData( AncillaryDataPtr &pAncillaryData );
110 
111  //
112  // Method: GetAncillaryData()
113  //
114  // Purpose: Returns the part of a frame that describes the chunk data as an object
115  //
116  // Parameters: [out] ConstAncillaryDataPtr& pAncillaryData The wrapped chunk data
117  //
118  // Returns:
119  //
120  // - VmbErrorSuccess: If no error
121  // - VmbErrorNotFound: No chunk data present
122  //
123  IMEXPORT VmbErrorType GetAncillaryData( ConstAncillaryDataPtr &pAncillaryData ) const;
124 
125  //
126  // Method: GetBuffer()
127  //
128  // Purpose: Returns the complete buffer including image and chunk data
129  //
130  // Parameters: [out] VmbUchar_t* pBuffer A pointer to the buffer
131  //
132  // Returns:
133  //
134  // - VmbErrorSuccess: If no error
135  //
136  IMEXPORT VmbErrorType GetBuffer( VmbUchar_t* &pBuffer );
137 
138  //
139  // Method: GetBuffer()
140  //
141  // Purpose: Returns the complete buffer including image and chunk data
142  //
143  // Parameters: [out] const VmbUchar_t* pBuffer A pointer to the buffer
144  //
145  // Returns:
146  //
147  // - VmbErrorSuccess: If no error
148  //
149  IMEXPORT VmbErrorType GetBuffer( const VmbUchar_t* &pBuffer ) const;
150 
151  //
152  // Method: GetImage()
153  //
154  // Purpose: Returns only the image data
155  //
156  // Parameters: [out] VmbUchar_t* pBuffer A pointer to the buffer
157  //
158  // Returns:
159  //
160  // - VmbErrorSuccess: If no error
161  //
162  IMEXPORT VmbErrorType GetImage( VmbUchar_t* &pBuffer );
163 
164  //
165  // Method: GetImage()
166  //
167  // Purpose: Returns only the image data
168  //
169  // Parameters: [out] const VmbUchar_t* pBuffer A pointer to the buffer
170  //
171  // Returns:
172  //
173  // - VmbErrorSuccess: If no error
174  //
175  IMEXPORT VmbErrorType GetImage( const VmbUchar_t* &pBuffer ) const;
176 
177  //
178  // Method: GetReceiveStatus()
179  //
180  // Purpose: Returns the receive status of a frame
181  //
182  // Parameters: [out] VmbFrameStatusType& status The receive status
183  //
184  // Returns:
185  //
186  // - VmbErrorSuccess: If no error
187  //
188  IMEXPORT VmbErrorType GetReceiveStatus( VmbFrameStatusType &status ) const;
189 
190  //
191  // Method: GetImageSize()
192  //
193  // Purpose: Returns the memory size of the image
194  //
195  // Parameters: [out] VmbUint32_t& imageSize The size in bytes
196  //
197  // Returns:
198  //
199  // - VmbErrorSuccess: If no error
200  //
201  IMEXPORT VmbErrorType GetImageSize( VmbUint32_t &imageSize ) const;
202 
203  //
204  // Method: GetAncillarySize()
205  //
206  // Purpose: Returns memory size of the chunk data
207  //
208  // Parameters: [out] VmbUint32_t& ancillarySize The size in bytes
209  //
210  // Returns:
211  //
212  // - VmbErrorSuccess: If no error
213  //
214  IMEXPORT VmbErrorType GetAncillarySize( VmbUint32_t &ancillarySize ) const;
215 
216  //
217  // Method: GetBufferSize()
218  //
219  // Purpose: Returns the memory size of the frame buffer holding
220  // both the image data and the ancillary data
221  //
222  // Parameters: [out] VmbUint32_t& bufferSize The size in bytes
223  //
224  // Returns:
225  //
226  // - VmbErrorSuccess: If no error
227  //
228  IMEXPORT VmbErrorType GetBufferSize( VmbUint32_t &bufferSize ) const;
229 
230  //
231  // Method: GetPixelFormat()
232  //
233  // Purpose: Returns the GenICam pixel format
234  //
235  // Parameters: [out] VmbPixelFormatType& pixelFormat The GenICam pixel format
236  //
237  // Returns:
238  //
239  // - VmbErrorSuccess: If no error
240  //
241  IMEXPORT VmbErrorType GetPixelFormat( VmbPixelFormatType &pixelFormat ) const;
242 
243  //
244  // Method: GetWidth()
245  //
246  // Purpose: Returns the width of the image
247  //
248  // Parameters: [out] VmbUint32_t& width The width in pixels
249  //
250  // Returns:
251  //
252  // - VmbErrorSuccess: If no error
253  //
254  IMEXPORT VmbErrorType GetWidth( VmbUint32_t &width ) const;
255 
256  //
257  // Method: GetHeight()
258  //
259  // Purpose: Returns the height of the image
260  //
261  // Parameters: [out] VmbUint32_t& height The height in pixels
262  //
263  // Returns:
264  //
265  // - VmbErrorSuccess: If no error
266  //
267  IMEXPORT VmbErrorType GetHeight( VmbUint32_t &height ) const;
268 
269  //
270  // Method: GetOffsetX()
271  //
272  // Purpose: Returns the x offset of the image
273  //
274  // Parameters: [out] VmbUint32_t& offsetX The x offset in pixels
275  //
276  // Returns:
277  //
278  // - VmbErrorSuccess: If no error
279  //
280  IMEXPORT VmbErrorType GetOffsetX( VmbUint32_t &offsetX ) const;
281 
282  //
283  // Method: GetOffsetY()
284  //
285  // Purpose: Returns the y offset of the image
286  //
287  // Parameters: [out] VmbUint32_t& offsetY The y offset in pixels
288  //
289  // Returns:
290  //
291  // - VmbErrorSuccess: If no error
292  //
293  IMEXPORT VmbErrorType GetOffsetY( VmbUint32_t &offsetY ) const;
294 
295  //
296  // Method: GetFrameID()
297  //
298  // Purpose: Returns the frame ID
299  //
300  // Parameters: [out] VmbUint64_t& frameID The frame ID
301  //
302  // Returns:
303  //
304  // - VmbErrorSuccess: If no error
305  //
306  IMEXPORT VmbErrorType GetFrameID( VmbUint64_t &frameID ) const;
307 
308  //
309  // Method: GetTimeStamp()
310  //
311  // Purpose: Returns the time stamp
312  //
313  // Parameters: [out] VmbUint64_t& timestamp The time stamp
314  //
315  // Returns:
316  //
317  // - VmbErrorSuccess: If no error
318  //
319  IMEXPORT VmbErrorType GetTimestamp( VmbUint64_t &timestamp ) const;
320 
321  bool GetObserver( IFrameObserverPtr &observer ) const;
322 
323  private:
324  struct Impl;
325  Impl *m_pImpl;
326 
327  // No default ctor
328  Frame();
329  // No copy ctor
330  Frame( Frame& );
331  // No assignment operator
332  Frame& operator=( const Frame& );
333 };
334 
335 typedef std::vector<FramePtr> FramePtrVector;
336 
337 }} // namespace AVT::VmbAPI
338 
339 #endif
IMEXPORT VmbErrorType GetAncillaryData(AncillaryDataPtr &pAncillaryData)
Definition: Frame.cpp:198
IMEXPORT VmbErrorType RegisterObserver(const IFrameObserverPtr &pObserver)
Definition: Frame.cpp:123
IMEXPORT VmbErrorType GetOffsetY(VmbUint32_t &offsetY) const
Definition: Frame.cpp:308
VmbPixelFormatType
long long VmbInt64_t
IMEXPORT ~Frame()
Definition: Frame.cpp:111
NetPointer< AncillaryData, AVT::VmbAPINET::AncillaryData > AncillaryDataPtr
bool GetObserver(IFrameObserverPtr &observer) const
Definition: Frame.cpp:175
IMEXPORT VmbErrorType GetBuffer(VmbUchar_t *&pBuffer)
Definition: Frame.cpp:222
IMEXPORT VmbErrorType GetFrameID(VmbUint64_t &frameID) const
Definition: Frame.cpp:315
VmbErrorType
IMEXPORT VmbErrorType GetHeight(VmbUint32_t &height) const
Definition: Frame.cpp:294
IMEXPORT VmbErrorType GetImageSize(VmbUint32_t &imageSize) const
Definition: Frame.cpp:259
Impl * m_pImpl
Definition: Frame.h:324
unsigned char VmbUchar_t
IMEXPORT VmbErrorType GetReceiveStatus(VmbFrameStatusType &status) const
Definition: Frame.cpp:252
unsigned long long VmbUint64_t
std::vector< FramePtr > FramePtrVector
Definition: Frame.h:335
IMEXPORT VmbErrorType UnregisterObserver()
Definition: Frame.cpp:147
IMEXPORT VmbErrorType GetBufferSize(VmbUint32_t &bufferSize) const
Definition: Frame.cpp:273
IMEXPORT VmbErrorType GetWidth(VmbUint32_t &width) const
Definition: Frame.cpp:287
unsigned int VmbUint32_t
IMEXPORT VmbErrorType GetAncillarySize(VmbUint32_t &ancillarySize) const
Definition: Frame.cpp:266
Frame & operator=(const Frame &)
Definition: Frame.cpp:49
IMEXPORT VmbErrorType GetImage(VmbUchar_t *&pBuffer)
Definition: Frame.cpp:236
IMEXPORT VmbErrorType GetTimestamp(VmbUint64_t &timestamp) const
Definition: Frame.cpp:322
IMEXPORT VmbErrorType GetOffsetX(VmbUint32_t &offsetX) const
Definition: Frame.cpp:301
NetPointer< AncillaryData, AVT::VmbAPINET::AncillaryData > ConstAncillaryDataPtr
IMEXPORT VmbErrorType GetPixelFormat(VmbPixelFormatType &pixelFormat) const
Definition: Frame.cpp:280
VmbFrameStatusType
Definition: VimbaC.h:246


avt_vimba_camera
Author(s): Miquel Massot , Allied Vision Technologies
autogenerated on Mon Jun 10 2019 12:50:39