fbxthumbnail.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /****************************************************************************************
  2. Copyright (C) 2015 Autodesk, Inc.
  3. All rights reserved.
  4. Use of this software is subject to the terms of the Autodesk license agreement
  5. provided at the time of installation or download, or which otherwise accompanies
  6. this software in either electronic or hard copy form.
  7. ****************************************************************************************/
  8. //! \file fbxthumbnail.h
  9. #ifndef _FBXSDK_SCENE_THUMBNAIL_H_
  10. #define _FBXSDK_SCENE_THUMBNAIL_H_
  11. #include <fbxsdk/fbxsdk_def.h>
  12. #include <fbxsdk/core/fbxobject.h>
  13. #include <fbxsdk/fbxsdk_nsbegin.h>
  14. class FbxThumbnailMembers;
  15. /** Simple class to hold RGBA values of a thumbnail image.
  16. * \nosubgrouping
  17. */
  18. class FBXSDK_DLL FbxThumbnail : public FbxObject
  19. {
  20. FBXSDK_OBJECT_DECLARE(FbxThumbnail, FbxObject);
  21. public:
  22. /**
  23. * \name Thumbnail properties
  24. */
  25. //@{
  26. //! Pixel height of the thumbnail image
  27. FbxPropertyT<FbxInt> CustomHeight;
  28. //! Pixel width of the thumbnail image
  29. FbxPropertyT<FbxInt> CustomWidth;
  30. /** \enum EDataFormat Data format.
  31. * - \e eRGB_24
  32. * - \e eRGBA_32
  33. */
  34. enum EDataFormat
  35. {
  36. eRGB_24, // 3 components
  37. eRGBA_32 // 4 components
  38. };
  39. /** Set the data format.
  40. * \param pDataFormat Data format identifier.
  41. */
  42. void SetDataFormat(EDataFormat pDataFormat);
  43. /** Get the data format.
  44. * \return Data format identifier for the thumbnail.
  45. */
  46. EDataFormat GetDataFormat() const;
  47. /** \enum EImageSize Image size.
  48. * - \e eNotSet
  49. * - \e e64x64
  50. * - \e e128x128
  51. * - \e eCustomSize
  52. */
  53. enum EImageSize
  54. {
  55. eNotSet = 0,
  56. e64x64 = 64,
  57. e128x128 = 128,
  58. eCustomSize = -1
  59. };
  60. /** Set the thumbnail dimensions.
  61. * \param pImageSize Image size identifier.
  62. */
  63. void SetSize(EImageSize pImageSize);
  64. /** Get the thumbnail dimensions.
  65. * \return Image size identifier.
  66. */
  67. EImageSize GetSize() const;
  68. /** Get the thumbnail dimensions in bytes.
  69. * \return Thumbnail size in bytes.
  70. */
  71. unsigned long GetSizeInBytes() const;
  72. //@}
  73. /**
  74. * \name Thumbnail data access
  75. */
  76. //@{
  77. /** Fill the thumbnail image.
  78. * \param pImage Pointer to the image data. A copy
  79. * of the image data will be made.
  80. * \remarks This pointer must point to a buffer region
  81. * that is at least Width * Height * Component count
  82. * bytes long. This pointer points to the upper left
  83. * corner of the image.
  84. * \remarks You must set the data format and the dimensions
  85. * before calling this function. If the image size is set to eCustomSize
  86. * the CustomHeight and CustomWidth properties must be set before calling
  87. * this function.
  88. * \return \c true if the thumbnail properties were set
  89. * before calling this function. \c false otherwise.
  90. */
  91. bool SetThumbnailImage(const FbxUChar* pImage);
  92. /** Get the thumbnail image.
  93. * \return Pointer to the image data, or \c NULL if the
  94. * thumbnail is empty.
  95. */
  96. FbxUChar* GetThumbnailImage() const;
  97. //@}
  98. /*****************************************************************************************************************************
  99. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  100. *****************************************************************************************************************************/
  101. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  102. virtual FbxObject& Copy(const FbxObject& pObject);
  103. protected:
  104. virtual void Construct(const FbxObject* pFrom);
  105. virtual void ConstructProperties(bool pForceSet);
  106. virtual void Destruct(bool pRecursive);
  107. FbxThumbnailMembers* mMembers;
  108. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  109. };
  110. #include <fbxsdk/fbxsdk_nsend.h>
  111. #endif /* _FBXSDK_SCENE_THUMBNAIL_H_ */