reorder blit method enums in a different and still arbitrary order

This commit is contained in:
Gered 2023-03-26 12:37:54 -04:00
parent b38a4b55bc
commit 0345571851
2 changed files with 62 additions and 62 deletions

View file

@ -10,14 +10,35 @@ use crate::math::rect::Rect;
pub enum IndexedBlitMethod {
/// Solid blit, no transparency or other per-pixel adjustments.
Solid,
SolidBlended {
blend_map: Rc<BlendMap>,
},
/// Same as [IndexedBlitMethod::Solid] but the drawn image can also be flipped horizontally
/// and/or vertically.
SolidFlipped {
horizontal_flip: bool,
vertical_flip: bool,
},
SolidFlippedBlended {
horizontal_flip: bool,
vertical_flip: bool,
blend_map: Rc<BlendMap>,
},
/// Same as [IndexedBlitMethod::Solid] except that the drawn pixels have their color indices offset
/// by the amount given.
SolidOffset(u8),
/// Combination of [IndexedBlitMethod::SolidFlipped] and [IndexedBlitMethod::SolidOffset].
SolidFlippedOffset {
horizontal_flip: bool,
vertical_flip: bool,
offset: u8,
},
/// Transparent blit, the specified source color pixels are skipped.
Transparent(u8),
TransparentBlended {
transparent_color: u8,
blend_map: Rc<BlendMap>,
},
/// Same as [IndexedBlitMethod::Transparent] but the drawn image can also be flipped horizontally
/// and/or vertically.
TransparentFlipped {
@ -25,6 +46,12 @@ pub enum IndexedBlitMethod {
horizontal_flip: bool,
vertical_flip: bool,
},
TransparentFlippedBlended {
transparent_color: u8,
horizontal_flip: bool,
vertical_flip: bool,
blend_map: Rc<BlendMap>,
},
/// Same as [IndexedBlitMethod::Transparent] except that the visible pixels on the destination are all
/// drawn using the same color.
TransparentSingle {
@ -38,15 +65,6 @@ pub enum IndexedBlitMethod {
vertical_flip: bool,
draw_color: u8,
},
/// Same as [IndexedBlitMethod::Solid] except that the drawn pixels have their color indices offset
/// by the amount given.
SolidOffset(u8),
/// Combination of [IndexedBlitMethod::SolidFlipped] and [IndexedBlitMethod::SolidOffset].
SolidFlippedOffset {
horizontal_flip: bool,
vertical_flip: bool,
offset: u8,
},
/// Same as [IndexedBlitMethod::Transparent] except that the drawn pixels have their color indices
/// offset by the amount given. The transparent color check is not affected by the offset and
/// is always treated as an absolute palette color index.
@ -65,6 +83,12 @@ pub enum IndexedBlitMethod {
scale_x: f32,
scale_y: f32,
},
RotoZoomBlended {
angle: f32,
scale_x: f32,
scale_y: f32,
blend_map: Rc<BlendMap>,
},
/// Same as [IndexedBlitMethod::RotoZoom] except that the specified source color pixels are skipped.
RotoZoomTransparent {
angle: f32,
@ -72,6 +96,13 @@ pub enum IndexedBlitMethod {
scale_y: f32,
transparent_color: u8,
},
RotoZoomTransparentBlended {
angle: f32,
scale_x: f32,
scale_y: f32,
transparent_color: u8,
blend_map: Rc<BlendMap>,
},
/// Same as [IndexedBlitMethod::RotoZoom] except that the drawn pixels have their color indices
/// offset by the amount given.
RotoZoomOffset {
@ -90,37 +121,6 @@ pub enum IndexedBlitMethod {
transparent_color: u8,
offset: u8,
},
SolidBlended {
blend_map: Rc<BlendMap>,
},
SolidFlippedBlended {
horizontal_flip: bool,
vertical_flip: bool,
blend_map: Rc<BlendMap>,
},
TransparentBlended {
transparent_color: u8,
blend_map: Rc<BlendMap>,
},
TransparentFlippedBlended {
transparent_color: u8,
horizontal_flip: bool,
vertical_flip: bool,
blend_map: Rc<BlendMap>,
},
RotoZoomBlended {
angle: f32,
scale_x: f32,
scale_y: f32,
blend_map: Rc<BlendMap>,
},
RotoZoomTransparentBlended {
angle: f32,
scale_x: f32,
scale_y: f32,
transparent_color: u8,
blend_map: Rc<BlendMap>,
},
}
impl IndexedBitmap {

View file

@ -8,14 +8,24 @@ use crate::math::rect::Rect;
pub enum RgbaBlitMethod {
/// Solid blit, no transparency or other per-pixel adjustments.
Solid,
SolidBlended(BlendFunction),
/// Same as [RgbaBlitMethod::Solid] but the drawn image can also be flipped horizontally
/// and/or vertically.
SolidFlipped {
horizontal_flip: bool,
vertical_flip: bool,
},
SolidFlippedBlended {
horizontal_flip: bool,
vertical_flip: bool,
blend: BlendFunction,
},
/// Transparent blit, the specified source color pixels are skipped.
Transparent(u32),
TransparentBlended {
transparent_color: u32,
blend: BlendFunction,
},
/// Same as [RgbaBlitMethod::Transparent] but the drawn image can also be flipped horizontally
/// and/or vertically.
TransparentFlipped {
@ -23,6 +33,12 @@ pub enum RgbaBlitMethod {
horizontal_flip: bool,
vertical_flip: bool,
},
TransparentFlippedBlended {
transparent_color: u32,
horizontal_flip: bool,
vertical_flip: bool,
blend: BlendFunction,
},
/// Same as [RgbaBlitMethod::Transparent] except that the visible pixels on the destination are all
/// drawn using the same color.
TransparentSingle {
@ -43,6 +59,12 @@ pub enum RgbaBlitMethod {
scale_x: f32,
scale_y: f32,
},
RotoZoomBlended {
angle: f32,
scale_x: f32,
scale_y: f32,
blend: BlendFunction,
},
/// Same as [RgbaBlitMethod::RotoZoom] except that the specified source color pixels are skipped.
RotoZoomTransparent {
angle: f32,
@ -50,28 +72,6 @@ pub enum RgbaBlitMethod {
scale_y: f32,
transparent_color: u32,
},
SolidBlended(BlendFunction),
SolidFlippedBlended {
horizontal_flip: bool,
vertical_flip: bool,
blend: BlendFunction,
},
TransparentBlended {
transparent_color: u32,
blend: BlendFunction,
},
TransparentFlippedBlended {
transparent_color: u32,
horizontal_flip: bool,
vertical_flip: bool,
blend: BlendFunction,
},
RotoZoomBlended {
angle: f32,
scale_x: f32,
scale_y: f32,
blend: BlendFunction,
},
RotoZoomTransparentBlended {
angle: f32,
scale_x: f32,