Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-02 09:12:29

0001 // Created by: Kirill GAVRILOV
0002 // Copyright (c) 2019 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _Graphic3d_MediaTexture_HeaderFile
0016 #define _Graphic3d_MediaTexture_HeaderFile
0017 
0018 #include <Graphic3d_Texture2D.hxx>
0019 
0020 #include <mutex>
0021 
0022 class Media_Frame;
0023 
0024 //! Texture adapter for Media_Frame.
0025 class Graphic3d_MediaTexture : public Graphic3d_Texture2D
0026 {
0027   DEFINE_STANDARD_RTTIEXT(Graphic3d_MediaTexture, Graphic3d_Texture2D)
0028 public:
0029   //! Image reader.
0030   Standard_EXPORT occ::handle<Image_PixMap> GetImage(
0031     const occ::handle<Image_SupportedFormats>& theSupported) override;
0032 
0033   //! Return the frame.
0034   const occ::handle<Media_Frame>& Frame() const { return myFrame; }
0035 
0036   //! Set the frame.
0037   void SetFrame(const occ::handle<Media_Frame>& theFrame) { myFrame = theFrame; }
0038 
0039   //! Regenerate a new texture id
0040   void GenerateNewId() { generateId(); }
0041 
0042   friend class Graphic3d_MediaTextureSet;
0043 
0044 private:
0045   //! Main constructor.
0046   //! Accessible only by Graphic3d_MediaTextureSet.
0047   Standard_EXPORT Graphic3d_MediaTexture(std::mutex& theMutex, int thePlane = -1);
0048 
0049 protected:
0050   std::mutex&                       myMutex;
0051   occ::handle<Media_Frame>          myFrame;
0052   int                               myPlane;
0053   mutable occ::handle<Image_PixMap> myPixMapWrapper;
0054 };
0055 
0056 #endif // _Graphic3d_MediaTexture_HeaderFile