extern "C" {
pub fn wlc_pixels_write(format: wlc_pixel_format, geometry: *const Geometry, data: *const c_void);
pub fn wlc_pixels_read(format: wlc_pixel_format,
geometry: *const Geometry,
out_geo: *mut Geometry,
data: *mut c_void);
pub fn wlc_surface_render(surface: uintptr_t, geometry: *const Geometry);
pub fn wlc_output_schedule_render(output: uintptr_t) -> wlc_renderer;
pub fn wlc_surface_flush_frame_callbacks(surface: uintptr_t);
pub fn wlc_output_get_renderer(output: uintptr_t) -> wlc_renderer;
pub fn wlc_surface_get_textures(surface: uintptr_t,
out_textures: *mut uint32_t,
out_format: *mut wlc_surface_format);
pub fn wlc_output_set_gamma(output: uintptr_t,
size: u16,
red: *mut u16,
green: *mut u16,
blue: *mut u16);
pub fn wlc_output_get_gamma_size(output: uintptr_t) -> u16 ;
}
use libc::{c_void, uint32_t, uintptr_t};
use super::types::{Geometry};
pub const BITS_PER_PIXEL: u32 = 32;
#[repr(C)]
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum wlc_pixel_format {
WLC_RGBA8888
}
#[repr(C)]
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum wlc_renderer {
WLC_RENDERER_GLES2,
WLC_NO_RENDERER
}
#[allow(missing_docs)]
#[repr(C)]
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum wlc_surface_format {
SURFACE_RGB,
SURFACE_RGBA,
SURFACE_EGL,
SURFACE_Y_UV,
SURFACE_Y_U_V,
SURFACE_Y_XUXV,
}
pub fn write_pixels(_format: wlc_pixel_format, _geometry: Geometry, _data: &[u8]) {
}
pub fn read_pixels(_format: wlc_pixel_format, _geometry: Geometry) -> ([u8; 9], Vec<u8>) {
unimplemented!()
}
pub fn calculate_stride(width: u32) -> u32 {
let stride_alignment = ::std::mem::size_of::<u32>() as u32;
((BITS_PER_PIXEL * width + 7 ) / 8 + (stride_alignment - 1)) & (stride_alignment.overflowing_neg().0)
}