fbvideograbber.h

Go to the documentation of this file.
00001 #ifndef __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 #include <fbsdk/fbrenderer.h>
00055 
00056 #ifdef FBSDKUseNamespace
00057     namespace FBSDKNamespace {
00058 #endif
00059 
00060 __FB_FORWARD( FBVideoGrabber );
00061 FB_DEFINE_COMPONENT( FBSDK_DLL, VideoGrabber );
00062 
00064 enum FBVideoRenderViewingMode   {
00065     FBViewingModeStandard,      
00066     FBViewingModeModelsOnly,    
00067     FBViewingModeXRay,          
00068     FBViewingModeCurrent,       
00069     FBViewingModeCount          
00070 };      
00072 enum FBVideoRenderFieldMode     {
00073     FBFieldModeNoField,     
00074     FBFieldModeField0,      
00075     FBFieldModeField1,      
00076     FBFieldModeHalfField0,  
00077     FBFieldModeHalfField1,  
00078     FBFieldModeCount        
00079 };      
00081 enum FBVideoRenderDepth     {
00082     FBVideoRender24Bits,        
00083     FBVideoRender32Bits,        
00084     FBVideoRenderDepthCount     
00085 };  
00086 
00090 struct FBVideoGrabOptions
00091 {
00092     FBTimeSpan                  mTimeSpan;              
00093     FBTime                      mTimeSteps;             
00094     FBCameraResolutionMode      mCameraResolution;      
00095     FBVideoRenderDepth          mBitsPerPixel;          
00096     FBVideoRenderFieldMode      mFieldMode;             
00097     FBVideoRenderViewingMode    mViewingMode;           
00098     FBStereoDisplayMode         mStereoDisplayMode;     
00099     FBString                    mOutputFileName;        
00100     bool                        mShowSafeArea;          
00101     bool                        mShowTimeCode;          
00102     bool                        mShowCameraLabel;       
00103     bool                        mAntiAliasing;          
00104     bool                        mRenderAudio;           
00105     FBAudioFmt                  mAudioRenderFormat;     
00106     int                         mStillImageCompression; 
00107 };
00109 typedef FBVideoGrabOptions* HFBVideoGrabOptions;
00110 
00114 struct FBVideoGrabStats
00115 {
00116     int     mTotalFrameCount;           
00117     int     mRemainingFrameCount;       
00118     FBTime  mTotalTimeElapsed;          
00119     FBTime  mEstimatedTime;             
00120     FBTime  mEstimatedTimeRemaining;    
00121     FBTime  mTimePerFrame;              
00122 };
00123 
00127 class FBSDK_DLL FBVideoGrabber : public FBComponent 
00128 {
00129     //--- Open Reality declaration.
00130     __FBClassDeclare(FBVideoGrabber, FBComponent);
00131   public:
00132 
00136     FBVideoGrabber(HIObject pObject=NULL);
00137 
00138     //--- Grabbing options management
00142     void SetOptions(HFBVideoGrabOptions pOptions);
00143 
00147     FBVideoGrabOptions GetOptions();
00148 
00152     void ResetOptions();
00153 
00154     //--- Rendering functions setup
00161     void SetRefreshViewFunc(void* pThis, void(*pCallbackFuncPtr)(void*));
00162 
00169     void SetPostRenderFrameCallback(void* pThis, void(*pCallbackFuncPtr)(void*));
00170 
00171     //--- Grabbing control
00177     bool BeginGrab();
00178 
00182     void Grab();
00183 
00187     void EndGrab();
00188 
00202     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);
00203     
00204     //--- Grabbing statistics query
00208     FBVideoGrabStats GetStatistics();
00209     
00210     //--- Errors management
00214     FBString GetLastErrorMsg();
00215 };
00216 
00217 
00218 #ifdef FBSDKUseNamespace
00219     }
00220 #endif
00221 #endif /* this must be the last line of this file */