Struct cogl::SubTexture[][src]

pub struct SubTexture(_, _);

Implementations

impl SubTexture[src]

pub fn new<P: IsA<Texture>>(
    ctx: &Context,
    parent_texture: &P,
    sub_x: i32,
    sub_y: i32,
    sub_width: i32,
    sub_height: i32
) -> SubTexture
[src]

Creates a high-level SubTexture representing a sub-region of any other Texture. The sub-region must strictly lye within the bounds of the parent_texture. The returned texture implements the MetaTexture interface because it’s not a low level texture that hardware can understand natively.

<note>Remember: Unless you are using high level drawing APIs such as cogl_rectangle or other APIs documented to understand the MetaTexture interface then you need to use the MetaTexture interface to resolve a SubTexture into a low-level texture before drawing.</note>

ctx

A Context pointer

parent_texture

The full texture containing a sub-region you want to make a SubTexture from.

sub_x

The top-left x coordinate of the parent region to make a texture from.

sub_y

The top-left y coordinate of the parent region to make a texture from.

sub_width

The width of the parent region to make a texture from.

sub_height

The height of the parent region to make a texture from.

Returns

A newly allocated SubTexture representing a sub-region of parent_texture.

pub fn get_parent(&self) -> Option<Texture>[src]

Retrieves the parent texture that self derives its content from. This is the texture that was passed to SubTexture::new as the parent_texture argument.

Returns

The parent texture that self derives its content from.

Trait Implementations

impl Clone for SubTexture[src]

impl Debug for SubTexture[src]

impl Display for SubTexture[src]

impl Eq for SubTexture[src]

impl Hash for SubTexture[src]

impl IsA<Object> for SubTexture[src]

impl Ord for SubTexture[src]

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

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

impl StaticType for SubTexture[src]

Auto Trait Implementations

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<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType
[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: SetValue + Send + ToValue + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?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.