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