[−][src]Struct gdnative::prelude::Image
core class Image
inherits Resource
(reference counted).
Official documentation
See the documentation of this class in the Godot engine's official documentation.
Memory management
The lifetime of this object is automatically managed through reference counting.
Class hierarchy
Image inherits methods from:
Safety
All types in the Godot API have "interior mutability" in Rust parlance.
To enforce that the official thread-safety guidelines are
followed, the typestate pattern is used in the Ref
and TRef
smart pointers,
and the Instance
API. The typestate Access
in these types tracks whether the
access is unique, shared, or exclusive to the current thread. For more information,
see the type-level documentation on Ref
.
Implementations
impl Image
[src]
Constants
pub const ALPHA_BIT: i64
[src]
pub const ALPHA_BLEND: i64
[src]
pub const ALPHA_NONE: i64
[src]
pub const COMPRESS_ETC: i64
[src]
pub const COMPRESS_ETC2: i64
[src]
pub const COMPRESS_PVRTC2: i64
[src]
pub const COMPRESS_PVRTC4: i64
[src]
pub const COMPRESS_S3TC: i64
[src]
pub const COMPRESS_SOURCE_GENERIC: i64
[src]
pub const COMPRESS_SOURCE_NORMAL: i64
[src]
pub const COMPRESS_SOURCE_SRGB: i64
[src]
pub const FORMAT_BPTC_RGBA: i64
[src]
pub const FORMAT_BPTC_RGBF: i64
[src]
pub const FORMAT_BPTC_RGBFU: i64
[src]
pub const FORMAT_DXT1: i64
[src]
pub const FORMAT_DXT3: i64
[src]
pub const FORMAT_DXT5: i64
[src]
pub const FORMAT_ETC: i64
[src]
pub const FORMAT_ETC2_R11: i64
[src]
pub const FORMAT_ETC2_R11S: i64
[src]
pub const FORMAT_ETC2_RG11: i64
[src]
pub const FORMAT_ETC2_RG11S: i64
[src]
pub const FORMAT_ETC2_RGB8: i64
[src]
pub const FORMAT_ETC2_RGB8A1: i64
[src]
pub const FORMAT_ETC2_RGBA8: i64
[src]
pub const FORMAT_L8: i64
[src]
pub const FORMAT_LA8: i64
[src]
pub const FORMAT_MAX: i64
[src]
pub const FORMAT_PVRTC2: i64
[src]
pub const FORMAT_PVRTC2A: i64
[src]
pub const FORMAT_PVRTC4: i64
[src]
pub const FORMAT_PVRTC4A: i64
[src]
pub const FORMAT_R8: i64
[src]
pub const FORMAT_RF: i64
[src]
pub const FORMAT_RG8: i64
[src]
pub const FORMAT_RGB8: i64
[src]
pub const FORMAT_RGBA4444: i64
[src]
pub const FORMAT_RGBA5551: i64
[src]
pub const FORMAT_RGBA8: i64
[src]
pub const FORMAT_RGBAF: i64
[src]
pub const FORMAT_RGBAH: i64
[src]
pub const FORMAT_RGBE9995: i64
[src]
pub const FORMAT_RGBF: i64
[src]
pub const FORMAT_RGBH: i64
[src]
pub const FORMAT_RGF: i64
[src]
pub const FORMAT_RGH: i64
[src]
pub const FORMAT_RGTC_R: i64
[src]
pub const FORMAT_RGTC_RG: i64
[src]
pub const FORMAT_RH: i64
[src]
pub const INTERPOLATE_BILINEAR: i64
[src]
pub const INTERPOLATE_CUBIC: i64
[src]
pub const INTERPOLATE_LANCZOS: i64
[src]
pub const INTERPOLATE_NEAREST: i64
[src]
pub const INTERPOLATE_TRILINEAR: i64
[src]
pub const MAX_HEIGHT: i64
[src]
pub const MAX_WIDTH: i64
[src]
impl Image
[src]
pub fn new() -> Ref<Image, Unique>
[src]
Creates a new instance of this object.
This is a reference-counted type. The returned object is automatically managed
by Ref
.
pub fn blend_rect(
&self,
src: impl AsArg<Image>,
src_rect: Rect<f32, UnknownUnit>,
dst: Vector2D<f32, UnknownUnit>
)
[src]
&self,
src: impl AsArg<Image>,
src_rect: Rect<f32, UnknownUnit>,
dst: Vector2D<f32, UnknownUnit>
)
pub fn blend_rect_mask(
&self,
src: impl AsArg<Image>,
mask: impl AsArg<Image>,
src_rect: Rect<f32, UnknownUnit>,
dst: Vector2D<f32, UnknownUnit>
)
[src]
&self,
src: impl AsArg<Image>,
mask: impl AsArg<Image>,
src_rect: Rect<f32, UnknownUnit>,
dst: Vector2D<f32, UnknownUnit>
)
pub fn blit_rect(
&self,
src: impl AsArg<Image>,
src_rect: Rect<f32, UnknownUnit>,
dst: Vector2D<f32, UnknownUnit>
)
[src]
&self,
src: impl AsArg<Image>,
src_rect: Rect<f32, UnknownUnit>,
dst: Vector2D<f32, UnknownUnit>
)
pub fn blit_rect_mask(
&self,
src: impl AsArg<Image>,
mask: impl AsArg<Image>,
src_rect: Rect<f32, UnknownUnit>,
dst: Vector2D<f32, UnknownUnit>
)
[src]
&self,
src: impl AsArg<Image>,
mask: impl AsArg<Image>,
src_rect: Rect<f32, UnknownUnit>,
dst: Vector2D<f32, UnknownUnit>
)
pub fn bumpmap_to_normalmap(&self, bump_scale: f64)
[src]
pub fn clear_mipmaps(&self)
[src]
pub fn compress(
&self,
mode: i64,
source: i64,
lossy_quality: f64
) -> Result<(), GodotError>
[src]
&self,
mode: i64,
source: i64,
lossy_quality: f64
) -> Result<(), GodotError>
pub fn convert(&self, format: i64)
[src]
pub fn copy_from(&self, src: impl AsArg<Image>)
[src]
pub fn create(&self, width: i64, height: i64, use_mipmaps: bool, format: i64)
[src]
pub fn create_from_data(
&self,
width: i64,
height: i64,
use_mipmaps: bool,
format: i64,
data: TypedArray<u8>
)
[src]
&self,
width: i64,
height: i64,
use_mipmaps: bool,
format: i64,
data: TypedArray<u8>
)
pub fn crop(&self, width: i64, height: i64)
[src]
pub fn decompress(&self) -> Result<(), GodotError>
[src]
pub fn detect_alpha(&self) -> AlphaMode
[src]
pub fn expand_x2_hq2x(&self)
[src]
pub fn fill(&self, color: Color)
[src]
pub fn fix_alpha_edges(&self)
[src]
pub fn flip_x(&self)
[src]
pub fn flip_y(&self)
[src]
pub fn generate_mipmaps(&self, renormalize: bool) -> Result<(), GodotError>
[src]
pub fn get_data(&self) -> TypedArray<u8>
[src]
pub fn get_format(&self) -> Format
[src]
pub fn get_height(&self) -> i64
[src]
pub fn get_mipmap_offset(&self, mipmap: i64) -> i64
[src]
pub fn get_pixel(&self, x: i64, y: i64) -> Color
[src]
pub fn get_pixelv(&self, src: Vector2D<f32, UnknownUnit>) -> Color
[src]
pub fn get_rect(
&self,
rect: Rect<f32, UnknownUnit>
) -> Option<Ref<Image, Shared>>
[src]
&self,
rect: Rect<f32, UnknownUnit>
) -> Option<Ref<Image, Shared>>
pub fn get_size(&self) -> Vector2D<f32, UnknownUnit>
[src]
pub fn get_used_rect(&self) -> Rect<f32, UnknownUnit>
[src]
pub fn get_width(&self) -> i64
[src]
pub fn has_mipmaps(&self) -> bool
[src]
pub fn is_compressed(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn is_invisible(&self) -> bool
[src]
pub fn load(&self, path: impl Into<GodotString>) -> Result<(), GodotError>
[src]
pub fn load_jpg_from_buffer(
&self,
buffer: TypedArray<u8>
) -> Result<(), GodotError>
[src]
&self,
buffer: TypedArray<u8>
) -> Result<(), GodotError>
pub fn load_png_from_buffer(
&self,
buffer: TypedArray<u8>
) -> Result<(), GodotError>
[src]
&self,
buffer: TypedArray<u8>
) -> Result<(), GodotError>
pub fn load_webp_from_buffer(
&self,
buffer: TypedArray<u8>
) -> Result<(), GodotError>
[src]
&self,
buffer: TypedArray<u8>
) -> Result<(), GodotError>
pub fn lock(&self)
[src]
pub fn normalmap_to_xy(&self)
[src]
pub fn premultiply_alpha(&self)
[src]
pub fn resize(&self, width: i64, height: i64, interpolation: i64)
[src]
pub fn resize_to_po2(&self, square: bool)
[src]
pub fn rgbe_to_srgb(&self) -> Option<Ref<Image, Shared>>
[src]
pub fn save_exr(
&self,
path: impl Into<GodotString>,
grayscale: bool
) -> Result<(), GodotError>
[src]
&self,
path: impl Into<GodotString>,
grayscale: bool
) -> Result<(), GodotError>
pub fn save_png(&self, path: impl Into<GodotString>) -> Result<(), GodotError>
[src]
pub fn save_png_to_buffer(&self) -> TypedArray<u8>
[src]
pub fn set_pixel(&self, x: i64, y: i64, color: Color)
[src]
pub fn set_pixelv(&self, dst: Vector2D<f32, UnknownUnit>, color: Color)
[src]
pub fn shrink_x2(&self)
[src]
pub fn srgb_to_linear(&self)
[src]
pub fn unlock(&self)
[src]
Methods from Deref<Target = Resource>
pub fn duplicate(&self, subresources: bool) -> Option<Ref<Resource, Shared>>
[src]
pub fn get_local_scene(&self) -> Option<Ref<Node, Shared>>
[src]
pub fn name(&self) -> GodotString
[src]
pub fn path(&self) -> GodotString
[src]
pub fn get_rid(&self) -> Rid
[src]
pub fn is_local_to_scene(&self) -> bool
[src]
pub fn set_local_to_scene(&self, enable: bool)
[src]
pub fn set_name(&self, name: impl Into<GodotString>)
[src]
pub fn set_path(&self, path: impl Into<GodotString>)
[src]
pub fn setup_local_to_scene(&self)
[src]
pub fn take_over_path(&self, path: impl Into<GodotString>)
[src]
Trait Implementations
impl Debug for Image
[src]
impl Deref for Image
[src]
impl DerefMut for Image
[src]
impl GodotObject for Image
[src]
type RefKind = RefCounted
The memory management kind of this type. This modifies the behavior of the Ref
smart pointer. See its type-level documentation for more information. Read more
fn class_name() -> &'static str
[src]
fn null() -> Null<Self>
[src]
fn new() -> Ref<Self, Unique> where
Self: Instanciable,
[src]
Self: Instanciable,
fn cast<T>(&self) -> Option<&T> where
T: GodotObject + SubClass<Self>,
[src]
T: GodotObject + SubClass<Self>,
fn upcast<T>(&self) -> &T where
Self: SubClass<T>,
T: GodotObject,
[src]
Self: SubClass<T>,
T: GodotObject,
unsafe fn assume_shared(&self) -> Ref<Self, Shared>
[src]
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
[src]
Self: GodotObject<RefKind = RefCounted>,
unsafe fn assume_unique(&self) -> Ref<Self, Unique>
[src]
impl Instanciable for Image
[src]
impl SubClass<Object> for Image
[src]
impl SubClass<Reference> for Image
[src]
impl SubClass<Resource> for Image
[src]
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
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,
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<T> SubClass<T> for T where
T: GodotObject,
[src]
T: GodotObject,
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.
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>,