wolfrpg_map_parser/command/picture_command/
blending_method.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#[cfg(feature = "serde")]
use serde::Serialize;

#[cfg_attr(feature = "serde", derive(Serialize))]
pub enum BlendingMethod {
    Normal      = 0x00,
    Add         = 0x01,
    Subtract    = 0x02,
    Multiply    = 0x03,
    Same        = 0x0f,
    Unknown
}

impl BlendingMethod {
    pub const fn new(blending_method: u8) -> Self {
        match blending_method {
            0x00 => BlendingMethod::Normal,
            0x01 => BlendingMethod::Add,
            0x02 => BlendingMethod::Subtract,
            0x03 => BlendingMethod::Multiply,
            0x0f => BlendingMethod::Same,
            _ => BlendingMethod::Unknown
        }
    }
}