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 Camera; // forward declaration of camera class for befriending
42 
43 class Frame
44 {
45  friend class Camera;
46 
47  public:
48  //
49  // Method: Frame constructor
50  //
51  // Purpose: Creates an instance of class Frame of a certain size
52  //
53  // Parameters: [in ] VmbInt64_t bufferSize The size of the underlying buffer
54  //
55  IMEXPORT explicit Frame( VmbInt64_t bufferSize );
56 
57  //
58  // Method: Frame constructor
59  //
60  // Purpose: Creates an instance of class Frame with the given user buffer of the given size
61  //
62  // Parameters: [in ] VmbUchar_t* pBuffer A pointer to an allocated buffer
63  // Parameters: [in ] VmbInt64_t bufferSize The size of the underlying buffer
64  //
65  IMEXPORT Frame( VmbUchar_t *pBuffer, VmbInt64_t bufferSize );
66 
67  //
68  // Method: Frame destructor
69  //
70  // Purpose: Destroys an instance of class Frame
71  //
72  IMEXPORT ~Frame();
73 
74  //
75  // Method: RegisterObserver()
76  //
77  // Purpose: Registers an observer that will be called whenever a new frame arrives
78  //
79  // Parameters: [in ] const IFrameObserverPtr& pObserver An object that implements the IObserver interface
80  //
81  // Returns:
82  //
83  // - VmbErrorSuccess: If no error
84  // - VmbErrorBadParameter: "pObserver" is NULL.
85  // - VmbErrorResources: The observer was in use
86  //
87  // Details: As new frames arrive, the observer's FrameReceived method will be called.
88  // Only one observer can be registered.
89  //
90  IMEXPORT VmbErrorType RegisterObserver( const IFrameObserverPtr &pObserver );
91 
92  //
93  // Method: UnregisterObserver()
94  //
95  // Purpose: Unregisters the observer that was called whenever a new frame arrived
96  //
98 
99  //
100  // Method: GetAncillaryData()
101  //
102  // Purpose: Returns the part of a frame that describes the chunk data as an object
103  //
104  // Parameters: [out] AncillaryDataPtr& pAncillaryData The wrapped chunk data
105  //
106  // Returns:
107  //
108  // - VmbErrorSuccess: If no error
109  // - VmbErrorNotFound: No chunk data present
110  //
111  IMEXPORT VmbErrorType GetAncillaryData( AncillaryDataPtr &pAncillaryData );
112 
113  //
114  // Method: GetAncillaryData()
115  //
116  // Purpose: Returns the part of a frame that describes the chunk data as an object
117  //
118  // Parameters: [out] ConstAncillaryDataPtr& pAncillaryData The wrapped chunk data
119  //
120  // Returns:
121  //
122  // - VmbErrorSuccess: If no error
123  // - VmbErrorNotFound: No chunk data present
124  //
125  IMEXPORT VmbErrorType GetAncillaryData( ConstAncillaryDataPtr &pAncillaryData ) const;
126 
127  //
128  // Method: GetBuffer()
129  //
130  // Purpose: Returns the complete buffer including image and chunk data
131  //
132  // Parameters: [out] VmbUchar_t* pBuffer A pointer to the buffer
133  //
134  // Returns:
135  //
136  // - VmbErrorSuccess: If no error
137  //
138  IMEXPORT VmbErrorType GetBuffer( VmbUchar_t* &pBuffer );
139 
140  //
141  // Method: GetBuffer()
142  //
143  // Purpose: Returns the complete buffer including image and chunk data
144  //
145  // Parameters: [out] const VmbUchar_t* pBuffer A pointer to the buffer
146  //
147  // Returns:
148  //
149  // - VmbErrorSuccess: If no error
150  //
151  IMEXPORT VmbErrorType GetBuffer( const VmbUchar_t* &pBuffer ) const;
152 
153  //
154  // Method: GetImage()
155  //
156  // Purpose: Returns only the image data
157  //
158  // Parameters: [out] VmbUchar_t* pBuffer A pointer to the buffer
159  //
160  // Returns:
161  //
162  // - VmbErrorSuccess: If no error
163  //
164  IMEXPORT VmbErrorType GetImage( VmbUchar_t* &pBuffer );
165 
166  //
167  // Method: GetImage()
168  //
169  // Purpose: Returns only the image data
170  //
171  // Parameters: [out] const VmbUchar_t* pBuffer A pointer to the buffer
172  //
173  // Returns:
174  //
175  // - VmbErrorSuccess: If no error
176  //
177  IMEXPORT VmbErrorType GetImage( const VmbUchar_t* &pBuffer ) const;
178 
179  //
180  // Method: GetReceiveStatus()
181  //
182  // Purpose: Returns the receive status of a frame
183  //
184  // Parameters: [out] VmbFrameStatusType& status The receive status
185  //
186  // Returns:
187  //
188  // - VmbErrorSuccess: If no error
189  //
190  IMEXPORT VmbErrorType GetReceiveStatus( VmbFrameStatusType &status ) const;
191 
192  //
193  // Method: GetImageSize()
194  //
195  // Purpose: Returns the memory size of the image
196  //
197  // Parameters: [out] VmbUint32_t& imageSize The size in bytes
198  //
199  // Returns:
200  //
201  // - VmbErrorSuccess: If no error
202  //
203  IMEXPORT VmbErrorType GetImageSize( VmbUint32_t &imageSize ) const;
204 
205  //
206  // Method: GetAncillarySize()
207  //
208  // Purpose: Returns memory size of the chunk data
209  //
210  // Parameters: [out] VmbUint32_t& ancillarySize The size in bytes
211  //
212  // Returns:
213  //
214  // - VmbErrorSuccess: If no error
215  //
216  IMEXPORT VmbErrorType GetAncillarySize( VmbUint32_t &ancillarySize ) const;
217 
218  //
219  // Method: GetBufferSize()
220  //
221  // Purpose: Returns the memory size of the frame buffer holding
222  // both the image data and the ancillary data
223  //
224  // Parameters: [out] VmbUint32_t& bufferSize The size in bytes
225  //
226  // Returns:
227  //
228  // - VmbErrorSuccess: If no error
229  //
230  IMEXPORT VmbErrorType GetBufferSize( VmbUint32_t &bufferSize ) const;
231 
232  //
233  // Method: GetPixelFormat()
234  //
235  // Purpose: Returns the GenICam pixel format
236  //
237  // Parameters: [out] VmbPixelFormatType& pixelFormat The GenICam pixel format
238  //
239  // Returns:
240  //
241  // - VmbErrorSuccess: If no error
242  //
243  IMEXPORT VmbErrorType GetPixelFormat( VmbPixelFormatType &pixelFormat ) const;
244 
245  //
246  // Method: GetWidth()
247  //
248  // Purpose: Returns the width of the image
249  //
250  // Parameters: [out] VmbUint32_t& width The width in pixels
251  //
252  // Returns:
253  //
254  // - VmbErrorSuccess: If no error
255  //
256  IMEXPORT VmbErrorType GetWidth( VmbUint32_t &width ) const;
257 
258  //
259  // Method: GetHeight()
260  //
261  // Purpose: Returns the height of the image
262  //
263  // Parameters: [out] VmbUint32_t& height The height in pixels
264  //
265  // Returns:
266  //
267  // - VmbErrorSuccess: If no error
268  //
269  IMEXPORT VmbErrorType GetHeight( VmbUint32_t &height ) const;
270 
271  //
272  // Method: GetOffsetX()
273  //
274  // Purpose: Returns the x offset of the image
275  //
276  // Parameters: [out] VmbUint32_t& offsetX The x offset in pixels
277  //
278  // Returns:
279  //
280  // - VmbErrorSuccess: If no error
281  //
282  IMEXPORT VmbErrorType GetOffsetX( VmbUint32_t &offsetX ) const;
283 
284  //
285  // Method: GetOffsetY()
286  //
287  // Purpose: Returns the y offset of the image
288  //
289  // Parameters: [out] VmbUint32_t& offsetY The y offset in pixels
290  //
291  // Returns:
292  //
293  // - VmbErrorSuccess: If no error
294  //
295  IMEXPORT VmbErrorType GetOffsetY( VmbUint32_t &offsetY ) const;
296 
297  //
298  // Method: GetFrameID()
299  //
300  // Purpose: Returns the frame ID
301  //
302  // Parameters: [out] VmbUint64_t& frameID The frame ID
303  //
304  // Returns:
305  //
306  // - VmbErrorSuccess: If no error
307  //
308  IMEXPORT VmbErrorType GetFrameID( VmbUint64_t &frameID ) const;
309 
310  //
311  // Method: GetTimeStamp()
312  //
313  // Purpose: Returns the time stamp
314  //
315  // Parameters: [out] VmbUint64_t& timestamp The time stamp
316  //
317  // Returns:
318  //
319  // - VmbErrorSuccess: If no error
320  //
321  IMEXPORT VmbErrorType GetTimestamp( VmbUint64_t &timestamp ) const;
322 
323  bool GetObserver( IFrameObserverPtr &observer ) const;
324 
325  private:
326  struct Impl;
327  Impl *m_pImpl;
328 
329  // No default ctor
330  Frame();
331  // No copy ctor
332  Frame( Frame& );
333  // No assignment operator
334  Frame& operator=( const Frame& );
335 };
336 
337 typedef std::vector<FramePtr> FramePtrVector;
338 
339 }} // namespace AVT::VmbAPI
340 
341 #endif
IMEXPORT VmbErrorType GetAncillaryData(AncillaryDataPtr &pAncillaryData)
Definition: Frame.cpp:164
IMEXPORT VmbErrorType RegisterObserver(const IFrameObserverPtr &pObserver)
Definition: Frame.cpp:123
IMEXPORT VmbErrorType GetOffsetX(VmbUint32_t &offsetX) const
Definition: Frame.cpp:267
IMEXPORT VmbErrorType GetAncillarySize(VmbUint32_t &ancillarySize) const
Definition: Frame.cpp:232
IMEXPORT VmbErrorType GetReceiveStatus(VmbFrameStatusType &status) const
Definition: Frame.cpp:218
VmbPixelFormatType
long long VmbInt64_t
IMEXPORT VmbErrorType GetFrameID(VmbUint64_t &frameID) const
Definition: Frame.cpp:281
IMEXPORT VmbErrorType GetTimestamp(VmbUint64_t &timestamp) const
Definition: Frame.cpp:288
IMEXPORT ~Frame()
Definition: Frame.cpp:111
IMEXPORT VmbErrorType GetBuffer(VmbUchar_t *&pBuffer)
Definition: Frame.cpp:188
IMEXPORT VmbErrorType GetImageSize(VmbUint32_t &imageSize) const
Definition: Frame.cpp:225
VmbErrorType
Impl * m_pImpl
Definition: Frame.h:326
unsigned char VmbUchar_t
IMEXPORT VmbErrorType GetWidth(VmbUint32_t &width) const
Definition: Frame.cpp:253
unsigned long long VmbUint64_t
std::vector< FramePtr > FramePtrVector
Definition: Frame.h:337
IMEXPORT VmbErrorType UnregisterObserver()
Definition: Frame.cpp:136
IMEXPORT VmbErrorType GetPixelFormat(VmbPixelFormatType &pixelFormat) const
Definition: Frame.cpp:246
bool GetObserver(IFrameObserverPtr &observer) const
Definition: Frame.cpp:153
unsigned int VmbUint32_t
IMEXPORT VmbErrorType GetBufferSize(VmbUint32_t &bufferSize) const
Definition: Frame.cpp:239
Frame & operator=(const Frame &)
Definition: Frame.cpp:49
IMEXPORT VmbErrorType GetImage(VmbUchar_t *&pBuffer)
Definition: Frame.cpp:202
IMEXPORT VmbErrorType GetHeight(VmbUint32_t &height) const
Definition: Frame.cpp:260
VmbFrameStatusType
Definition: VimbaC.h:243
IMEXPORT VmbErrorType GetOffsetY(VmbUint32_t &offsetY) const
Definition: Frame.cpp:274


avt_vimba_camera
Author(s): Allied Vision Technologies, Miquel Massot
autogenerated on Fri Jun 2 2023 02:21:10