pub struct Image {
pub width: u32,
pub height: u32,
pub real_width: u32,
pub real_height: u32,
pub format: TextureFormat,
pub tex: Option<u32>,
pub framebuffer: Option<u32>,
pub depth_buffer: Option<u32>,
pub stencil_buffer: Option<u32>,
}
Expand description
By default should be TextureFormat::Rgba32Uint For Depth And Stencil use TextureFormat::Depth32Float, TextureFormat::Depth24Plus, TextureFormat::Depth24PlusStencil8
It not yet handled Compressed textures like a: DXT1, DXT3, DXT5, RGTC1, RGTC2, BPTC (Bc1, Bc2, Bc3, Bc4, Bc5 Bc6, Bc7), Etc2, Eac, Etc, Astc
Fields
width: u32
height: u32
real_width: u32
real_height: u32
format: TextureFormat
tex: Option<u32>
framebuffer: Option<u32>
depth_buffer: Option<u32>
stencil_buffer: Option<u32>
Implementations
sourceimpl Image
impl Image
pub fn new(
width: u32,
height: u32,
format: TextureFormat,
render_target: bool
) -> Image
pub fn create(width: u32, height: u32, format: TextureFormat) -> Image
pub fn from_file(filename: &str) -> Image
pub fn from_bytes(
bytes: &[u8],
width: u32,
height: u32,
format: TextureFormat
) -> Image
pub fn create_3d(
width: i32,
height: i32,
depth: i32,
format: TextureFormat
) -> Image
pub fn create_render_target(
width: u32,
height: u32,
format: TextureFormat,
anti_aliasing_samples: u32,
context_id: u32
) -> Image
pub fn from_bytes_3d(
bytes: Bytes,
width: u32,
height: u32,
depth: u32,
format: TextureFormat
) -> Image
pub fn unload(&mut self)
pub fn make_active(&self, texture_unit: u32)
pub fn at(x: i32, y: i32) -> i32
pub fn is_opaque(x: i32, y: i32) -> bool
pub fn lock(&self, level: i32) -> Bytes
pub fn unlock(&self)
pub fn pixels(&self) -> Bytes
pub fn generate_mipmaps(&self, levels: i32)
pub fn set_mipmaps(&self, mipmaps: Vec<Image, Global>)
pub fn set_depth_stencil_from(&self, image: Image)
pub fn clear(
x: i32,
y: i32,
z: i32,
width: i32,
height: i32,
depth: i32,
color: Color
)
Trait Implementations
sourceimpl<C> Load<C, StoreKey, ()> for Image
impl<C> Load<C, StoreKey, ()> for Image
impl Copy for Image
Auto Trait Implementations
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
fn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.