Struct ux::native::TextureCache[][src]

pub struct TextureCache { /* fields omitted */ }

Implementations

impl TextureCache[src]

pub fn get_default() -> Option<TextureCache>[src]

get_default:

Returns the default texture cache. This is owned by Mx and should not be unreferenced or freed.

Returns: (transfer none): a TextureCache

Trait Implementations

impl AsRef<TextureCache> for TextureCache[src]

impl Clone for TextureCache[src]

impl Debug for TextureCache[src]

impl Display for TextureCache[src]

impl Is<TextureCache> for TextureCache[src]

impl Object for TextureCache[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<T> From<T> for T[src]

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

impl<Fr, To> IntoColor<To> for Fr where
    To: FromColor<Fr>, 
[src]

impl<O> TextureCacheExt for O where
    O: Is<TextureCache>, 
[src]

pub fn contains(&self, uri: &str) -> bool[src]

contains: @self: A #TextureCache @uri: A URI or path to an image file

Checks whether the given URI/path is contained within the texture cache.

Returns: %true if the image exists, %false otherwise

pub fn get_cogl_texture(&self, uri: &str) -> Option<Handle>[src]

contains_meta: @self: A #TextureCache @uri: A URI or path to an image file @ident: A unique identifier

Checks whether there are any textures associated with the given URI by the given identifier.

Returns: %true if the data exists, %false otherwise

get_cogl_texture: @self: A #TextureCache @uri: A URI or path to an image file

Create a #CoglHandle representing a texture of the specified image. Adds the image to the cache if the image had not been previously loaded. Subsequent calls with the same image URI/path will return the #CoglHandle of the previously loaded image with an increased reference count.

Returns: (transfer none): a #CoglHandle to the cached texture

pub fn get_size(&self) -> usize[src]

get_meta_cogl_texture: @self: A #TextureCache @uri: A URI or path to an image file @ident: A unique identifier

Retrieves the #CoglHandle of the previously added image associated with the given unique identifier.

See insert_meta()

Returns: (transfer full): A #CoglHandle to a texture, with an added reference. %None if no image was found.

get_size: @self: A #TextureCache

Returns the number of items in the texture cache

Returns: the current size of the cache

pub fn insert(&self, uri: &str, texture: Handle)[src]

insert: @self: A #TextureCache @uri: A URI or local file path @texture: A #CoglHandle to a texture

Inserts a texture into the texture cache. This can be useful if you want to cache a texture from a custom or unhandled URI type, or you want to override a particular texture.

If the image is already in the cache, this texture will replace it. A reference will be taken on the given texture.

pub fn load_cache(&self, filename: &str)[src]

insert_meta: @self: A #TextureCache @uri: A URI or local file path @ident: A unique identifier @texture: A #CoglHandle to a texture @destroy_func: An optional destruction function for @ident

Inserts a texture that’s associated with a URI into the cache. If the metadata already exists for this URI, it will be replaced.

This is useful if you have a widely used modification of an image, for example, an image with a border composited around it.

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,