fbvideograbber.h

Go to the documentation of this file.
00001 #ifndef __FBVIDEOGRABBER_H__
fbvideograbber.h
00002 #define __FBVIDEOGRABBER_H__
00003 /**************************************************************************
00004  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
00005  All Rights Reserved.
00006  
00007  The coded instructions, statements, computer programs, and/or related 
00008  material (collectively the "Data") in these files contain unpublished 
00009  information proprietary to Autodesk, Inc. and/or its licensors, which is 
00010  protected by Canada and United States of America federal copyright law 
00011  and by international treaties.
00012  
00013  The Data may not be disclosed or distributed to third parties, in whole 
00014  or in part, without the prior written consent of Autodesk, Inc. 
00015  ("Autodesk").
00016  
00017  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00018  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO 
00019  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR 
00020  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES 
00021  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
00022  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT 
00023  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR 
00024  FREE.
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS 
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR 
00028  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE 
00029  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS 
00030  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR 
00031  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF 
00032  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT 
00033  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE 
00034  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS 
00035  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
00036  
00037 **************************************************************************/
00038 
00043 #include <kaydaradef.h>
00044 #ifndef FBSDK_DLL 
00045 
00048     #define FBSDK_DLL K_DLLIMPORT
00049 #endif
00050 
00051 #include <fbsdk/fbcomponent.h>
00052 #include <fbsdk/fbaudiofmt.h>
00053 #include <fbsdk/fbimage.h>
00054 
00055 #ifdef FBSDKUseNamespace
00056     namespace FBSDKNamespace {
00057 #endif
00058 
00059 __FB_FORWARD( FBVideoGrabber );
00060 FB_DEFINE_COMPONENT( FBSDK_DLL, VideoGrabber );
00061 
00063 enum FBVideoRenderViewingMode   {
00064     FBViewingModeStandard,      
00065     FBViewingModeModelsOnly,    
00066     FBViewingModeXRay,          
00067     FBViewingModeCurrent,       
00068     FBViewingModeCount          
00069 };      
00071 enum FBVideoRenderFieldMode     {
00072     FBFieldModeNoField,     
00073     FBFieldModeField0,      
00074     FBFieldModeField1,      
00075     FBFieldModeHalfField0,  
00076     FBFieldModeHalfField1,  
00077     FBFieldModeCount        
00078 };      
00080 enum FBVideoRenderDepth     {
00081     FBVideoRender24Bits,        
00082     FBVideoRender32Bits,        
00083     FBVideoRenderDepthCount     
00084 };  
00085 
00089 struct FBVideoGrabOptions
00090 {
00091     FBTimeSpan                  mTimeSpan;              
00092     FBTime                      mTimeSteps;             
00093     FBCameraResolutionMode      mCameraResolution;      
00094     FBVideoRenderDepth          mBitsPerPixel;          
00095     FBVideoRenderFieldMode      mFieldMode;             
00096     FBVideoRenderViewingMode    mViewingMode;           
00097     FBString                    mOutputFileName;        
00098     bool                        mShowSafeArea;          
00099     bool                        mShowTimeCode;          
00100     bool                        mShowCameraLabel;       
00101     bool                        mAntiAliasing;          
00102     bool                        mRenderAudio;           
00103     FBAudioFmt                  mAudioRenderFormat;     
00104     int                         mStillImageCompression; 
00105 };
00107 typedef FBVideoGrabOptions* HFBVideoGrabOptions;
00108 
00112 struct FBVideoGrabStats
00113 {
00114     int     mTotalFrameCount;           
00115     int     mRemainingFrameCount;       
00116     FBTime  mTotalTimeElapsed;          
00117     FBTime  mEstimatedTime;             
00118     FBTime  mEstimatedTimeRemaining;    
00119     FBTime  mTimePerFrame;              
00120 };
00121 
00125 class FBSDK_DLL FBVideoGrabber : public FBComponent 
00126 {
00127     //--- Open Reality declaration.
00128     __FBClassDeclare(FBVideoGrabber, FBComponent);
00129   public:
00130 
00134     FBVideoGrabber(HIObject pObject=NULL);
00135 
00136     //--- Grabbing options management
00140     void SetOptions(HFBVideoGrabOptions pOptions);
00141 
00145     FBVideoGrabOptions GetOptions();
00146 
00150     void ResetOptions();
00151 
00152     //--- Rendering functions setup
00159     void SetRefreshViewFunc(void* pThis, void(*pCallbackFuncPtr)(void*));
00160 
00167     void SetPostRenderFrameCallback(void* pThis, void(*pCallbackFuncPtr)(void*));
00168 
00169     //--- Grabbing control
00175     bool BeginGrab();
00176 
00180     void Grab();
00181 
00185     void EndGrab();
00186 
00200     HFBImage RenderSnapshot(int pWidth=-1, int pHeight=-1, bool pCameraLabel=false, bool pTimeCode=false, bool pSafeArea=false, bool pAxis=false, bool pGrid=false, bool pFrontPlate=false, bool pBackPlate=false);
00201     
00202     //--- Grabbing statistics query
00206     FBVideoGrabStats GetStatistics();
00207     
00208     //--- Errors management
00212     FBString GetLastErrorMsg();
00213 };
00214 
00215 
00216 #ifdef FBSDKUseNamespace
00217     }
00218 #endif
00219 #endif /* this must be the last line of this file */

Please send us your comments about this page.