1 // Copyright (c) 2020 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _Image_SupportedFormats_HeaderFile
15 #define _Image_SupportedFormats_HeaderFile
17 #include <Image_CompressedFormat.hxx>
18 #include <NCollection_Array1.hxx>
19 #include <Standard_Type.hxx>
21 //! Structure holding information about supported texture formats.
22 class Image_SupportedFormats : public Standard_Transient
24 DEFINE_STANDARD_RTTIEXT(Image_SupportedFormats, Standard_Transient)
27 //! Empty constructor.
28 Standard_EXPORT Image_SupportedFormats();
30 //! Return TRUE if image format is supported.
31 bool IsSupported (Image_Format theFormat) const { return myFormats.Value (theFormat); }
33 //! Set if image format is supported or not.
34 void Add (Image_Format theFormat) { myFormats.SetValue (theFormat, true); }
36 //! Return TRUE if there are compressed image formats supported.
37 bool HasCompressed() const { return myHasCompressed; }
39 //! Return TRUE if compressed image format is supported.
40 bool IsSupported (Image_CompressedFormat theFormat) const { return myFormats.Value (theFormat); }
42 //! Set if compressed image format is supported or not.
43 void Add (Image_CompressedFormat theFormat)
45 myFormats.SetValue (theFormat, true);
46 myHasCompressed = true;
52 myFormats.Init (false);
53 myHasCompressed = false;
58 NCollection_Array1<bool> myFormats; //!< list of supported formats
59 Standard_Boolean myHasCompressed; //!< flag indicating that some compressed image formats are supported
63 #endif // _Image_SupportedFormats_HeaderFile