GstGL.GLShader¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
Shader link status |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
context |
r |
||
parent |
r |
Class Details¶
- class GstGL.GLShader(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(context)[source]¶
- Parameters:
context (
GstGL.GLContext
) – aGstGL.GLContext
- Returns:
a new empty shader
- Return type:
Note: must be called in the GL thread
- classmethod new_default(context)[source]¶
- Parameters:
context (
GstGL.GLContext
) – aGstGL.GLContext
- Raises:
- Returns:
a default shader or
None
on failure- Return type:
Note: must be called in the GL thread
New in version 1.8.
- classmethod string_fragment_external_oes_get_default(context, version, profile)[source]¶
- Parameters:
context (
GstGL.GLContext
) – aGstGL.GLContext
version (
GstGL.GLSLVersion
) – aGstGL.GLSLVersion
profile (
GstGL.GLSLProfile
) – aGstGL.GLSLProfile
- Returns:
a passthrough shader string for copying an input external-oes texture to the output
- Return type:
New in version 1.16.
- classmethod string_fragment_get_default(context, version, profile)[source]¶
- Parameters:
context (
GstGL.GLContext
) – aGstGL.GLContext
version (
GstGL.GLSLVersion
) – aGstGL.GLSLVersion
profile (
GstGL.GLSLProfile
) – aGstGL.GLSLProfile
- Returns:
a passthrough shader string for copying an input texture to the output
- Return type:
New in version 1.16.
- classmethod string_get_highest_precision(context, version, profile)[source]¶
- Parameters:
context (
GstGL.GLContext
) – aGstGL.GLContext
version (
GstGL.GLSLVersion
) – aGstGL.GLSLVersion
profile (
GstGL.GLSLProfile
) – aGstGL.GLSLProfile
- Returns:
a shader string defining the precision of float types based on context, version and profile
- Return type:
Generates a shader string that defines the precision of float types in GLSL shaders. This is particularly needed for fragment shaders in a GLSL ES context where there is no default precision specified.
Practically, this will return the string ‘precision mediump float’ or ‘precision highp float’ depending on if high precision floats are determined to be supported.
New in version 1.16.
- attach(stage)[source]¶
- Parameters:
stage (
GstGL.GLSLStage
) – aGstGL.GLSLStage
to attach- Returns:
whether stage could be attached to self
- Return type:
Attaches stage to self. stage must have been successfully compiled with
GstGL.GLSLStage.compile
().Note: must be called in the GL thread
New in version 1.8.
- attach_unlocked(stage)[source]¶
- Parameters:
stage (
GstGL.GLSLStage
) – aGstGL.GLSLStage
to attach- Returns:
whether stage could be attached to self
- Return type:
Attaches stage to self. stage must have been successfully compiled with
GstGL.GLSLStage.compile
().Note: must be called in the GL thread
New in version 1.8.
- bind_attribute_location(index, name)[source]¶
-
Bind attribute name to the specified location index using
glBindAttributeLocation()
.
- bind_frag_data_location(index, name)[source]¶
-
Bind attribute name to the specified location index using
glBindFragDataLocation()
.
- compile_attach_stage(stage)[source]¶
- Parameters:
stage (
GstGL.GLSLStage
) – aGstGL.GLSLStage
to attach- Raises:
- Returns:
whether stage could be compiled and attached to self
- Return type:
Compiles stage and attaches it to self.
Note: must be called in the GL thread
New in version 1.8.
- detach(stage)[source]¶
- Parameters:
stage (
GstGL.GLSLStage
) – aGstGL.GLSLStage
to attach
Detaches stage from self. stage must have been successfully attached to self with
GstGL.GLShader.attach
() orGstGL.GLShader.attach_unlocked
().Note: must be called in the GL thread
New in version 1.8.
- detach_unlocked(stage)[source]¶
- Parameters:
stage (
GstGL.GLSLStage
) – aGstGL.GLSLStage
to attach
Detaches stage from self. stage must have been successfully attached to self with
GstGL.GLShader.attach
() orGstGL.GLShader.attach_unlocked
().Note: must be called in the GL thread
New in version 1.8.
- get_program_handle()[source]¶
- Returns:
the GL program handle for this shader
- Return type:
New in version 1.8.
- is_linked()[source]¶
- Returns:
whether self has been successfully linked
- Return type:
Note: must be called in the GL thread
New in version 1.8.
- link()[source]¶
- Raises:
- Returns:
whether self could be linked together.
- Return type:
Links the current list of
GstGL.GLSLStage
's in self.Note: must be called in the GL thread
New in version 1.8.
- release()[source]¶
Releases the shader and stages.
Note: must be called in the GL thread
New in version 1.8.
- release_unlocked()[source]¶
Releases the shader and stages.
Note: must be called in the GL thread
New in version 1.8.
- set_uniform_matrix_2fv(name, count, transpose, value)[source]¶
- Parameters:
Perform
glUniformMatrix2fv()
for name on self
- set_uniform_matrix_2x3fv(name, count, transpose, value)[source]¶
- Parameters:
Perform
glUniformMatrix2x3fv()
for name on self
- set_uniform_matrix_2x4fv(name, count, transpose, value)[source]¶
- Parameters:
Perform
glUniformMatrix2x4fv()
for name on self
- set_uniform_matrix_3fv(name, count, transpose, value)[source]¶
- Parameters:
Perform
glUniformMatrix3fv()
for name on self
- set_uniform_matrix_3x2fv(name, count, transpose, value)[source]¶
- Parameters:
Perform
glUniformMatrix3x2fv()
for name on self
- set_uniform_matrix_3x4fv(name, count, transpose, value)[source]¶
- Parameters:
Perform
glUniformMatrix3x4fv()
for name on self
- set_uniform_matrix_4fv(name, count, transpose, value)[source]¶
- Parameters:
Perform
glUniformMatrix4fv()
for name on self
- set_uniform_matrix_4x2fv(name, count, transpose, value)[source]¶
- Parameters:
Perform
glUniformMatrix4x2fv()
for name on self