doodle.algebra.LoadBitmapConvenience
Convenience methods for LoadBitmap that provide synchronous, unsafe operations.
These are convenience methods for cases where:
- You don't want to deal with IO ceremony
- You're in a context where throwing exceptions is acceptable
- You need simple fallback behavior for errors
Note: The actual implementation is platform-specific due to differences in how IO is executed synchronously or asynchronously on JVM vs JS.
Members list
Load a bitmap synchronously, returning a default value on any error.
Load a bitmap synchronously, returning a default value on any error.
This is safer than loadUnsafe as it won't throw exceptions. Useful when you have a reasonable fallback image.
Value parameters
-
default
-
the bitmap to return if loading fails (evaluated lazily)
-
loader
-
implicit LoadBitmap instance for the types
-
specifier
-
the location/identifier of the bitmap
Attributes
-
Returns
-
the loaded bitmap or the default
-
Source
-
LoadBitmapConvenience.scala
Load a bitmap synchronously with partial error recovery.
Load a bitmap synchronously with partial error recovery.
Allows handling specific error cases while letting others propagate. Useful when different errors require different fallback strategies.
Value parameters
-
loader
-
implicit LoadBitmap instance for the types
-
recover
-
partial function to handle specific BitmapError cases
-
specifier
-
the location/identifier of the bitmap
Attributes
-
Returns
-
the loaded bitmap or recovery result
-
Throws
-
Throwable
if the error is not handled by recover
-
Source
-
LoadBitmapConvenience.scala
Load a bitmap synchronously, throwing any errors that occur.
Load a bitmap synchronously, throwing any errors that occur.
This is the simplest but most dangerous way to load a bitmap. Use when you're certain the bitmap exists and is valid.
Value parameters
-
loader
-
implicit LoadBitmap instance for the types
-
specifier
-
the location/identifier of the bitmap
Attributes
-
Returns
-
the loaded bitmap
-
Throws
-
-
Source
-
LoadBitmapConvenience.scala