00001
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXCAMERA_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXCAMERA_H
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
00043 #include <fbxfilesdk/components/kbaselib/kaydara.h>
00044
00045 #include <fbxfilesdk/kfbxplugins/kfbxnodeattribute.h>
00046 #include <fbxfilesdk/kfbxplugins/kfbxcolor.h>
00047
00048 #include <fbxfilesdk/kfbxmath/kfbxvector4.h>
00049
00050 #include <fbxfilesdk/components/kbaselib/klib/kstring.h>
00051
00052 #ifdef KARCH_DEV_MACOSX_CFM
00053 #include <CFURL.h>
00054 #include <Files.h>
00055 #endif
00056
00057 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00058
00059 class KFbxTexture;
00060 class KFbxSdkManager;
00061 class KFbxMatrix;
00062 class KFbxXMatrix;
00063 class KTime;
00064
00072 class KFBX_DLL KFbxCamera : public KFbxNodeAttribute
00073 {
00074 KFBXOBJECT_DECLARE(KFbxCamera,KFbxNodeAttribute);
00075
00076 public:
00078 virtual EAttributeType GetAttributeType() const;
00079
00081 void Reset();
00082
00096 typedef enum
00097 {
00098 ePERSPECTIVE,
00099 eORTHOGONAL
00100 } ECameraProjectionType;
00101
00102
00107
00121 typedef enum
00122 {
00123 eCUSTOM_FORMAT,
00124 eD1_NTSC,
00125 eNTSC,
00126 ePAL,
00127 eD1_PAL,
00128 eHD,
00129 e640x480,
00130 e320x200,
00131 e320x240,
00132 e128x128,
00133 eFULL_SCREEN
00134 } ECameraFormat;
00135
00142 void SetFormat(ECameraFormat pFormat);
00143
00147 ECameraFormat GetFormat() const;
00148
00156 typedef enum
00157 {
00158 eWINDOW_SIZE,
00159 eFIXED_RATIO,
00160 eFIXED_RESOLUTION,
00161 eFIXED_WIDTH,
00162 eFIXED_HEIGHT
00163 } ECameraAspectRatioMode;
00164
00176 void SetAspect(ECameraAspectRatioMode pRatioMode, double pWidth, double pHeight);
00177
00181 ECameraAspectRatioMode GetAspectRatioMode() const;
00182
00188 void SetPixelRatio(double pRatio);
00189
00193 double GetPixelRatio() const;
00194
00202 void SetNearPlane(double pDistance);
00203
00209 double GetNearPlane() const;
00210
00218 void SetFarPlane(double pDistance);
00219
00225 double GetFarPlane() const;
00226
00228
00238
00253 typedef enum
00254 {
00255 eCUSTOM_APERTURE_FORMAT = 0,
00256 e16MM_THEATRICAL,
00257 eSUPER_16MM,
00258 e35MM_ACADEMY,
00259 e35MM_TV_PROJECTION,
00260 e35MM_FULL_APERTURE,
00261 e35MM_185_PROJECTION,
00262 e35MM_ANAMORPHIC,
00263 e70MM_PROJECTION,
00264 eVISTAVISION,
00265 eDYNAVISION,
00266 eIMAX
00267 } ECameraApertureFormat;
00268
00273 void SetApertureFormat(ECameraApertureFormat pFormat);
00274
00278 ECameraApertureFormat GetApertureFormat() const;
00279
00288 typedef enum
00289 {
00290 eHORIZONTAL_AND_VERTICAL,
00291 eHORIZONTAL,
00292 eVERTICAL,
00293 eFOCAL_LENGTH
00294 } ECameraApertureMode;
00295
00299 void SetApertureMode(ECameraApertureMode pMode);
00300
00304 ECameraApertureMode GetApertureMode() const;
00305
00311 void SetApertureWidth(double pWidth);
00312
00316 double GetApertureWidth() const;
00317
00323 void SetApertureHeight(double pHeight);
00324
00328 double GetApertureHeight() const;
00329
00335 void SetSqueezeRatio(double pRatio);
00336
00340 double GetSqueezeRatio() const;
00341
00351 typedef enum
00352 {
00353 eNO_FIT,
00354 eVERTICAL_FIT,
00355 eHORIZONTAL_FIT,
00356 eFILL_FIT,
00357 eOVERSCAN_FIT,
00358 eSTRETCH_FIT
00359 } ECameraGateFit;
00360
00365 double ComputeFieldOfView(double pFocalLength) const;
00366
00371 double ComputeFocalLength(double pAngleOfView) const;
00372
00378 typedef enum
00379 {
00380 eROTATE_TRANSLATE,
00381 eTRANSLATE_ROTATE
00382 } ECameraFilmRollOrder;
00383
00385
00401
00408 void SetBackgroundFileName(const char* pFileName);
00409
00415 char const* GetBackgroundFileName() const;
00416
00423 void SetBackgroundMediaName(const char* pFileName);
00424
00430 char const* GetBackgroundMediaName() const;
00431
00432
00438 typedef enum
00439 {
00440 eBACKGROUND,
00441 eFOREGROUND,
00442 eBACKGROUND_AND_FOREGROUND
00443 } ECameraPlateDrawingMode;
00444
00450 void SetShowBackPlate(bool pEnable);
00451
00457 bool GetShowBackPlate() const;
00458
00464 void SetBackgroundAlphaTreshold(double pThreshold);
00465
00471 double GetBackgroundAlphaTreshold() const;
00472
00476 void SetBackgroundTexture(KFbxTexture* pTexture);
00477
00481 KFbxTexture* GetBackgroundTexture() const;
00482
00486 void SetFitImage(bool pFitImage);
00487
00491 bool GetFitImage() const;
00492
00496 void SetCrop(bool pCrop);
00497
00501 bool GetCrop() const;
00502
00506 void SetCenter(bool pCenter);
00507
00511 bool GetCenter() const;
00512
00516 void SetKeepRatio(bool pKeepRatio);
00517
00521 bool GetKeepRatio() const;
00522
00523
00529 void SetShowFrontPlate(bool pEnable);
00530
00536 bool GetShowFrontPlate() const;
00537
00541 void SetFrontPlateFitImage(bool pFrontPlateFitImage);
00542
00546 bool GetFrontPlateFitImage() const;
00547
00551 void SetFrontPlateCrop(bool pFrontPlateCrop);
00552
00556 bool GetFrontPlateCrop() const;
00557
00561 void SetFrontPlateCenter(bool pFrontPlateCenter);
00562
00566 bool GetFrontPlateCenter() const;
00567
00571 void SetFrontPlateKeepRatio(bool pFrontPlateKeepRatio);
00572
00576 bool GetFrontPlateKeepRatio() const;
00577
00581 void SetForegroundOpacity(double pOpacity);
00582
00586 double GetForegroundOpacity() const;
00587
00591 void SetForegroundTexture(KFbxTexture* pTexture);
00592
00596 KFbxTexture* GetForegroundTexture() const;
00597
00598
00603 typedef enum
00604 {
00605 eRELATIVE_TO_INTEREST,
00606 eRELATIVE_TO_CAMERA
00607 } ECameraFrontBackPlaneDistanceMode;
00608
00615 void SetBackPlaneDistance(double pDistance);
00616
00620 double GetBackPlaneDistance() const;
00621
00625 void SetBackPlaneDistanceMode(ECameraFrontBackPlaneDistanceMode pMode);
00626
00630 ECameraFrontBackPlaneDistanceMode GetBackPlaneDistanceMode() const;
00631
00638 void SetFrontPlaneDistance(double pDistance);
00639
00643 double GetFrontPlaneDistance() const;
00644
00648 void SetFrontPlaneDistanceMode(ECameraFrontBackPlaneDistanceMode pMode);
00649
00653 ECameraFrontBackPlaneDistanceMode GetFrontPlaneDistanceMode() const;
00654
00660 typedef enum
00661 {
00662 eDISABLED,
00663 eALWAYS,
00664 eWHEN_MEDIA
00665 } ECameraFrontBackPlaneDisplayMode;
00666
00672 void SetViewFrustumFrontPlaneMode(ECameraFrontBackPlaneDisplayMode pMode);
00673
00677 ECameraFrontBackPlaneDisplayMode GetViewFrustumFrontPlaneMode() const;
00678
00684 void SetViewFrustumBackPlaneMode(ECameraFrontBackPlaneDisplayMode pMode);
00685
00689 ECameraFrontBackPlaneDisplayMode GetViewFrustumBackPlaneMode() const;
00690
00692
00699
00703 void SetViewCameraInterest(bool pEnable);
00704
00708 bool GetViewCameraInterest() const;
00709
00713 void SetViewNearFarPlanes(bool pEnable);
00714
00718 bool GetViewNearFarPlanes() const;
00719
00724 typedef enum
00725 {
00726 eROUND = 0,
00727 eSQUARE = 1
00728 } ECameraSafeAreaStyle;
00729
00731
00738
00743 typedef enum
00744 {
00745 eINTERACTIVE,
00746 eAT_RENDER
00747 } ECameraRenderOptionsUsageTime;
00748
00753 typedef enum
00754 {
00755 eOVERSAMPLING_ANTIALIASING,
00756 eHARDWARE_ANTIALIASING
00757 } ECameraAntialiasingMethod;
00758
00763 typedef enum
00764 {
00765 eUNIFORM,
00766 eSTOCHASTIC
00767 } ECameraSamplingType;
00768
00773 typedef enum
00774 {
00775 eCAMERA_INTEREST,
00776 eSPECIFIC_DISTANCE
00777 } ECameraFocusDistanceSource;
00778
00780
00785
00795 bool IsBoundingBoxInView( const KFbxMatrix& pWorldToScreen,
00796 const KFbxMatrix& pWorldToCamera,
00797 const KFbxVector4 pPoints[8] ) const;
00798
00807 bool IsPointInView( const KFbxMatrix& pWorldToScreen, const KFbxMatrix& pWorldToCamera, const KFbxVector4& pPoint ) const;
00808
00815 KFbxMatrix ComputeWorldToScreen(int pPixelWidth, int pPixelHeight, const KFbxXMatrix& pWorldToCamera) const;
00816
00827 KFbxMatrix ComputePerspective( int pPixelWidth, int pPixelHeight, bool pIncludePostPerspective ) const;
00828
00830
00832
00833
00834
00836
00837
00838
00839
00840
00848 KFbxTypedProperty<fbxDouble3> Position;
00849
00857 KFbxTypedProperty<fbxDouble3> UpVector;
00858
00870 KFbxTypedProperty<fbxDouble3> InterestPosition;
00871
00879 KFbxTypedProperty<fbxDouble1> Roll;
00880
00891 KFbxTypedProperty<fbxDouble1> OpticalCenterX;
00892
00903 KFbxTypedProperty<fbxDouble1> OpticalCenterY;
00904
00912 KFbxTypedProperty<fbxDouble3> BackgroundColor;
00913
00921 KFbxTypedProperty<fbxDouble1> TurnTable;
00922
00931 KFbxTypedProperty<fbxBool1> DisplayTurnTableIcon;
00932
00933
00934
00935
00936
00945 KFbxTypedProperty<fbxBool1> UseMotionBlur;
00946
00955 KFbxTypedProperty<fbxBool1> UseRealTimeMotionBlur;
00956
00964 KFbxTypedProperty<fbxDouble1> MotionBlurIntensity;
00965
00966
00967
00968
00969
00978 KFbxTypedProperty<ECameraAspectRatioMode> AspectRatioMode;
00979
00987 KFbxTypedProperty<fbxDouble1> AspectWidth;
00988
00996 KFbxTypedProperty<fbxDouble1> AspectHeight;
00997
01005 KFbxTypedProperty<fbxDouble1> PixelAspectRatio;
01006
01011 KFbxTypedProperty<ECameraApertureMode> ApertureMode;
01012
01020 KFbxTypedProperty<ECameraGateFit> GateFit;
01021
01033 KFbxTypedProperty<fbxDouble1> FieldOfView;
01034
01035
01047 KFbxTypedProperty<fbxDouble1> FieldOfViewX;
01048
01060 KFbxTypedProperty<fbxDouble1> FieldOfViewY;
01061
01069 KFbxTypedProperty<fbxDouble1> FocalLength;
01070
01080 KFbxTypedProperty<ECameraFormat> CameraFormat;
01081
01082
01083
01084
01085
01094 KFbxTypedProperty<fbxBool1> UseFrameColor;
01095
01103 KFbxTypedProperty<fbxDouble3> FrameColor;
01104
01105
01106
01107
01108
01116 KFbxTypedProperty<fbxBool1> ShowName;
01117
01125 KFbxTypedProperty<fbxBool1> ShowInfoOnMoving;
01126
01134 KFbxTypedProperty<fbxBool1> ShowGrid;
01135
01143 KFbxTypedProperty<fbxBool1> ShowOpticalCenter;
01144
01152 KFbxTypedProperty<fbxBool1> ShowAzimut;
01153
01161 KFbxTypedProperty<fbxBool1> ShowTimeCode;
01162
01170 KFbxTypedProperty<fbxBool1> ShowAudio;
01171
01179 KFbxTypedProperty<fbxDouble3> AudioColor;
01180
01181
01182
01183
01184
01192 KFbxTypedProperty<fbxDouble1> NearPlane;
01193
01201 KFbxTypedProperty<fbxDouble1> FarPlane;
01202
01203
01212 KFbxTypedProperty<fbxBool1> AutoComputeClipPlanes;
01213
01214
01215
01216
01217
01218
01227 KFbxTypedProperty<fbxDouble1> FilmWidth;
01228
01237 KFbxTypedProperty<fbxDouble1> FilmHeight;
01238
01246 KFbxTypedProperty<fbxDouble1> FilmAspectRatio;
01247
01256 KFbxTypedProperty<fbxDouble1> FilmSqueezeRatio;
01257
01265 KFbxTypedProperty<ECameraApertureFormat> FilmFormat;
01266
01275
01276
01285 KFbxTypedProperty<fbxDouble1> FilmOffsetX;
01286
01295 KFbxTypedProperty<fbxDouble1> FilmOffsetY;
01296
01304 KFbxTypedProperty<fbxDouble1> PreScale;
01305
01311 KFbxTypedProperty<fbxDouble1> FilmTranslateX;
01312
01318 KFbxTypedProperty<fbxDouble1> FilmTranslateY;
01319
01326 KFbxTypedProperty<fbxDouble1> FilmRollPivotX;
01327
01334 KFbxTypedProperty<fbxDouble1> FilmRollPivotY;
01335
01344 KFbxTypedProperty<fbxDouble1> FilmRollValue;
01345
01353 KFbxTypedProperty<ECameraFilmRollOrder> FilmRollOrder ;
01354
01355
01356
01357
01358
01366 KFbxTypedProperty<fbxBool1> ViewCameraToLookAt;
01367
01375 KFbxTypedProperty<fbxBool1> ViewFrustumNearFarPlane;
01376
01384 KFbxTypedProperty<ECameraFrontBackPlaneDisplayMode> ViewFrustumBackPlaneMode;
01385
01393 KFbxTypedProperty<fbxDouble1> BackPlaneDistance;
01394
01402 KFbxTypedProperty<ECameraFrontBackPlaneDistanceMode> BackPlaneDistanceMode;
01403
01411 KFbxTypedProperty<ECameraFrontBackPlaneDisplayMode> ViewFrustumFrontPlaneMode;
01412
01420 KFbxTypedProperty<fbxDouble1> FrontPlaneDistance;
01421
01429 KFbxTypedProperty<ECameraFrontBackPlaneDistanceMode> FrontPlaneDistanceMode;
01430
01431
01432
01433
01434
01442 KFbxTypedProperty<fbxBool1> LockMode;
01443
01451 KFbxTypedProperty<fbxBool1> LockInterestNavigation;
01452
01453
01454
01455
01456
01464 KFbxTypedProperty<fbxBool1> FitImage;
01465
01473 KFbxTypedProperty<fbxBool1> Crop;
01474
01482 KFbxTypedProperty<fbxBool1> Center;
01483
01491 KFbxTypedProperty<fbxBool1> KeepRatio;
01492
01500 KFbxTypedProperty<fbxDouble1> BackgroundAlphaTreshold;
01501
01509 KFbxTypedProperty<fbxDouble2> BackPlaneOffset;
01510
01518 KFbxTypedProperty<fbxDouble1> BackPlaneRotation;
01519
01529 KFbxTypedProperty<fbxDouble2> BackPlaneScale;
01530
01539 KFbxTypedProperty<fbxBool1> ShowBackplate;
01540
01548 KFbxTypedProperty<fbxReference> BackgroundTexture;
01549
01550
01551
01552
01553
01554
01562 KFbxTypedProperty<fbxBool1> FrontPlateFitImage;
01563
01571 KFbxTypedProperty<fbxBool1> FrontPlateCrop;
01572
01580 KFbxTypedProperty<fbxBool1> FrontPlateCenter;
01581
01589 KFbxTypedProperty<fbxBool1> FrontPlateKeepRatio;
01590
01591
01600 KFbxTypedProperty<fbxBool1> ShowFrontplate;
01601
01602
01610 KFbxTypedProperty<fbxDouble2> FrontPlaneOffset;
01611
01619 KFbxTypedProperty<fbxDouble1> FrontPlaneRotation;
01620
01628 KFbxTypedProperty<fbxDouble2> FrontPlaneScale;
01629
01637 KFbxTypedProperty<fbxReference> ForegroundTexture;
01638
01646 KFbxTypedProperty<fbxDouble1> ForegroundOpacity;
01647
01648
01649
01650
01651
01659 KFbxTypedProperty<fbxBool1> DisplaySafeArea;
01660
01668 KFbxTypedProperty<fbxBool1> DisplaySafeAreaOnRender;
01669
01677 KFbxTypedProperty<ECameraSafeAreaStyle> SafeAreaDisplayStyle;
01678
01686 KFbxTypedProperty<fbxDouble1> SafeAreaAspectRatio;
01687
01688
01689
01690
01691
01699 KFbxTypedProperty<fbxBool1> Use2DMagnifierZoom;
01700
01708 KFbxTypedProperty<fbxDouble1> _2DMagnifierZoom;
01709
01717 KFbxTypedProperty<fbxDouble1> _2DMagnifierX;
01718
01726 KFbxTypedProperty<fbxDouble1> _2DMagnifierY;
01727
01728
01729
01730
01731
01739 KFbxTypedProperty<ECameraProjectionType> ProjectionType;
01740
01748 KFbxTypedProperty<fbxDouble1> OrthoZoom;
01749
01750
01751
01752
01753
01761 KFbxTypedProperty<fbxBool1> UseRealTimeDOFAndAA;
01762
01770 KFbxTypedProperty<fbxBool1> UseDepthOfField;
01771
01779 KFbxTypedProperty<ECameraFocusDistanceSource> FocusSource;
01780
01788 KFbxTypedProperty<fbxDouble1> FocusAngle;
01789
01797 KFbxTypedProperty<fbxDouble1> FocusDistance;
01798
01806 KFbxTypedProperty<fbxBool1> UseAntialiasing;
01807
01815 KFbxTypedProperty<fbxDouble1> AntialiasingIntensity;
01816
01824 KFbxTypedProperty<ECameraAntialiasingMethod> AntialiasingMethod;
01825
01826
01827
01828
01829
01837 KFbxTypedProperty<fbxBool1> UseAccumulationBuffer;
01838
01846 KFbxTypedProperty<fbxInteger1> FrameSamplingCount;
01847
01855 KFbxTypedProperty<ECameraSamplingType> FrameSamplingType;
01856
01858
01859
01860
01861
01862
01863
01865
01866 #ifndef DOXYGEN_SHOULD_SKIP_THIS
01867
01868 friend class KFbxGlobalCameraSettings;
01869
01870 public:
01871
01872
01873 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
01874
01875 protected:
01876
01878 KFbxCamera& operator=(KFbxCamera const& pCamera);
01879
01880 KFbxCamera(KFbxSdkManager& pManager, char const* pName);
01881
01882 virtual bool ConstructProperties(bool pForceSet);
01883
01887 virtual KString GetTypeName() const;
01888 virtual KStringList GetTypeFlags() const;
01889
01890 private:
01891
01892 double ComputePixelRatio(kUInt pWidth, kUInt pHeight, double pScreenRatio = 1.3333333333);
01893
01894
01895 KString mBackgroundMediaName;
01896 KString mBackgroundFileName;
01897
01898 friend class KFbxNode;
01899
01900 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
01901
01902 };
01903
01904 #define ImageFit
01905
01906 typedef KFbxCamera* HKFbxCamera;
01907
01908 inline EFbxType FbxTypeOf( KFbxCamera::ECameraAntialiasingMethod const &pItem ) { return eENUM; }
01909 inline EFbxType FbxTypeOf( KFbxCamera::ECameraApertureFormat const &pItem ) { return eENUM; }
01910 inline EFbxType FbxTypeOf( KFbxCamera::ECameraApertureMode const &pItem ) { return eENUM; }
01911 inline EFbxType FbxTypeOf( KFbxCamera::ECameraAspectRatioMode const &pItem ) { return eENUM; }
01912 inline EFbxType FbxTypeOf( KFbxCamera::ECameraFrontBackPlaneDisplayMode const &pItem ) { return eENUM; }
01913 inline EFbxType FbxTypeOf( KFbxCamera::ECameraFrontBackPlaneDistanceMode const &pItem ) { return eENUM; }
01914 inline EFbxType FbxTypeOf( KFbxCamera::ECameraPlateDrawingMode const &pItem ) { return eENUM; }
01915 inline EFbxType FbxTypeOf( KFbxCamera::ECameraFocusDistanceSource const &pItem ) { return eENUM; }
01916 inline EFbxType FbxTypeOf( KFbxCamera::ECameraFormat const &pItem ) { return eENUM; }
01917 inline EFbxType FbxTypeOf( KFbxCamera::ECameraGateFit const &pItem ) { return eENUM; }
01918 inline EFbxType FbxTypeOf( KFbxCamera::ECameraProjectionType const &pItem ) { return eENUM; }
01919 inline EFbxType FbxTypeOf( KFbxCamera::ECameraRenderOptionsUsageTime const &pItem ) { return eENUM; }
01920 inline EFbxType FbxTypeOf( KFbxCamera::ECameraSafeAreaStyle const &pItem ) { return eENUM; }
01921 inline EFbxType FbxTypeOf( KFbxCamera::ECameraSamplingType const &pItem ) { return eENUM; }
01922 inline EFbxType FbxTypeOf( KFbxCamera::ECameraFilmRollOrder const &pItem ) { return eENUM; }
01923
01924 #include <fbxfilesdk/fbxfilesdk_nsend.h>
01925
01926 #endif // FBXFILESDK_KFBXPLUGINS_KFBXCAMERA_H
01927