pub enum BitmapFormat {
Show 16 variants
Gif,
Pcx,
LbmIff,
Tga,
Fli,
Flc,
Bmp,
Gl,
Dl,
Wpg,
Png,
Jpg,
Mpg,
Avi,
RipScript,
Unknown(SauceDataType, u8),
}Expand description
Graphics format types supported by the SAUCE v00 specification.
BitmapFormat enumerates all bitmap, vector, and special graphics formats
that can be stored with SAUCE metadata. Formats are organized by data type:
§Bitmap Formats (DataType::Bitmap)
Raster image and video formats with pixel dimensions (values 0-13):
- Gif (0): Graphics Interchange Format
- Pcx (1): ZSoft Paintbrush
- LbmIff (2): Deluxe Paint (Amiga IFF/ILBM)
- Tga (3): Truevision TARGA
- Fli (4): Autodesk Animator
- Flc (5): Autodesk Animator Pro
- Bmp (6): Windows Bitmap
- Gl (7): GRASP animation format
- Dl (8): DL animation format
- Wpg (9): WordPerfect Graphics
- Png (10): Portable Network Graphics
- Jpg (11): JPEG Image Format
- Mpg (12): MPEG video
- Avi (13): Audio Video Interleave
§Vector Formats (DataType::Vector)
Scalable graphics formats without pixel dimensions (values 0-3):
- Dxf (0): AutoCAD Drawing Exchange Format
- Dwg (1): AutoCAD Drawing Format
- WpgVector (2): WordPerfect Graphics (vector)
- ThreeDs (3): Autodesk 3D Studio
§Special Format
- RipScript: Remote Imaging Protocol (Character DataType with FileType=3)
- Fixed 640x350 pixel dimensions
- 16-color display
§Unknown Variants
- Unknown: Preserves unrecognized (DataType, FileType) pairs for forward compatibility
§Example
use icy_sauce::BitmapFormat;
use icy_sauce::SauceDataType;
let fmt = BitmapFormat::from_sauce(SauceDataType::Bitmap, 10);
assert_eq!(fmt, BitmapFormat::Png);
let (dt, ft) = fmt.to_sauce();
assert_eq!(ft, 10);Variants§
Gif
GIF (Graphics Interchange Format)
Pcx
PCX (ZSoft Paintbrush)
LbmIff
LBM/IFF (Deluxe Paint - Amiga format)
Tga
TGA (Truevision TARGA)
Fli
FLI (Autodesk Animator)
Flc
FLC (Autodesk Animator Pro)
Bmp
BMP (Windows Bitmap)
Gl
GL (GRASP animation)
Dl
DL (DL animation)
Wpg
WPG (WordPerfect Graphics)
Png
PNG (Portable Network Graphics)
Jpg
JPG (JPEG Image Format)
Mpg
MPEG (Motion Picture Experts Group video)
Avi
AVI (Audio Video Interleave)
RipScript
RIPScript (Remote Imaging Protocol) - special character-based format
Unknown(SauceDataType, u8)
Unknown format (preserves original DataType and FileType for forward compatibility)
Implementations§
Source§impl BitmapFormat
impl BitmapFormat
Sourcepub fn from_sauce(data_type: SauceDataType, file_type: u8) -> Self
pub fn from_sauce(data_type: SauceDataType, file_type: u8) -> Self
Parse a graphics format from SAUCE data type and file type bytes.
§Arguments
data_type- The SAUCE DataType fieldfile_type- The SAUCE FileType field
§Returns
The corresponding BitmapFormat, or BitmapFormat::Unknown if the
combination is not recognized.
§Special Cases
- RIPScript: DataType=Character with FileType=3
- Bitmap formats: DataType=Bitmap with FileType 0-13
- Vector formats: DataType=Vector with FileType 0-3
§Example
use icy_sauce::BitmapFormat;
use icy_sauce::SauceDataType;
let fmt = BitmapFormat::from_sauce(SauceDataType::Bitmap, 6);
assert_eq!(fmt, BitmapFormat::Bmp);Sourcepub fn to_sauce(&self) -> (SauceDataType, u8)
pub fn to_sauce(&self) -> (SauceDataType, u8)
Trait Implementations§
Source§impl Clone for BitmapFormat
impl Clone for BitmapFormat
Source§fn clone(&self) -> BitmapFormat
fn clone(&self) -> BitmapFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more