[][src]Struct gstreamer_gl::GLShader

pub struct GLShader(_, _);

Implements

gst::ObjectExt, glib::object::ObjectExt

Implementations

impl GLShader[src]

pub fn new<P: IsA<GLContext>>(context: &P) -> GLShader[src]

Note: must be called in the GL thread

context

a GLContext

Returns

a new empty shader

pub fn new_default<P: IsA<GLContext>>(context: &P) -> Result<GLShader, Error>[src]

Note: must be called in the GL thread

context

a GLContext

Returns

a default shader or None on failure

pub fn attach(&self, stage: &GLSLStage) -> Result<(), BoolError>[src]

Attaches stage to self. stage must have been successfully compiled with GLSLStage::compile.

Note: must be called in the GL thread

stage

a GLSLStage to attach

Returns

whether stage could be attached to self

pub fn attach_unlocked(&self, stage: &GLSLStage) -> Result<(), BoolError>[src]

Attaches stage to self. stage must have been successfully compiled with GLSLStage::compile.

Note: must be called in the GL thread

stage

a GLSLStage to attach

Returns

whether stage could be attached to self

pub fn bind_attribute_location(&self, index: u32, name: &str)[src]

Bind attribute name to the specified location index using glBindAttributeLocation().

index

attribute index to set

name

name of the attribute

pub fn bind_frag_data_location(&self, index: u32, name: &str)[src]

Bind attribute name to the specified location index using glBindFragDataLocation().

index

attribute index to set

name

name of the attribute

pub fn compile_attach_stage(&self, stage: &GLSLStage) -> Result<(), Error>[src]

Compiles stage and attaches it to self.

Note: must be called in the GL thread

stage

a GLSLStage to attach

Returns

whether stage could be compiled and attached to self

pub fn detach(&self, stage: &GLSLStage)[src]

Detaches stage from self. stage must have been successfully attached to self with GLShader::attach or GLShader::attach_unlocked.

Note: must be called in the GL thread

stage

a GLSLStage to attach

pub fn detach_unlocked(&self, stage: &GLSLStage)[src]

Detaches stage from self. stage must have been successfully attached to self with GLShader::attach or GLShader::attach_unlocked.

Note: must be called in the GL thread

stage

a GLSLStage to attach

pub fn get_attribute_location(&self, name: &str) -> i32[src]

name

name of the attribute

Returns

the attribute index for name in self or -1 on failure

pub fn get_program_handle(&self) -> i32[src]

Returns

the GL program handle for this shader

pub fn is_linked(&self) -> bool[src]

Note: must be called in the GL thread

Returns

whether self has been successfully linked

Links the current list of GLSLStage's in self.

Note: must be called in the GL thread

Returns

whether self could be linked together.

pub fn release(&self)[src]

Releases the shader and stages.

Note: must be called in the GL thread

pub fn release_unlocked(&self)[src]

Releases the shader and stages.

Note: must be called in the GL thread

pub fn set_uniform_1f(&self, name: &str, value: f32)[src]

Perform glUniform1f() for name on self

name

name of the uniform

value

value to set

pub fn set_uniform_1fv(&self, name: &str, value: &[f32])[src]

Perform glUniform1fv() for name on self

name

name of the uniform

count

number of values to set

value

values to set

pub fn set_uniform_1i(&self, name: &str, value: i32)[src]

Perform glUniform1i() for name on self

name

name of the uniform

value

value to set

pub fn set_uniform_1iv(&self, name: &str, value: &[i32])[src]

Perform glUniform1iv() for name on self

name

name of the uniform

count

number of values to set

value

values to set

pub fn set_uniform_2f(&self, name: &str, v0: f32, v1: f32)[src]

Perform glUniform2f() for name on self

name

name of the uniform

v0

first value to set

v1

second value to set

pub fn set_uniform_2fv(&self, name: &str, value: &[f32])[src]

Perform glUniform2fv() for name on self

name

name of the uniform

count

number of values to set

value

values to set

pub fn set_uniform_2i(&self, name: &str, v0: i32, v1: i32)[src]

Perform glUniform2i() for name on self

name

name of the uniform

v0

first value to set

v1

