Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:05

0001 // Copyright (c) 2020 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _Image_SupportedFormats_HeaderFile
0015 #define _Image_SupportedFormats_HeaderFile
0016 
0017 #include <Image_CompressedFormat.hxx>
0018 #include <NCollection_Array1.hxx>
0019 #include <Standard_Type.hxx>
0020 
0021 //! Structure holding information about supported texture formats.
0022 class Image_SupportedFormats : public Standard_Transient
0023 {
0024   DEFINE_STANDARD_RTTIEXT(Image_SupportedFormats, Standard_Transient)
0025 public:
0026 
0027   //! Empty constructor.
0028   Standard_EXPORT Image_SupportedFormats();
0029 
0030   //! Return TRUE if image format is supported.
0031   bool IsSupported (Image_Format theFormat) const { return myFormats.Value (theFormat); }
0032 
0033   //! Set if image format is supported or not.
0034   void Add (Image_Format theFormat) { myFormats.SetValue (theFormat, true); }
0035 
0036   //! Return TRUE if there are compressed image formats supported.
0037   bool HasCompressed() const { return myHasCompressed; }
0038 
0039   //! Return TRUE if compressed image format is supported.
0040   bool IsSupported (Image_CompressedFormat theFormat) const { return myFormats.Value (theFormat); }
0041 
0042   //! Set if compressed image format is supported or not.
0043   void Add (Image_CompressedFormat theFormat)
0044   {
0045     myFormats.SetValue (theFormat, true);
0046     myHasCompressed = true;
0047   }
0048 
0049   //! Reset flags.
0050   void Clear()
0051   {
0052     myFormats.Init (false);
0053     myHasCompressed = false;
0054   }
0055 
0056 protected:
0057 
0058   NCollection_Array1<bool> myFormats; //!< list of supported formats
0059   Standard_Boolean   myHasCompressed; //!< flag indicating that some compressed image formats are supported
0060 
0061 };
0062 
0063 #endif // _Image_SupportedFormats_HeaderFile