Struct cogl::Texture2D[][src]

pub struct Texture2D(_, _);

Implementations

impl Texture2D[src]

pub fn gl_new_from_foreign(
    ctx: &Context,
    gl_handle: u32,
    width: i32,
    height: i32,
    format: PixelFormat
) -> Texture2D
[src]

Wraps an existing GL_TEXTURE_2D texture object as a Texture2D. This can be used for integrating Cogl with software using OpenGL directly.

The texture is still configurable until it has been allocated so for example you can declare whether the texture is premultiplied with Texture::set_premultiplied.

<note>The results are undefined for passing an invalid gl_handle or if width or height don’t have the correct texture geometry.</note>

ctx

A Context

gl_handle

A GL handle for a GL_TEXTURE_2D texture object

width

Width of the foreign GL texture

height

Height of the foreign GL texture

format

The format of the texture

Returns

A newly allocated Texture2D

pub fn from_bitmap(bitmap: &Bitmap) -> Texture2D[src]

pub fn from_data(
    ctx: &Context,
    width: i32,
    height: i32,
    format: PixelFormat,
    rowstride: i32,
    data: &[u8]
) -> Result<Texture2D, Error>
[src]

pub fn from_file(ctx: &Context, filename: &str) -> Result<Texture2D, Error>[src]

pub fn with_size(ctx: &Context, width: i32, height: i32) -> Texture2D[src]

Trait Implementations

impl Clone for Texture2D[src]

impl Debug for Texture2D[src]

impl Display for Texture2D[src]

impl Eq for Texture2D[src]

impl Hash for Texture2D[src]

impl IsA<Object> for Texture2D[src]

impl IsA<Texture> for Texture2D[src]

impl Ord for Texture2D[src]

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

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

impl StaticType for Texture2D[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.