second value to set

pub fn set_uniform_2iv(&self, name: &str, value: &[i32])[src]

Perform glUniform2iv() for name on self

name

name of the uniform

count

number of values to set

value

values to set

pub fn set_uniform_3f(&self, name: &str, v0: f32, v1: f32, v2: f32)[src]

Perform glUniform3f() for name on self

name

name of the uniform

v0

first value to set

v1

second value to set

v2

third value to set

pub fn set_uniform_3fv(&self, name: &str, value: &[f32])[src]

Perform glUniform3fv() for name on self

name

name of the uniform

count

number of values to set

value

values to set

pub fn set_uniform_3i(&self, name: &str, v0: i32, v1: i32, v2: i32)[src]

Perform glUniform3i() for name on self

name

name of the uniform

v0

first value to set

v1

second value to set

v2

third value to set

pub fn set_uniform_3iv(&self, name: &str, value: &[i32])[src]

Perform glUniform3iv() for name on self

name

name of the uniform

count

number of values to set

value

values to set

pub fn set_uniform_4f(&self, name: &str, v0: f32, v1: f32, v2: f32, v3: f32)[src]

Perform glUniform4f() for name on self

name

name of the uniform

v0

first value to set

v1

second value to set

v2

third value to set

v3

fourth value to set

pub fn set_uniform_4fv(&self, name: &str, value: &[f32])[src]

Perform glUniform4fv() for name on self

name

name of the uniform

count

number of values to set

value

values to set

pub fn set_uniform_4i(&self, name: &str, v0: i32, v1: i32, v2: i32, v3: i32)[src]

Perform glUniform4i() for name on self

name

name of the uniform

v0

first value to set

v1

second value to set

v2

third value to set

v3

fourth value to set

pub fn set_uniform_4iv(&self, name: &str, value: &[i32])[src]

Perform glUniform4iv() for name on self

name

name of the uniform

count

number of values to set

value

values to set

pub fn use_(&self)[src]

pub fn get_property_linked(&self) -> bool[src]

pub fn string_fragment_external_oes_get_default<P: IsA<GLContext>>(
    context: &P,
    version: GLSLVersion,
    profile: GLSLProfile
) -> Option<GString>
[src]

Feature: v1_16

context

a GLContext

version

a GLSLVersion

profile

a GLSLProfile

Returns

a passthrough shader string for copying an input external-oes texture to the output

pub fn string_fragment_get_default<P: IsA<GLContext>>(
    context: &P,
    version: GLSLVersion,
    profile: GLSLProfile
) -> Option<GString>
[src]

Feature: v1_16

context

a GLContext

version

a GLSLVersion

profile

a GLSLProfile

Returns

a passthrough shader string for copying an input texture to the output

pub fn string_get_highest_precision<P: IsA<GLContext>>(
    context: &P,
    version: GLSLVersion,
    profile: GLSLProfile
) -> Option<GString>
[src]

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.

Feature: v1_16

context

a GLContext

version

a GLSLVersion

profile

a GLSLProfile

Returns

a shader string defining the precision of float types based on context, version and profile

pub fn connect_property_linked_notify<F: Fn(&GLShader) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Trait Implementations

impl Clone for GLShader[src]

impl Debug for GLShader[src]

impl Eq for GLShader[src]

impl Hash for GLShader[src]

impl IsA<Object> for GLShader[src]

impl Ord for GLShader[src]

impl<T: ObjectType> PartialEq<T> for GLShader[src]

impl<T: ObjectType> PartialOrd<T> for GLShader[src]

impl Send for GLShader[src]

impl StaticType for GLShader[src]

impl Sync for GLShader[src]

Auto Trait Implementations

impl RefUnwindSafe for GLShader

impl Unpin for GLShader

impl UnwindSafe for GLShader

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 
[src]

impl<T> Cast for T where
    T: ObjectType
[src]

impl<T> From<T> for T[src]

impl<O> GObjectExtManualGst for O where
    O: IsA<Object>, 
[src]

impl<O> GstObjectExt for O where
    O: IsA<Object>, 
[src]

impl<O> GstObjectExtManual for O where
    O: IsA<Object>, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.