Struct ux::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]
pub fn as_ref(&self) -> &TextureCache
[src]
impl Clone for TextureCache
[src]
pub fn clone(&self) -> TextureCache
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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
impl !RefUnwindSafe for TextureCache
impl Send for TextureCache
impl !Sync for TextureCache
impl Unpin for TextureCache
impl UnwindSafe for TextureCache
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<O> TextureCacheExt for O where
O: Is<TextureCache>,
[src]
O: Is<TextureCache>,
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]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,