pub enum BlendMode {
Opaque,
Average,
Add,
Subtract,
AddQuarter,
}Expand description
PS1 semi-transparency mode.
The four non-opaque variants map directly to GP0(E1) / tpage
bits 5..6. Opaque means the primitive command’s semi-transparent
bit is kept clear, so the destination pixel is overwritten.
Variants§
Opaque
Overwrite destination pixels.
Average
(background + foreground) / 2.
Add
background + foreground, clamped per channel.
Subtract
background - foreground, clamped per channel.
AddQuarter
background + foreground / 4, clamped per channel.
Implementations§
Source§impl BlendMode
impl BlendMode
Sourcepub const fn from_texture_page_bits(bits: u8) -> Self
pub const fn from_texture_page_bits(bits: u8) -> Self
Decode the two tpage semi-transparency bits.
Hardware tpage bits do not encode “opaque”; the primitive opcode decides whether blending is active. This therefore returns one of the four blending variants.
Sourcepub const fn from_tpage_bits(bits: u8) -> Self
👎Deprecated: renamed to from_texture_page_bits
pub const fn from_tpage_bits(bits: u8) -> Self
renamed to from_texture_page_bits
Renamed to from_texture_page_bits.
Sourcepub const fn texture_page_bits(self) -> u8
pub const fn texture_page_bits(self) -> u8
Encode as GP0(E1) / tpage bits 5..6.
Opaque uses the common average-blend encoding because the
primitive semi-transparent bit will be clear.
Sourcepub const fn is_translucent(self) -> bool
pub const fn is_translucent(self) -> bool
True when a primitive using this material should set its semi-transparent command bit.
Trait Implementations§
impl Copy for BlendMode
impl Eq for BlendMode
impl StructuralPartialEq for BlendMode
Auto Trait Implementations§
impl Freeze for BlendMode
impl RefUnwindSafe for BlendMode
impl Send for BlendMode
impl Sync for BlendMode
impl Unpin for BlendMode
impl UnsafeUnpin for BlendMode
impl UnwindSafe for BlendMode
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)