Struct libremarkable::fb::Framebuffer
[−]
[src]
pub struct Framebuffer<'a> { pub device: File, pub frame: MemoryMap, pub marker: AtomicU32, pub default_font: Font<'a>, pub var_screen_info: VarScreeninfo, pub fix_screen_info: FixScreeninfo, }
Framebuffer struct containing the state (latest update marker etc.) along with the var/fix screeninfo structs.
Fields
device: File
frame: MemoryMap
marker: AtomicU32
default_font: Font<'a>
var_screen_info: VarScreeninfo
fix_screen_info: FixScreeninfo
Trait Implementations
impl<'a> Send for Framebuffer<'a>
[src]
impl<'a> Sync for Framebuffer<'a>
[src]
impl<'a> FramebufferBase<'a> for Framebuffer<'a>
[src]
fn new(path_to_device: &str) -> Framebuffer
[src]
Creates a new instance of Framebuffer
fn set_epdc_access(&mut self, state: bool)
[src]
Toggles the EPD Controller (see https://wiki.mobileread.com/wiki/EPD_controller)
fn set_autoupdate_mode(&mut self, mode: u32)
[src]
Toggles autoupdate mode
fn set_update_scheme(&mut self, scheme: u32)
[src]
Toggles update scheme
fn get_fix_screeninfo(device: &File) -> FixScreeninfo
[src]
Creates a FixScreeninfo struct and fills it using ioctl
fn get_var_screeninfo(device: &File) -> VarScreeninfo
[src]
Creates a VarScreeninfo struct and fills it using ioctl
fn put_var_screeninfo(&mut self) -> bool
[src]
Makes the proper ioctl call to set the VarScreenInfo. You must first update the contents of self.var_screen_info and then call this function.
impl<'a> FramebufferIO for Framebuffer<'a>
[src]
fn write_frame(&mut self, frame: &[u8])
[src]
Writes an arbitrary length frame into the framebuffer
fn write_pixel(&mut self, y: usize, x: usize, v: u8)
[src]
Writes a single pixel at (y, x)
with value v
fn read_pixel(&mut self, y: usize, x: usize) -> u8
[src]
Reads the value of the pixel at (y, x)
fn read_offset(&mut self, ofst: isize) -> u8
[src]
Reads the value at offset ofst
from the mmapp'ed framebuffer region
impl<'a> FramebufferDraw for Framebuffer<'a>
[src]
fn draw_image(
&mut self,
img: &DynamicImage,
top: usize,
left: usize
) -> mxcfb_rect
[src]
&mut self,
img: &DynamicImage,
top: usize,
left: usize
) -> mxcfb_rect
Draws img
at y=top, x=left coordinates with 1:1 scaling
fn draw_line(
&mut self,
y0: i32,
x0: i32,
y1: i32,
x1: i32,
width: usize,
color: u8
) -> mxcfb_rect
[src]
&mut self,
y0: i32,
x0: i32,
y1: i32,
x1: i32,
width: usize,
color: u8
) -> mxcfb_rect
Draws a straight line
fn draw_circle(
&mut self,
y: usize,
x: usize,
rad: usize,
color: u8
) -> mxcfb_rect
[src]
&mut self,
y: usize,
x: usize,
rad: usize,
color: u8
) -> mxcfb_rect
Draws a circle using Bresenham circle algorithm
fn fill_circle(
&mut self,
y: usize,
x: usize,
rad: usize,
color: u8
) -> mxcfb_rect
[src]
&mut self,
y: usize,
x: usize,
rad: usize,
color: u8
) -> mxcfb_rect
Fills a circle
fn draw_bezier(
&mut self,
startpt: (f32, f32),
ctrlpt: (f32, f32),
endpt: (f32, f32),
color: u8
) -> mxcfb_rect
[src]
&mut self,
startpt: (f32, f32),
ctrlpt: (f32, f32),
endpt: (f32, f32),
color: u8
) -> mxcfb_rect
Draws a bezier curve begining at startpt
, with control point ctrlpt
, ending at endpt
with color
fn draw_text(
&mut self,
y: usize,
x: usize,
text: String,
size: usize,
color: u8
) -> mxcfb_rect
[src]
&mut self,
y: usize,
x: usize,
text: String,
size: usize,
color: u8
) -> mxcfb_rect
Draws text
at (y, x)
with color
using scale
fn fill_rect(
&mut self,
y: usize,
x: usize,
height: usize,
width: usize,
color: u8
)
[src]
&mut self,
y: usize,
x: usize,
height: usize,
width: usize,
color: u8
)
Fills rectangle of height
and width
at (y, x)
fn clear(&mut self)
[src]
Clears the framebuffer however does not perform a refresh
impl<'a> FramebufferRefresh for Framebuffer<'a>
[src]
fn refresh(
&mut self,
region: &mxcfb_rect,
update_mode: update_mode,
waveform_mode: waveform_mode,
temperature: display_temp,
dither_mode: dither_mode,
quant_bit: i32,
flags: u32
) -> u32
[src]
&mut self,
region: &mxcfb_rect,
update_mode: update_mode,
waveform_mode: waveform_mode,
temperature: display_temp,
dither_mode: dither_mode,
quant_bit: i32,
flags: u32
) -> u32
-
PxP must process 8x8 pixel blocks, and all pixels in each block are considered for auto-waveform mode selection. If the update region is not 8x8 aligned, additional unwanted pixels will be considered in auto-waveform mode selection.
-
PxP input must be 32-bit aligned, so any update address not 32-bit aligned must be shifted to meet the 32-bit alignment. The PxP will thus end up processing pixels outside of the update region to satisfy this alignment restriction, which can affect auto-waveform mode selection.
-
If input fails 32-bit alignment, and the resulting expansion of the processed region would add at least 8 pixels more per line than the original update line width, the EPDC would cause screen artifacts by incorrectly handling the 8+ pixels at the end of each line.