Struct rin::gl::Texture [−][src]
pub struct Texture { /* fields omitted */ }
Wraps an OpenGL texture + some metadata about it’s format
Implementations
impl Texture
[src]
impl Texture
[src]pub fn is_dsa(&self) -> bool
[src]
Returns true if the Texture
is backed by a DSA backend
pub fn load_data<T>(
&mut self,
data: &[T],
format: DataFormat
) -> Result<(), Error> where
T: 'static,
[src]
&mut self,
data: &[T],
format: DataFormat
) -> Result<(), Error> where
T: 'static,
Upload data to the texture
The function will check that the data dimensions are correct for the passed format and the allocated size.
DataFormat
implements Default so it usually doesn’t need to be fully specified
see it’s documentation for more information.
pub fn load_buffer<T, B>(
&mut self,
buffer: &B,
format: DataFormat
) -> Result<(), Error> where
B: BufferRange<T>,
T: 'static,
[src]
&mut self,
buffer: &B,
format: DataFormat
) -> Result<(), Error> where
B: BufferRange<T>,
T: 'static,
Load data to the texture from a Buffer
The function will check that the data dimensions are correct for the passed format and the allocated size
DataFormat
implements Default so it usually doesn’t need to be fully specified
see it’s documentation for more information.
pub fn load_compressed_data<T>(
&mut self,
data: &[T],
format: CompressedDataFormat
) -> Result<(), Error> where
T: 'static,
[src]
&mut self,
data: &[T],
format: CompressedDataFormat
) -> Result<(), Error> where
T: 'static,
Upload data to the texture
The function will check that the data dimensions are correct for the passed format and the allocated size. Also that the passed texture format is the same as the allocated internal
CompressedDataFormat
implements Default so it usually doesn’t
need to be fully specified see it’s documentation for more information.
pub fn load_compressed_buffer<B, T>(
&mut self,
buffer: &B,
format: CompressedDataFormat
) -> Result<(), Error> where
B: BufferRange<T>,
T: 'static,
[src]
&mut self,
buffer: &B,
format: CompressedDataFormat
) -> Result<(), Error> where
B: BufferRange<T>,
T: 'static,
Load data to the texture from a GPU Buffer
The function will check that the data dimensions are correct for the passed format and the allocated size. Also that the passed texture format is the same as the allocated internal
CompressedDataFormat
implements Default so it usually doesn’t
need to be fully specified see it’s documentation for more information.
pub fn load_level_from_image<I>(
&mut self,
img: &I,
level: u32
) -> Result<(), Error> where
I: Image,
[src]
&mut self,
img: &I,
level: u32
) -> Result<(), Error> where
I: Image,
Upload data to a texture level from an image
The function will check that the data dimensions are correct for the passed format and the allocated size
pub fn load_image<I>(&mut self, img: &I) -> Result<(), Error> where
I: Image,
[src]
I: Image,
Upload data to the texture from an image
If the image has more than one level it’ll try to upload all the levels to the textyre
The function will check that the data dimensions are correct for the passed format and the allocated size
pub fn width(&self) -> u32
[src]
Returns the width of the allocated texture
pub fn height(&self) -> u32
[src]
Returns the height of the allocated texture
pub fn depth(&self) -> u32
[src]
Returns the depth of the allocated texture
pub fn aspect_ratio(&self) -> f32
[src]
Returns the aspect ratio of the allocated texture
pub fn size(&self) -> (u32, u32)
[src]
Returns the size of the allocated texture as (width, height)
pub fn samples(&self) -> u32
[src]
Returns the samples of the allocated texture
pub fn levels(&self) -> u32
[src]
Returns the number of allocated levels
pub fn id(&self) -> u32
[src]
Returns the GL id
pub fn target(&self) -> u32
[src]
Returns the texture target
pub fn internal_format(&self) -> u32
[src]
Returns the internal format
pub fn view(&self) -> Texture
[src]
pub fn set_rg_to_rgba_swizzles(&mut self)
[src]
Swizzle from r -> rgb and g -> a
Useful to show grayscale or alpha + grayscale as grayscale instead of red tinted using the same shader one would use for an rgb(a) texture
pub fn set_swizzle_r(&mut self, component: Component)
[src]
Swizzle r -> component
pub fn set_swizzle_g(&mut self, component: Component)
[src]
Swizzle g -> component
pub fn set_swizzle_b(&mut self, component: Component)
[src]
Swizzle b -> component
pub fn set_swizzle_a(&mut self, component: Component)
[src]
Swizzle a -> component
pub fn set_swizzles(&mut self, swizzles: Swizzles)
[src]
Sets a group of Swizzles
pub unsafe fn read_to<T>(&self, pixels: &mut [T], format: u32, ty: u32)
[src]
Reads back the contents of the texture into the passed pixels
pub unsafe fn read_to_buffer<T, B>(&self, buffer: &mut B, format: u32, ty: u32) where
B: BufferRange<T>,
[src]
B: BufferRange<T>,
Reads back the contents of the texture into the passed pixels
pub fn set_anisotropy_level(&mut self, level: f32)
[src]
GL_TEXTURE_MAX_ANISOTROPY_EXT
pub fn set_base_level(&mut self, level: i32)
[src]
GL_TEXTURE_BASE_LEVEL
pub fn set_max_level(&mut self, level: i32)
[src]
GL_TEXTURE_MAX_LEVEL
pub fn set_min_lod(&mut self, level: i32)
[src]
GL_TEXTURE_MIN_LOD
pub fn set_max_lod(&mut self, level: i32)
[src]
GL_TEXTURE_MAX_LOD
pub fn set_min_mag_filters(&mut self, min: u32, mag: u32)
[src]
GL_TEXTURE_MIN_MAG_FILTERS
pub fn set_wrap_s(&mut self, wrap: u32)
[src]
GL_TEXTURE_WRAP_S
pub fn set_wrap_t(&mut self, wrap: u32)
[src]
GL_TEXTURE_WRAP_T
pub fn set_wrap_r(&mut self, wrap: u32)
[src]
GL_TEXTURE_WRAP_R
pub fn set_compare_mode(&mut self, mode: u32)
[src]
pub fn set_compare_func(&mut self, mode: u32)
[src]
pub fn set_border_color(&mut self, color: &[f32; 4])
[src]
GL_TEXTURE_BORDER_COLOR
pub fn level_width(&self, level: u32) -> u32
[src]
GL_TEXTURE_WIDTH
pub fn level_height(&self, level: u32) -> u32
[src]
GL_TEXTURE_HEIGHT
pub fn level_internal_format(&self, level: u32) -> u32
[src]
GL_TEXTURE_INTERNAL_FORMAT
pub fn level_red_type(&self, level: u32) -> u32
[src]
GL_TEXTURE_RED_TYPE
pub fn level_green_type(&self, level: u32) -> u32
[src]
GL_TEXTURE_GREEN_TYPE
pub fn level_blue_type(&self, level: u32) -> u32
[src]
GL_TEXTURE_BLUE_TYPE
pub fn level_alpha_type(&self, level: u32) -> u32
[src]
GL_TEXTURE_ALPHA_TYPE
pub fn is_level_compressed(&self, level: u32) -> bool
[src]
GL_TEXTURE_COMPRESSED
pub fn level_compressed_image_len(&self, level: u32) -> usize
[src]
GL_TEXTURE_COMPRESSED_IMAGE_SIZE
pub fn level_red_size(&self, level: u32) -> usize
[src]
GL_TEXTURE_RED_SIZE
pub fn level_green_size(&self, level: u32) -> usize
[src]
GL_TEXTURE_GREEN_SIZE
pub fn level_blue_size(&self, level: u32) -> usize
[src]
GL_TEXTURE_BLUE_SIZE
pub fn level_alpha_size(&self, level: u32) -> usize
[src]
GL_TEXTURE_ALPHA_SIZE
pub fn depth_stencil_texture_mode(&self) -> u32
[src]
GL_DEPTH_STENCIL_TEXTURE_MODE
pub fn mag_filter(&self) -> u32
[src]
GL_TEXTURE_MAG_FILTER
pub fn min_filter(&self) -> u32
[src]
GL_TEXTURE_MIN_FILTER
pub fn min_lod(&self) -> i32
[src]
GL_TEXTURE_MIN_LOD
pub fn max_lod(&self) -> i32
[src]
GL_TEXTURE_MAX_LOD
pub fn base_level(&self) -> i32
[src]
GL_TEXTURE_BASE_LEVEL
pub fn max_level(&self) -> i32
[src]
GL_TEXTURE_MAX_LEVEL
pub fn swizzle_r(&self) -> Component
[src]
GL_TEXTURE_SWIZZLE_R
pub fn swizzle_g(&self) -> Component
[src]
GL_TEXTURE_SWIZZLE_G
pub fn swizzle_b(&self) -> Component
[src]
GL_TEXTURE_SWIZZLE_B
pub fn swizzle_a(&self) -> Component
[src]
GL_TEXTURE_SWIZZLE_A
pub fn swizzles(&self) -> Swizzles
[src]
GL_TEXTURE_SWIZZLE_RGBA
pub fn wrap_s(&self) -> u32
[src]
GL_TEXTURE_WRAP_S
pub fn wrap_t(&self) -> u32
[src]
GL_TEXTURE_WRAP_T
pub fn wrap_r(&self) -> u32
[src]
GL_TEXTURE_WRAP_R
pub fn border_color(&self) -> [f32; 4]
[src]
GL_TEXTURE_BORDER_COLOR
pub fn compare_mode(&self) -> u32
[src]
GL_TEXTURE_COMPARE_MODE
pub fn compare_func(&self) -> u32
[src]
GL_TEXTURE_COMPARE_FUNC
pub fn image_format_compatibility_type(&self) -> u32
[src]
GL_IMAGE_FORMAT_COMPATIBILITY_TYPE
pub unsafe fn set_parameteri(&mut self, parameter: u32, value: i32)
[src]
pub unsafe fn set_parameterf(&mut self, parameter: u32, value: f32)
[src]
pub unsafe fn get_level_parameteriv(&self, parameter: u32, level: u32) -> i32
[src]
pub unsafe fn get_parameteri(&self, parameter: u32) -> i32
[src]
pub unsafe fn get_parameterf(&self, parameter: u32) -> f32
[src]
pub unsafe fn get_parameterfv(
&self,
parameter: u32,
len: usize
) -> Vec<f32, Global>ⓘ
[src]
&self,
parameter: u32,
len: usize
) -> Vec<f32, Global>ⓘ
pub fn generate_mipmaps(&self)
[src]
glGenerateMipmaps
pub fn format(&self) -> Format
[src]
Returns the texture format
pub fn texture_sampler(&'a self, sampler: &'a Sampler) -> TextureSampler<'a>
[src]
Trait Implementations
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]pub fn as_uniform(&self) -> UniformValue
[src]
impl<'a> BorrowColorAttach for &'a Texture
[src]
impl<'a> BorrowColorAttach for &'a Texture
[src]type ColorAttach = Texture
pub fn borrow_color_attachment(&self) -> &Texture
[src]
impl<'a> BorrowDepthAttach for &'a Texture
[src]
impl<'a> BorrowDepthAttach for &'a Texture
[src]type DepthAttach = Texture
pub fn borrow_depth_attachment(&self) -> &Texture
[src]
impl ColorAttach for Texture
[src]
impl ColorAttach for Texture
[src]impl DepthAttach for Texture
[src]
impl DepthAttach for Texture
[src]impl<'a> Render2d for &'a Texture
[src]
impl<'a> Render2d for &'a Texture
[src]type Material = BasicMaterial<&'a Texture>
pub fn default_material(&'b self) -> BasicMaterial<&'a Texture>
[src]
pub fn render_with_material<R, M>(
&self,
gl: &Renderer<'_, R>,
pos: &Point<f32, U2>,
material: &M
) where
M: Material,
R: RenderSurface,
[src]
&self,
gl: &Renderer<'_, R>,
pos: &Point<f32, U2>,
material: &M
) where
M: Material,
R: RenderSurface,
pub fn render_size_with_material<R, M>(
&self,
gl: &Renderer<'_, R>,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>,
material: &M
) where
M: Material,
R: RenderSurface,
[src]
&self,
gl: &Renderer<'_, R>,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>,
material: &M
) where
M: Material,
R: RenderSurface,
pub fn render<R>(&self, renderer: &Renderer<'_, R>, pos: &Point<f32, U2>) where
R: RenderSurface,
[src]
R: RenderSurface,
pub fn render_size<R>(
&self,
renderer: &Renderer<'_, R>,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>
) where
R: RenderSurface,
[src]
&self,
renderer: &Renderer<'_, R>,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>
) where
R: RenderSurface,
impl<'a> TextureUniformValue for &'a Texture
[src]
impl<'a> TextureUniformValue for &'a Texture
[src]pub fn as_texture_uniform(&self, binding: u32) -> UniformValue
[src]
impl TextureUniformValue for Texture
[src]
impl TextureUniformValue for Texture
[src]pub fn as_texture_uniform(&self, binding: u32) -> UniformValue
[src]
impl Eq for Texture
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Texture
impl !Send for Texture
impl !Sync for Texture
impl Unpin for Texture
impl !UnwindSafe for Texture
Blanket Implementations
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]pub fn as_uniform(&self) -> UniformValue
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]pub fn as_uniform(&self) -> UniformValue
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]pub fn as_uniform(&self) -> UniformValue
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]pub fn as_uniform(&self) -> UniformValue
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]pub fn as_uniform(&self) -> UniformValue
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]pub fn as_uniform(&self) -> UniformValue
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]
impl<T> AsUniform<Texture> for T where
T: Borrow<Texture>,
[src]pub fn as_uniform(&self) -> UniformValue
[src]
impl<C> BorrowColorAttach for C where
C: ColorAttach,
[src]
impl<C> BorrowColorAttach for C where
C: ColorAttach,
[src]type ColorAttach = C
pub fn borrow_color_attachment(&self) -> &<C as BorrowColorAttach>::ColorAttach
[src]
impl<C> BorrowDepthAttach for C where
C: DepthAttach,
[src]
impl<C> BorrowDepthAttach for C where
C: DepthAttach,
[src]type DepthAttach = C
pub fn borrow_depth_attachment(&self) -> &<C as BorrowDepthAttach>::DepthAttach
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]