pub struct Texture { /* private fields */ }
Implementations§
Source§impl Texture
impl Texture
pub fn new( gl: Gl, width: u32, height: u32, data_type: TextureType, format: TextureFormat, data: TextureContent, ) -> Result<Texture, GlError>
pub fn gl(&self) -> Gl
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn data_type(&self) -> TextureType
pub fn format(&self) -> TextureFormat
pub fn size(&self) -> (u32, u32)
pub fn filter(&self) -> TextureFilter
pub fn set_filter(&self, filter: TextureFilter)
pub fn write_image(&self, image: &HtmlImageElement) -> Result<(), GlError>
pub fn write_bytes(&self, bytes: &Vec<u8>) -> Result<(), GlError>
Sourcepub fn read_pixels_into_array(&self, array: &mut [u8]) -> Result<(), GlError>
pub fn read_pixels_into_array(&self, array: &mut [u8]) -> Result<(), GlError>
Read RGBA 8-bit data into vector
Sourcepub fn read_pixels_into_buffer(
&self,
buffer: &Uint8Array,
) -> Result<(), GlError>
pub fn read_pixels_into_buffer( &self, buffer: &Uint8Array, ) -> Result<(), GlError>
Read RGBA 8-bit data into UInt8Array
pub fn read_pixels_array(&self) -> Result<Vec<u8>, GlError>
pub fn read_pixels_buffer(&self) -> Result<Uint8Array, GlError>
pub fn clear(&self, r: f32, g: f32, b: f32, a: f32) -> Result<(), GlError>
Trait Implementations§
Source§impl IntoUniform for Texture
impl IntoUniform for Texture
fn into_uniform(&self) -> UniformValue
impl Eq for Texture
impl StructuralPartialEq for Texture
Auto Trait Implementations§
impl Freeze for Texture
impl !RefUnwindSafe for Texture
impl !Send for Texture
impl !Sync for Texture
impl Unpin for Texture
impl !UnwindSafe for Texture
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more