Camera.h
Go to the documentation of this file.
00001 /*=============================================================================
00002   Copyright (C) 2012 - 2016 Allied Vision Technologies.  All Rights Reserved.
00003 
00004   Redistribution of this file, in original or modified form, without
00005   prior written consent of Allied Vision Technologies is prohibited.
00006 
00007 -------------------------------------------------------------------------------
00008 
00009   File:        Camera.h
00010 
00011   Description: Definition of class AVT::VmbAPI::Camera.
00012 
00013 -------------------------------------------------------------------------------
00014 
00015   THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
00016   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
00017   NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR  PURPOSE ARE
00018   DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 
00019   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
00020   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00021   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED  
00022   AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
00023   TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
00024   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00025 
00026 =============================================================================*/
00027 
00028 #ifndef AVT_VMBAPI_CAMERA_H
00029 #define AVT_VMBAPI_CAMERA_H
00030 
00031 #include <vector>
00032 #include <string>
00033 
00034 #include <VimbaC/Include/VimbaC.h>
00035 #include <VimbaCPP/Include/VimbaCPPCommon.h>
00036 #include <VimbaCPP/Include/IRegisterDevice.h>
00037 #include <VimbaCPP/Include/FeatureContainer.h>
00038 #include <VimbaCPP/Include/Frame.h>
00039 #include <VimbaCPP/Include/IFrameObserver.h>
00040 #include <VimbaCPP/Include/SharedPointerDefines.h>
00041 
00042 namespace AVT {
00043 namespace VmbAPI {
00044 
00045 typedef std::vector<CameraPtr> CameraPtrVector;
00046 
00047 class Camera : public FeatureContainer, public IRegisterDevice 
00048 {
00049   public:
00050     //
00051     // Method:      Camera constructor
00052     //
00053     // Purpose:     Creates an instance of class Camera
00054     //
00055     // Parameters:
00056     //
00057     // [in ]    const char*      pID            The ID of the camera    
00058     // [in ]    const char*      pName          The name of the camera
00059     // [in ]    const char*      pModel         The model name of the camera
00060     // [in ]    const char*      pSerialNumber  The serial number of the camera
00061     // [in ]    const char*      pInterfaceID   The ID of the interface the camera is connected to
00062     // [in ]    VmbInterfaceType interfaceType  The type of the interface the camera is connected to
00063     //
00064     // Details:   The ID of the camera may be, among others, one of the following: "169.254.12.13",
00065     //            "000f31000001", a plain serial number: "1234567890", or the device ID 
00066     //            of the underlying transport layer.
00067     //
00068     IMEXPORT Camera(    const char *pID,
00069                         const char *pName,
00070                         const char *pModel,
00071                         const char *pSerialNumber,
00072                         const char *pInterfaceID,
00073                         VmbInterfaceType interfaceType );
00074 
00075     //
00076     // Method:      Camera destructor
00077     //
00078     // Purpose:     Destroys an instance of class Camera
00079     //
00080     // Details:     Destroying a camera implicitly closes it beforehand.
00081     //
00082     IMEXPORT virtual ~Camera();
00083 
00084     //
00085     // Method:      Open()
00086     //
00087     // Purpose:     Opens the specified camera.
00088     //
00089     // Parameters:
00090     //
00091     //  [in ]  VmbAccessMode_t  accessMode      Access mode determines the level of control you have on the camera
00092     //
00093     // Returns:
00094     //
00095     //  - VmbErrorSuccess:       If no error
00096     //  - VmbErrorApiNotStarted: VmbStartup() was not called before the current command
00097     //  - VmbErrorNotFound:      The designated camera cannot be found
00098     //  - VmbErrorInvalidAccess: Operation is invalid with the current access mode
00099     //
00100     // Details:   A camera may be opened in a specific access mode. This mode determines
00101     //            the level of control you have on a camera.
00102     //  
00103     IMEXPORT virtual VmbErrorType Open( VmbAccessModeType accessMode );
00104 
00105     //
00106     // Method:      Close()
00107     //
00108     // Purpose:     Closes the specified camera.
00109     //
00110     // Returns:
00111     //
00112     //  - VmbErrorSuccess:       If no error
00113     //  - VmbErrorApiNotStarted: VmbStartup() was not called before the current command
00114     //
00115     // Details:     Depending on the access mode this camera was opened in, events are killed,
00116     //              callbacks are unregistered, the frame queue is cleared, and camera control is released.
00117     //
00118     IMEXPORT virtual VmbErrorType Close();
00119 
00120     //
00121     // Method:      GetID()
00122     //
00123     // Purpose:     Gets the ID of a camera.
00124     //
00125     // Parameters:  [out]   std::string&     cameraID         The ID of the camera
00126     //
00127     // Returns:
00128     //  - VmbErrorSuccess:       If no error
00129     //
00130     //              This information remains static throughout the object's lifetime
00131     //
00132     VmbErrorType GetID( std::string &cameraID ) const;
00133 
00134     //
00135     // Method:      GetName()
00136     //
00137     // Purpose:     Gets the name of a camera.
00138     //
00139     // Parameters:  [out]   std::string&     name         The name of the camera
00140     //
00141     // Returns:
00142     //  - VmbErrorSuccess:       If no error
00143     //
00144     //              This information remains static throughout the object's lifetime
00145     //
00146     VmbErrorType GetName( std::string &name ) const;
00147     
00148     //
00149     // Method:      GetModel()
00150     //
00151     // Purpose:     Gets the model name of a camera.
00152     //
00153     // Parameters:  [out]   std::string&     model         The model name of the camera
00154     //
00155     // Returns:
00156     //  - VmbErrorSuccess:       If no error
00157     //
00158     //              This information remains static throughout the object's lifetime
00159     //
00160     VmbErrorType GetModel( std::string &model ) const;
00161 
00162     //
00163     // Method:      GetSerialNumber()
00164     //
00165     // Purpose:     Gets the serial number of a camera.
00166     //
00167     // Parameters:  [out]   std::string&     serialNumber         The serial number of the camera
00168     //
00169     // Returns:
00170     //  - VmbErrorSuccess:       If no error
00171     //
00172     //              This information remains static throughout the object's lifetime
00173     //
00174     VmbErrorType GetSerialNumber( std::string &serialNumber ) const;
00175 
00176     //
00177     // Method:      GetInterfaceID()
00178     //
00179     // Purpose:     Gets the interface ID of a camera.
00180     //
00181     // Parameters:  [out]   std::string&     interfaceID         The interface ID of the camera
00182     //
00183     // Returns:
00184     //  - VmbErrorSuccess:       If no error
00185     //
00186     //              This information remains static throughout the object's lifetime
00187     //
00188     VmbErrorType GetInterfaceID( std::string &interfaceID ) const;
00189 
00190     //
00191     // Method:      GetInterfaceType()
00192     //
00193     // Purpose:     Gets the type of the interface the camera is connected to. And therefore the type of the camera itself.
00194     //
00195     // Parameters:  [out]   VmbInterfaceType&    interfaceType The interface type of the camera
00196     //
00197     // Returns:
00198     //  - VmbErrorSuccess:       If no error
00199     //
00200     IMEXPORT VmbErrorType GetInterfaceType( VmbInterfaceType &interfaceType ) const;
00201 
00202     //
00203     // Method:      GetPermittedAccess()
00204     //
00205     // Purpose:     Gets the access modes of a camera.
00206     //
00207     // Parameters:  [out]   VmbAccessModeType&   permittedAccess The possible access modes of the camera
00208     //
00209     // Returns:
00210     //  - VmbErrorSuccess:       If no error
00211     //
00212     IMEXPORT VmbErrorType GetPermittedAccess( VmbAccessModeType &permittedAccess ) const;
00213 
00214     //
00215     // Method:      ReadRegisters()
00216     //
00217     // Purpose:     Reads one or more registers consecutively. The number of registers to read is determined by the number of provided addresses.
00218     //
00219     // Parameters:  [in ]   const Uint64Vector&   addresses  A list of register addresses
00220     //              [out]   Uint64Vector&         buffer     The returned data as vector
00221     //
00222     // Returns:
00223     //  - VmbErrorSuccess:      If all requested registers have been read
00224     //  - VmbErrorBadParameter: Vectors "addresses" and/or "buffer" are empty.
00225     //  - VmbErrorIncomplete:   If at least one, but not all registers have been read. See overload ReadRegisters( const Uint64Vector&, Uint64Vector&, VmbUint32_t& ).
00226     //
00227     virtual VmbErrorType ReadRegisters( const Uint64Vector &addresses, Uint64Vector &buffer ) const;
00228     
00229     //
00230     // Method:      ReadRegisters()
00231     //
00232     // Purpose:     Same as ReadRegisters( const Uint64Vector&, Uint64Vector& ), but returns the number of successful read operations in case of an error.
00233     //
00234     // Parameters:  [in ]   const Uint64Vector&   addresses       A list of register addresses
00235     //              [out]   Uint64Vector&         buffer          The returned data as vector
00236     //              [out]   VmbUint32_t&          completedReads  The number of successfully read registers
00237     //
00238     // Returns:
00239     //  - VmbErrorSuccess:      If all requested registers have been read
00240     //  - VmbErrorBadParameter: Vectors "addresses" and/or "buffer" are empty.
00241     //  - VmbErrorIncomplete:   If at least one, but not all registers have been read.
00242     //
00243     virtual VmbErrorType ReadRegisters( const Uint64Vector &addresses, Uint64Vector &buffer, VmbUint32_t &completedReads ) const;
00244     
00245     //
00246     // Method:      WriteRegisters()
00247     //
00248     // Purpose:     Writes one or more registers consecutively. The number of registers to write is determined by the number of provided addresses.
00249     //
00250     // Parameters:  [in]    const Uint64Vector&     addresses  A list of register addresses
00251     //              [in]    const Uint64Vector&     buffer     The data to write as vector
00252     //
00253     // Returns:
00254     //  - VmbErrorSuccess:      If all requested registers have been written
00255     //  - VmbErrorBadParameter: Vectors "addresses" and/or "buffer" are empty.
00256     //  - VmbErrorIncomplete:   If at least one, but not all registers have been written. See overload WriteRegisters( const Uint64Vector&, const Uint64Vector&, VmbUint32_t& ).
00257     //
00258     virtual VmbErrorType WriteRegisters( const Uint64Vector &addresses, const Uint64Vector &buffer );
00259 
00260     //
00261     // Method:      WriteRegisters()
00262     //
00263     // Purpose:     Same as WriteRegisters( const Uint64Vector&, const Uint64Vector& ), but returns the number of successful write operations in case of an error.
00264     //
00265     // Parameters:  [in ]   const Uint64Vector&   addresses        A list of register addresses
00266     //              [in ]   const Uint64Vector&   buffer           The data to write as vector
00267     //              [out]   VmbUint32_t&          completedWrites  The number of successfully read registers
00268     //
00269     // Returns:
00270     //  - VmbErrorSuccess:      If all requested registers have been written
00271     //  - VmbErrorBadParameter: Vectors "addresses" and/or "buffer" are empty.
00272     //  - VmbErrorIncomplete:   If at least one, but not all registers have been written.
00273     //
00274     virtual VmbErrorType WriteRegisters( const Uint64Vector &addresses, const Uint64Vector &buffer, VmbUint32_t &completedWrites );
00275 
00276     //
00277     // Method:      ReadMemory()
00278     //
00279     // Purpose:     Reads a block of memory. The number of bytes to read is determined by the size of the provided buffer.
00280     //
00281     // Parameters:  [in ]   const VmbUint64_t&   address    The address to read from
00282     //              [out]   UcharVector&         buffer     The returned data as vector
00283     //
00284     // Returns:
00285     //  - VmbErrorSuccess:      If all requested bytes have been read
00286     //  - VmbErrorBadParameter: Vector "buffer" is empty.
00287     //  - VmbErrorIncomplete:   If at least one, but not all bytes have been read. See overload ReadMemory( const VmbUint64_t&, UcharVector&, VmbUint32_t& ).
00288     //
00289     virtual VmbErrorType ReadMemory( const VmbUint64_t &address, UcharVector &buffer ) const;
00290 
00291     //
00292     // Method:      ReadMemory()
00293     //
00294     // Purpose:     Same as ReadMemory( const Uint64Vector&, UcharVector& ), but returns the number of bytes successfully read in case of an error VmbErrorIncomplete.
00295     //
00296     // Parameters:  [in]    const VmbUint64_t&   address        The address to read from
00297     //              [out]   UcharVector&         buffer         The returned data as vector
00298     //              [out]   VmbUint32_t&         completeReads  The number of successfully read bytes
00299     //
00300     // Returns:
00301     //  - VmbErrorSuccess:      If all requested bytes have been read
00302     //  - VmbErrorBadParameter: Vector "buffer" is empty.
00303     //  - VmbErrorIncomplete:   If at least one, but not all bytes have been read.
00304     //
00305     virtual VmbErrorType ReadMemory( const VmbUint64_t &address, UcharVector &buffer, VmbUint32_t &completeReads ) const;
00306 
00307     //
00308     // Method:      WriteMemory()
00309     //
00310     // Purpose:     Writes a block of memory. The number of bytes to write is determined by the size of the provided buffer.
00311     //
00312     // Parameters:  [in]    const VmbUint64_t&   address    The address to write to
00313     //              [in]    const UcharVector&   buffer     The data to write as vector
00314     //
00315     // Returns:
00316     //  - VmbErrorSuccess:      If all requested bytes have been written
00317     //  - VmbErrorBadParameter: Vector "buffer" is empty.
00318     //  - VmbErrorIncomplete:   If at least one, but not all bytes have been written. See overload WriteMemory( const VmbUint64_t&, const UcharVector&, VmbUint32_t& ).
00319     //
00320     virtual VmbErrorType WriteMemory( const VmbUint64_t &address, const UcharVector &buffer );
00321 
00322     //
00323     // Method:      WriteMemory()
00324     //
00325     // Purpose:     Same as WriteMemory( const Uint64Vector&, const UcharVector& ), but returns the number of bytes successfully written in case of an error VmbErrorIncomplete.
00326     //
00327     // Parameters:  [in]    const VmbUint64_t&   address        The address to write to
00328     //              [in]    const UcharVector&   buffer         The data to write as vector
00329     //              [out]   VmbUint32_t&         sizeComplete   The number of successfully written bytes
00330     //
00331     // Returns:
00332     //  - VmbErrorSuccess:      If all requested bytes have been written
00333     //  - VmbErrorBadParameter: Vector "buffer" is empty.
00334     //  - VmbErrorIncomplete:   If at least one, but not all bytes have been written.
00335     //
00336     virtual VmbErrorType WriteMemory( const VmbUint64_t &address, const UcharVector &buffer, VmbUint32_t &sizeComplete );
00337 
00338     //
00339     // Method:      AcquireSingleImage()
00340     //
00341     // Purpose:     Gets one image synchronously.
00342     //
00343     // Parameters:  [out]   FramePtr&       pFrame          The frame that gets filled
00344     //              [in ]   VmbUint32_t     timeout         The time to wait until the frame got filled
00345     //
00346     // Returns:
00347     //  - VmbErrorSuccess:      If no error
00348     //  - VmbErrorBadParameter: "pFrame" is NULL.
00349     //  - VmbErrorTimeout:      Call timed out
00350     //
00351     IMEXPORT VmbErrorType AcquireSingleImage( FramePtr &pFrame, VmbUint32_t timeout );
00352 
00353     //
00354     // Method:      AcquireMultipleImages()
00355     //
00356     // Purpose:     Gets a certain number of images synchronously.
00357     //
00358     // Parameters:  [out]   FramePtrVector& frames          The frames that get filled
00359     //              [in ]   VmbUint32_t     timeout         The time to wait until one frame got filled
00360     //
00361     // Details:     The size of the frame vector determines the number of frames to use.
00362     //
00363     // Returns:
00364     //  - VmbErrorSuccess:          If no error
00365     //  - VmbErrorInternalFault:    Filling all the frames was not successful.
00366     //  - VmbErrorBadParameter:     Vector "frames" is empty.
00367     //
00368     VmbErrorType AcquireMultipleImages( FramePtrVector &frames, VmbUint32_t timeout );
00369 
00370     //
00371     // Method:      AcquireMultipleImages()
00372     //
00373     // Purpose:     Same as AcquireMultipleImages(FramePtrVector&, VmbUint32_t), but returns the number of frames that were filled completely.
00374     //
00375     // Parameters:  [out]   FramePtrVector& frames              The frames that get filled
00376     //              [in ]   VmbUint32_t     timeout             The time to wait until one frame got filled
00377     //              [out]   VmbUint32_t&    numFramesCompleted  The number of frames that were filled completely
00378     //
00379     // Details:     The size of the frame vector determines the number of frames to use.
00380     //              On return, "numFramesCompleted" holds the number of frames actually filled.
00381     //
00382     // Returns:
00383     //  - VmbErrorSuccess:      If no error
00384     //  - VmbErrorBadParameter: Vector "frames" is empty.
00385     //
00386     VmbErrorType AcquireMultipleImages( FramePtrVector &frames, VmbUint32_t timeout, VmbUint32_t &numFramesCompleted );
00387 
00388     //
00389     // Method:      StartContinuousImageAcquisition()
00390     //
00391     // Purpose:     Starts streaming and allocates the needed frames
00392     //
00393     // Parameters:  [in ]   int                         bufferCount    The number of frames to use
00394     //              [out]   const IFrameObserverPtr&    pObserver      The observer to use on arrival of new frames
00395     //
00396     // Returns:
00397     //
00398     //  - VmbErrorSuccess:        If no error
00399     //  - VmbErrorDeviceNotOpen:  The camera has not been opened before
00400     //  - VmbErrorApiNotStarted:  VmbStartup() was not called before the current command
00401     //  - VmbErrorBadHandle:      The given handle is not valid
00402     //  - VmbErrorInvalidAccess:  Operation is invalid with the current access mode
00403     //
00404     IMEXPORT VmbErrorType StartContinuousImageAcquisition( int bufferCount, const IFrameObserverPtr &pObserver );
00405 
00406     //
00407     // Method:      StopContinuousImageAcquisition()
00408     //
00409     // Purpose:     Stops streaming and deallocates the needed frames
00410     //
00411     IMEXPORT VmbErrorType StopContinuousImageAcquisition();
00412 
00413     //
00414     // Method:      AnnounceFrame()
00415     //
00416     // Purpose:     Announces a frame to the API that may be queued for frame capturing later.
00417     //
00418     // Parameters:
00419     //
00420     //  [in ]  const FramePtr&    pFrame         Shared pointer to a frame to announce
00421     //
00422     // Returns:
00423     //
00424     //  - VmbErrorSuccess:       If no error
00425     //  - VmbErrorApiNotStarted: VmbStartup() was not called before the current command
00426     //  - VmbErrorBadHandle:     The given handle is not valid
00427     //  - VmbErrorBadParameter:  "pFrame" is NULL.
00428     //  - VmbErrorStructSize:    The given struct size is not valid for this version of the API
00429     //
00430     // Details:     Allows some preparation for frames like DMA preparation depending on the transport layer.
00431     //              The order in which the frames are announced is not taken in consideration by the API.
00432     //
00433     IMEXPORT VmbErrorType AnnounceFrame( const FramePtr &pFrame );
00434     
00435     //
00436     // Method:      RevokeFrame()
00437     //
00438     // Purpose:     Revoke a frame from the API.
00439     //
00440     // Parameters:
00441     //
00442     //  [in ]  const FramePtr&    pFrame         Shared pointer to a frame that is to be removed from the list of announced frames
00443     //
00444     // Returns:
00445     //
00446     //  - VmbErrorSuccess:       If no error
00447     //  - VmbErrorApiNotStarted: VmbStartup() was not called before the current command
00448     //  - VmbErrorBadHandle:     The given frame pointer is not valid
00449     //  - VmbErrorBadParameter:  "pFrame" is NULL.
00450     //  - VmbErrorStructSize:    The given struct size is not valid for this version of the API
00451     //
00452     // Details:    The referenced frame is removed from the pool of frames for capturing images.
00453     //
00454     IMEXPORT VmbErrorType RevokeFrame( const FramePtr &pFrame );
00455 
00456     //
00457     // Method:      RevokeAllFrames()
00458     //
00459     // Purpose:     Revoke all frames assigned to this certain camera.
00460     //
00461     // Returns:
00462     //
00463     //  - VmbErrorSuccess:       If no error
00464     //  - VmbErrorApiNotStarted: VmbStartup() was not called before the current command
00465     //  - VmbErrorBadHandle:     The given handle is not valid
00466     //
00467     IMEXPORT VmbErrorType RevokeAllFrames();
00468     
00469     //
00470     // Method:      QueueFrame()
00471     //
00472     // Purpose:     Queues a frame that may be filled during frame capturing.
00473     //
00474     // Parameters:
00475     //
00476     //  [in ]  const FramePtr&    pFrame    A shared pointer to a frame
00477     //
00478     // Returns:
00479     //
00480     //  - VmbErrorSuccess:       If no error
00481     //  - VmbErrorApiNotStarted: VmbStartup() was not called before the current command
00482     //  - VmbErrorBadHandle:     The given frame is not valid
00483     //  - VmbErrorBadParameter:  "pFrame" is NULL.
00484     //  - VmbErrorStructSize:    The given struct size is not valid for this version of the API
00485     //  - VmbErrorInvalidCall:   StopContinuousImageAcquisition is currently running in another thread
00486     //
00487     // Details:     The given frame is put into a queue that will be filled sequentially.
00488     //              The order in which the frames are filled is determined by the order in which they are queued.
00489     //              If the frame was announced with AnnounceFrame() before, the application
00490     //              has to ensure that the frame is also revoked by calling RevokeFrame() or RevokeAll()
00491     //              when cleaning up.
00492     //
00493     IMEXPORT VmbErrorType QueueFrame( const FramePtr &pFrame );
00494 
00495     //
00496     // Method:      FlushQueue()
00497     //
00498     // Purpose:     Flushes the capture queue.
00499     //
00500     // Returns:
00501     //
00502     //  - VmbErrorSuccess:       If no error
00503     //  - VmbErrorApiNotStarted: VmbStartup() was not called before the current command
00504     //  - VmbErrorBadHandle:     The given handle is not valid
00505     //
00506     // Details:     All the currently queued frames will be returned to the user, leaving no frames in the input queue.
00507     //              After this call, no frame notification will occur until frames are queued again.
00508     //
00509     IMEXPORT VmbErrorType FlushQueue();
00510     
00511     //
00512     // Method:      StartCapture()
00513     //
00514     // Purpose:     Prepare the API for incoming frames from this camera.
00515     //
00516     // Returns:
00517     //
00518     //  - VmbErrorSuccess:       If no error
00519     //  - VmbErrorApiNotStarted: VmbStartup() was not called before the current command
00520     //  - VmbErrorBadHandle:     The given handle is not valid
00521     //  - VmbErrorDeviceNotOpen: Camera was not opened for usage
00522     //  - VmbErrorInvalidAccess: Operation is invalid with the current access mode
00523     //
00524     IMEXPORT VmbErrorType StartCapture();
00525 
00526     //
00527     // Method:      EndCapture()
00528     //
00529     // Purpose:     Stop the API from being able to receive frames from this camera.
00530     //
00531     // Returns:
00532     //
00533     //  - VmbErrorSuccess:       If no error
00534     //  - VmbErrorApiNotStarted: VmbStartup() was not called before the current command
00535     //  - VmbErrorBadHandle:     The given handle is not valid
00536     //
00537     // Details:     Consequences of VmbCaptureEnd():
00538     //                  - The frame queue is flushed
00539     //                  - The frame callback will not be called any more
00540     //
00541     IMEXPORT VmbErrorType EndCapture();
00542 
00543     //
00544     // Method:      SaveCameraSettings()
00545     //
00546     // Purpose:     Saves the current camera setup to an XML file
00547     //
00548     // Parameters:
00549     //
00550     //  [in ]   std::string                     pStrFileName    xml file name
00551     //  [in ]   VmbFeaturePersistSettings_t*    pSettings       pointer to settings struct
00552     //
00553     // Returns:
00554     //
00555     //  - VmbErrorSuccess:          If no error
00556     //  - VmbErrorApiNotStarted:    VmbStartup() was not called before the current command
00557     //  - VmbErrorBadHandle:        The given handle is not valid
00558     //  - VmbErrorInternalFault:    When something unexpected happens in VimbaC function
00559     //  - VmbErrorOther:            Every other failure in load/save settings implementation class
00560     //
00561     VmbErrorType SaveCameraSettings( std::string fileName, VmbFeaturePersistSettings_t *pSettings = 0 ) const;
00562 
00563     //
00564     // Method:      LoadCameraSettings()
00565     //
00566     // Purpose:     Loads the current camera setup from an XML file into the camera
00567     //
00568     // Parameters:
00569     //
00570     //  [in] std::string                    pStrFileName    xml file name
00571     //  [in] VmbFeaturePersistSettings_t*   pSettings       pointer to settings struct
00572     //
00573     // Returns:
00574     //
00575     //  - VmbErrorSuccess:          If no error
00576     //  - VmbErrorApiNotStarted:    VmbStartup() was not called before the current command
00577     //  - VmbErrorBadHandle:        The given handle is not valid
00578     //  - VmbErrorInternalFault:    When something unexpected happens in VimbaC function
00579     //  - VmbErrorOther:            Every other failure in load/save settings implementation class
00580     //
00581     VmbErrorType LoadCameraSettings( std::string fileName, VmbFeaturePersistSettings_t *pSettings = 0 ) const;
00582 
00583     //
00584     // Method:      LoadSaveSettingsSetup()
00585     //
00586     // Purpose:     Sets Load/Save settings behaviour (alternative to settings struct)
00587     //
00588     // Parameters:
00589     //
00590     //  [in] VmbFeaturePersist_t  persistType    determines which feature shall be considered during load/save settings
00591     //  [in] VmbUint32_t          maxIterations  determines how many 'tries' during loading feature values shall be performed
00592     //  [in] VmbUint32_t          loggingLevel   determines level of detail for load/save settings logging
00593     //
00594     IMEXPORT void LoadSaveSettingsSetup( VmbFeaturePersist_t persistType, VmbUint32_t maxIterations, VmbUint32_t loggingLevel );
00595 
00596   private:
00597     // Default ctor
00598     Camera();
00599 
00600     // Copy ctor
00601     Camera ( const Camera& );
00602 
00603     // Assignment operator
00604     Camera& operator=( const Camera& );
00605 
00606     struct Impl;
00607     Impl *m_pImpl;
00608 
00609     // Array functions to pass data across DLL boundaries
00610     IMEXPORT VmbErrorType GetID( char * const pID, VmbUint32_t &length ) const;
00611     IMEXPORT VmbErrorType GetName( char * const pName, VmbUint32_t &length ) const;
00612     IMEXPORT VmbErrorType GetModel( char * const pModelName, VmbUint32_t &length ) const;
00613     IMEXPORT VmbErrorType GetSerialNumber( char * const pSerial, VmbUint32_t &length ) const;
00614     IMEXPORT VmbErrorType GetInterfaceID( char * const pInterfaceID, VmbUint32_t &length ) const;
00615     IMEXPORT VmbErrorType AcquireMultipleImages( FramePtr *pFrames, VmbUint32_t size, VmbUint32_t nTimeout, VmbUint32_t *pNumFramesCompleted );
00616     IMEXPORT virtual VmbErrorType ReadRegisters( const VmbUint64_t *pAddressArray, VmbUint32_t addressSize, VmbUint64_t *pDataArray, VmbUint32_t *pCompletedReads ) const;
00617     IMEXPORT virtual VmbErrorType WriteRegisters( const VmbUint64_t *pAddressArray, VmbUint32_t addressSize, const VmbUint64_t *pDataArray, VmbUint32_t *pCompletedWrites );
00618     IMEXPORT virtual VmbErrorType ReadMemory( VmbUint64_t address, VmbUchar_t *pBuffer, VmbUint32_t bufferSize, VmbUint32_t *pSizeComplete ) const;
00619     IMEXPORT virtual VmbErrorType WriteMemory( VmbUint64_t address, const VmbUchar_t *pBuffer, VmbUint32_t bufferSize, VmbUint32_t *pSizeComplete );
00620     IMEXPORT VmbErrorType SaveCameraSettings( const char * const pStrFileName, VmbFeaturePersistSettings_t *pSettings ) const;
00621     IMEXPORT VmbErrorType LoadCameraSettings( const char * const pStrFileName, VmbFeaturePersistSettings_t *pSettings ) const;
00622 
00623     VmbFeaturePersist_t m_persistType;
00624     VmbUint32_t m_maxIterations;
00625     VmbUint32_t m_loggingLevel;
00626 };
00627 
00628 #include <VimbaCPP/Include/Camera.hpp>
00629 
00630 }} // namespace AVT::VmbAPI
00631 
00632 #endif


avt_vimba_camera
Author(s): Miquel Massot , Allied Vision Technologies
autogenerated on Thu Jun 6 2019 18:23:39