pub struct JPEGImage { /* private fields */ }Expand description
JPEG path wrapper from cotis-defaults.
JPEG image path wrapper.
Implementations§
Source§impl JPEGImage
impl JPEGImage
Sourcepub fn new(path: &str) -> Result<JPEGImage, CotisImageError>
pub fn new(path: &str) -> Result<JPEGImage, CotisImageError>
Creates a JPEG image from a relative path.
§Errors
Returns:
CotisImageError::EmptyPathwhenpathis empty.CotisImageError::NotRelativePathwhenpathstarts with/.
Trait Implementations§
Source§impl GenericCompatibleImage for JPEGImage
impl GenericCompatibleImage for JPEGImage
Source§fn load_texture(&self, _ctx: &mut RaylibDrawContext<'_, '_>)
fn load_texture(&self, _ctx: &mut RaylibDrawContext<'_, '_>)
Called before
Self::get_texture during drawing (no-op for path-based types).Source§fn get_texture(&self, ctx: &RaylibDrawContext<'_, '_>) -> Arc<Texture2D> ⓘ
fn get_texture(&self, ctx: &RaylibDrawContext<'_, '_>) -> Arc<Texture2D> ⓘ
Returns the texture to draw. Path-based types read from
RaylibDrawContext::image_cache. Read moreSource§impl RaylibLoadableImage for JPEGImage
impl RaylibLoadableImage for JPEGImage
Source§fn get_filename(&self) -> &str
fn get_filename(&self) -> &str
Filesystem path used as the cache key and passed to raylib’s texture loader.
Auto Trait Implementations§
impl Freeze for JPEGImage
impl RefUnwindSafe for JPEGImage
impl Send for JPEGImage
impl Sync for JPEGImage
impl Unpin for JPEGImage
impl UnsafeUnpin for JPEGImage
impl UnwindSafe for JPEGImage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Sourcewhere
TailTarget: IsRenderList,
Source: Embed<TailTarget, Idx>,
impl<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Sourcewhere
TailTarget: IsRenderList,
Source: Embed<TailTarget, Idx>,
Source§fn embed(self) -> RenderTList<H, TailTarget>
fn embed(self) -> RenderTList<H, TailTarget>
Converts
self into Target.