| GL Studio C++ Runtime API

gls_video_to_texture.h
Go to the documentation of this file.
1/*! \file
2 \brief The GlsVideoToTexture class
3
4 \par Copyright Information
5
6 Copyright (c) 2017 by The DiSTI Corporation.<br>
7 11301 Corporate Blvd; Suite 100<br>
8 Orlando, Florida 32817<br>
9 USA<br>
10 <br>
11 All rights reserved.<br>
12
13 This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19
20 NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26
27 LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35
36 The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38
39*/
40#ifndef INCLUDE_VIDEO_TO_TEXTURE_H
41#define INCLUDE_VIDEO_TO_TEXTURE_H
42
43#include "glpolygon.h"
44#include "gls_cpp_lang_support.h"
45
46/// Provides support for creating DLLs.
47#if( defined( GLSGEN_EXPORT_GLSVIDEOTOTEXTURE ) || defined( GLSGEN_IMPORT_GLSVIDEOTOTEXTURE ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
48 && defined( _MSC_VER )
49# if defined( GLSGEN_EXPORT_GLSVIDEOTOTEXTURE ) || defined( GLS_EXPORT_GENERATED )
50# define GLSGEN_GLSVIDEOTOTEXTURE_EXPORT __declspec( dllexport )
51# else
52# define GLSGEN_GLSVIDEOTOTEXTURE_EXPORT __declspec( dllimport )
53# endif
54#else
55# define GLSGEN_GLSVIDEOTOTEXTURE_EXPORT
56#endif
57///////////////////////////////////////////////////////////////////////////////
58
59/// Automatically link the runtime library plugin (on Windows).
60#define LIB_BASE_NAME "gls_video_to_texture"
61#include "gls_auto_lib.h"
62#undef LIB_BASE_NAME
63
64/// Force inclusion of the DirectShow library.
65#ifndef NO_GLS_AUTOLIB
66# define LIB_BASE_NAME "strmbase"
67# ifdef GLS_LIB_TYPE
68# undef GLS_LIB_TYPE
69# endif
70/// DirectShow is always statically linked.
71# define GLS_LIB_TYPE ""
72# include "gls_auto_lib.h"
73# undef GLS_LIB_TYPE
74# undef LIB_BASE_NAME
75#endif
76
77 namespace disti
78{
79 class GlsVideoToTextureSource;
80
81// SetValue enumerations
82 enum
83{
84 GLS_GLSVIDEOTOTEXTURE_FIRST_VALUE = GLS_LAST_INITIALIZER + 1,
85 GLS_GLSVIDEOTOTEXTURE_CAPTUREDEVICE
86};
87
88/** Runtime implementation of a GlsVideoToTexture */
89 class GlsVideoToTexture : public GLPolygon
90{
91 friend class GlsVideoToTextureEditor;
92
93 private:
94 GlsVideoToTexture& operator=( const GlsVideoToTexture& ) DISTI_SPECIAL_MEM_FUN_DELETE;
95 GlsVideoToTexture( const GlsVideoToTexture& ) DISTI_SPECIAL_MEM_FUN_DELETE;
96
97 public:
98 DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
99 typedef GLPolygon _BaseClass; ///< Deprecated typedef for the base class.
100 typedef GLPolygon BaseClass; ///< Typedef for the base class.
101
102 /// Constructor
103 /// \param generateInstance Whether or not to generate an instance name for this object.
104 GLSGEN_GLSVIDEOTOTEXTURE_EXPORT GlsVideoToTexture( bool generateInstance = false );
105
106 /// Copy constructor
107 /// \param that The object to copy from.
108 /// \param generateNames Whether or not to generate an instance name for this object.
109 GLSGEN_GLSVIDEOTOTEXTURE_EXPORT GlsVideoToTexture( const GlsVideoToTexture& that, const bool generateNames );
110
111 /** Destructs a GlsVideoToTexture object */
112 virtual GLSGEN_GLSVIDEOTOTEXTURE_EXPORT ~GlsVideoToTexture();
113
114 /// \return A pointer to a new GlsVideoToTexture object.
115 static GLSGEN_GLSVIDEOTOTEXTURE_EXPORT DisplayObject* CreateInstance();
116
117 virtual GLSGEN_GLSVIDEOTOTEXTURE_EXPORT void SetAvailableAttributes( unsigned int value ) DISTI_METHOD_OVERRIDE;
118
119 virtual GLSGEN_GLSVIDEOTOTEXTURE_EXPORT DisplayObject* CloneObject( bool generateNames = false ) DISTI_METHOD_OVERRIDE;
120
121 virtual GLSGEN_GLSVIDEOTOTEXTURE_EXPORT void CopyProperties( DisplayObject* src ) DISTI_METHOD_OVERRIDE;
122
123#ifndef GLES
124 /// \copydoc DisplayObject::GetCppInterfaceDescription
125 virtual GLSGEN_GLSVIDEOTOTEXTURE_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList = NULL ) DISTI_METHOD_OVERRIDE;
126 /// \copydoc DisplayObject::GetCppInterfaceDescriptionFree
127 virtual GLSGEN_GLSVIDEOTOTEXTURE_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* array ) DISTI_METHOD_OVERRIDE;
128#endif
129
130 virtual GLSGEN_GLSVIDEOTOTEXTURE_EXPORT void PreDraw( const OpenGLMatrices& parentMatrices, Culler& culler ) DISTI_METHOD_OVERRIDE;
131 virtual GLSGEN_GLSVIDEOTOTEXTURE_EXPORT void Draw() DISTI_METHOD_OVERRIDE;
132
133 virtual GLSGEN_GLSVIDEOTOTEXTURE_EXPORT void SetValue( int spec, va_list& args ) DISTI_METHOD_OVERRIDE;
134
135 //////////////////////////////////////////////////
136 // GlsVideoToTexture specific operations
137 //////////////////////////////////////////////////
138
139 /// Sets the desired capture device index.
140 /// \param value The new capture device index to set.
141 virtual GLSGEN_GLSVIDEOTOTEXTURE_EXPORT void CaptureDevice( const int& value );
142
143 /// \return The current capture device index.
144 virtual GLSGEN_GLSVIDEOTOTEXTURE_EXPORT int CaptureDevice();
145
146 /// Specifies how many execution frames required to update on texture.
147 /// 1 == Full update in one frame.
148 /// \param value The new number of execution frames.
149 virtual GLSGEN_GLSVIDEOTOTEXTURE_EXPORT void NumUpdateBlocks( const int& value );
150
151 /// \return The number of execution frames required to update.
152 virtual GLSGEN_GLSVIDEOTOTEXTURE_EXPORT int NumUpdateBlocks();
153
154protected:
155 int _captureDevice; ///< The index of the device providing video input.
156 int _numUpdateBlocks; ///< The number of execution frames required to update on texture.
157 GlsVideoToTextureSource* _videoSource; ///< Observing pointer to the underlying video source device.
158};
159
160} // namespace disti
161
162#endif
disti::Culler
Definition: cull.h:50
disti::DisplayObject
Definition: display.h:96
disti::DynamicArray
Definition: dynamic_array.h:79
disti::GLPolygon
The Polygon class. Implements Polygons.
Definition: glpolygon.h:56
disti::GlsVideoToTexture
Definition: gls_video_to_texture.h:90
disti::GlsVideoToTexture::NumUpdateBlocks
virtual int NumUpdateBlocks()
disti::GlsVideoToTexture::_captureDevice
int _captureDevice
The index of the device providing video input.
Definition: gls_video_to_texture.h:155
disti::GlsVideoToTexture::_videoSource
GlsVideoToTextureSource * _videoSource
Observing pointer to the underlying video source device.
Definition: gls_video_to_texture.h:157
disti::GlsVideoToTexture::SetAvailableAttributes
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
disti::GlsVideoToTexture::Draw
virtual void Draw() DISTI_METHOD_OVERRIDE
disti::GlsVideoToTexture::CloneObject
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
disti::GlsVideoToTexture::PreDraw
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler) DISTI_METHOD_OVERRIDE
disti::GlsVideoToTexture::SetValue
virtual void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
disti::GlsVideoToTexture::CreateInstance
static DisplayObject * CreateInstance()
disti::GlsVideoToTexture::CaptureDevice
virtual int CaptureDevice()
disti::GlsVideoToTexture::CopyProperties
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
disti::GlsVideoToTexture::_numUpdateBlocks
int _numUpdateBlocks
The number of execution frames required to update on texture.
Definition: gls_video_to_texture.h:156
disti::OpenGLMatrices
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:544
glpolygon.h
The disti::GLPolygon class. Implements Polygons.
gls_auto_lib.h
The gls_auto_lib.
gls_cpp_lang_support.h
Macros and helper code to determine what subset of C++11/14/17 is available.
DISTI_SPECIAL_MEM_FUN_DELETE
#define DISTI_SPECIAL_MEM_FUN_DELETE
Macro to wrap function deletion, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:246
DISTI_DEPRECATED
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:488
DISTI_METHOD_OVERRIDE
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:222
GLSGEN_GLSVIDEOTOTEXTURE_EXPORT
#define GLSGEN_GLSVIDEOTOTEXTURE_EXPORT
Provides support for creating DLLs.
Definition: gls_video_to_texture.h:55
disti
Definition: bmpimage.h:47