1 // Created by: Kirill GAVRILOV
2 // Copyright (c) 2019 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #ifndef _Graphic3d_MediaTexture_HeaderFile
16 #define _Graphic3d_MediaTexture_HeaderFile
18 #include <Graphic3d_Texture2D.hxx>
19 #include <NCollection_DefineAlloc.hxx>
20 #include <NCollection_Shared.hxx>
21 #include <Standard_Mutex.hxx>
24 typedef NCollection_Shared<Standard_Mutex> Media_HMutex;
26 //! Texture adapter for Media_Frame.
27 class Graphic3d_MediaTexture : public Graphic3d_Texture2D
29 DEFINE_STANDARD_RTTIEXT(Graphic3d_MediaTexture, Graphic3d_Texture2D)
33 Standard_EXPORT Graphic3d_MediaTexture (const Handle(Media_HMutex)& theMutex,
34 Standard_Integer thePlane = -1);
37 Standard_EXPORT virtual Handle(Image_PixMap) GetImage() const Standard_OVERRIDE;
40 const Handle(Media_Frame)& Frame() const { return myFrame; }
43 void SetFrame (const Handle(Media_Frame)& theFrame) { myFrame = theFrame; }
45 //! Regenerate a new texture id
46 void GenerateNewId() { generateId(); }
50 mutable Handle(Media_HMutex) myMutex;
51 Handle(Media_Frame) myFrame;
52 Standard_Integer myPlane;
53 mutable Handle(Image_PixMap) myPixMapWrapper;
57 #endif // _Graphic3d_MediaTexture_HeaderFile