#[repr(C, align(4))]pub struct BrightnessOverlay {
pub tag: u32,
pub draw_mode: u32,
pub color_command: u32,
pub origin: u32,
pub size: u32,
}Expand description
The overlay packet: a draw-mode word and one semi-transparent grey rectangle (GP0 62h) covering the frame, as one linked-list node.
Link it into slot 0 of the frame’s ordering table before anything else is inserted there. An insert prepends and slot 0 is walked last, so the first node in is the last drawn, and the overlay then lifts or dims the HUD and menus along with the scene. The draw area and offset must cover the whole frame when it runs (a split screen widens them first); its rectangle starts at the draw offset’s origin.
It leaves GP0(E1h) set to its own semi-transparent mode with dithering off, as the last node of a frame; the next frame’s first packets set their own draw mode.
use psx_display::Brightness;
use psx_gpu::display::Resolution;
let overlay = Brightness::new(-2).overlay(Resolution::R320X240).unwrap();
assert_eq!(overlay.color_command & 0x00FF_FFFF, 16 * 0x0001_0101);
assert!(Brightness::DEFAULT.overlay(Resolution::R320X240).is_none());Fields§
§tag: u32OT linkage.
draw_mode: u32GP0(E1h) draw mode selecting B + F (brighter) or B - F (darker).
color_command: u32Semi-transparent flat rectangle opcode and the grey, 0x62gggggg.
origin: u32Top-left corner, relative to the draw offset.
size: u32Width and height.
Implementations§
Source§impl BrightnessOverlay
impl BrightnessOverlay
Sourcepub const fn new(brightness: Brightness, resolution: Resolution) -> Self
pub const fn new(brightness: Brightness, resolution: Resolution) -> Self
The overlay for brightness over a resolution frame. At
Brightness::DEFAULT the gain is zero and the packet changes
nothing, but prefer Brightness::overlay, which gives no packet.
Trait Implementations§
Source§impl Clone for BrightnessOverlay
impl Clone for BrightnessOverlay
Source§fn clone(&self) -> BrightnessOverlay
fn clone(&self) -> BrightnessOverlay
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BrightnessOverlay
impl Debug for BrightnessOverlay
Source§impl GpuPacket for BrightnessOverlay
impl GpuPacket for BrightnessOverlay
Source§impl Hash for BrightnessOverlay
impl Hash for BrightnessOverlay
Source§impl PartialEq for BrightnessOverlay
impl PartialEq for BrightnessOverlay
impl Copy for BrightnessOverlay
impl Eq for BrightnessOverlay
impl StructuralPartialEq for BrightnessOverlay
Auto Trait Implementations§
impl Freeze for BrightnessOverlay
impl RefUnwindSafe for BrightnessOverlay
impl Send for BrightnessOverlay
impl Sync for BrightnessOverlay
impl Unpin for BrightnessOverlay
impl UnsafeUnpin for BrightnessOverlay
impl UnwindSafe for BrightnessOverlay
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)