use
super::*;
#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage, Align>
where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
storage: Storage,
align: [Align; 0],
}
impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align>
where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
pub fn new(storage: Storage) -> Self {
Self { storage, align: [] }
}
#[inline]
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = self.storage.as_ref()[byte_index];
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
index % 8
};
let mask = 1 << bit_index;
byte & mask == mask
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
index % 8
};
let mask = 1 << bit_index;
if val {
*byte |= mask;
} else {
*byte &= !mask;
}
}
#[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
let mut val = 0;
for i in 0..(bit_width as usize) {
if self.get_bit(i + bit_offset) {
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
val |= 1 << index;
}
}
val
}
#[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
self.set_bit(index + bit_offset, val_bit_is_set);
}
}
}
pub const LV_IMG_CF_INDEXED: u32 = 1;
pub const LV_IMG_CF_ALPHA: u32 = 1;
pub const LV_IMG_CACHE_DEF_SIZE: u32 = 1;
pub const LV_IMGBTN_TILED: u32 = 0;
pub const LV_IMG_PX_SIZE_ALPHA_BYTE: u32 = 3;
pub const LV_IMG_ZOOM_NONE: u32 = 256;
pub type lv_coord_t = i16;
pub type lv_img_decoder_user_data_t = *mut ::cty::c_void;
pub type lv_obj_user_data_t = *mut ::cty::c_void;
pub type lv_res_t = u8;
#[doc = " Represents a point on the screen."]
#[repr(C)]
#[derive(Default, Copy, Clone)]
pub struct lv_point_t {
pub x: lv_coord_t,
pub y: lv_coord_t,
}
#[doc = " Represents an area of the screen."]
#[repr(C)]
#[derive(Default, Copy, Clone)]
pub struct lv_area_t {
pub x1: lv_coord_t,
pub y1: lv_coord_t,
pub x2: lv_coord_t,
pub y2: lv_coord_t,
}
pub type lv_align_t = u8;
#[repr(C)]
#[derive(Copy, Clone)]
pub union lv_color16_t {
pub ch: lv_color16_t__bindgen_ty_1,
pub full: u16,
_bindgen_union_align: u16,
}
#[repr(C)]
#[repr(align(2))]
#[derive(Default, Copy, Clone)]
pub struct lv_color16_t__bindgen_ty_1 {
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u8>,
}
impl lv_color16_t__bindgen_ty_1 {
#[inline]
pub fn green_h(&self) -> u16 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u16) }
}
#[inline]
pub fn set_green_h(&mut self, val: u16) {
unsafe {
let val: u16 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 3u8, val as u64)
}
}
#[inline]
pub fn red(&self) -> u16 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 5u8) as u16) }
}
#[inline]
pub fn set_red(&mut self, val: u16) {
unsafe {
let val: u16 = ::core::mem::transmute(val);
self._bitfield_1.set(3usize, 5u8, val as u64)
}
}
#[inline]
pub fn blue(&self) -> u16 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 5u8) as u16) }
}
#[inline]
pub fn set_blue(&mut self, val: u16) {
unsafe {
let val: u16 = ::core::mem::transmute(val);
self._bitfield_1.set(8usize, 5u8, val as u64)
}
}
#[inline]
pub fn green_l(&self) -> u16 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 3u8) as u16) }
}
#[inline]
pub fn set_green_l(&mut self, val: u16) {
unsafe {
let val: u16 = ::core::mem::transmute(val);
self._bitfield_1.set(13usize, 3u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
green_h: u16,
red: u16,
blue: u16,
green_l: u16,
) -> __BindgenBitfieldUnit<[u8; 2usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 3u8, {
let green_h: u16 = unsafe { ::core::mem::transmute(green_h) };
green_h as u64
});
__bindgen_bitfield_unit.set(3usize, 5u8, {
let red: u16 = unsafe { ::core::mem::transmute(red) };
red as u64
});
__bindgen_bitfield_unit.set(8usize, 5u8, {
let blue: u16 = unsafe { ::core::mem::transmute(blue) };
blue as u64
});
__bindgen_bitfield_unit.set(13usize, 3u8, {
let green_l: u16 = unsafe { ::core::mem::transmute(green_l) };
green_l as u64
});
__bindgen_bitfield_unit
}
}
impl Default for lv_color16_t {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
pub type lv_color_t = lv_color16_t;
#[doc = "! @cond Doxygen_Suppress"]
pub type lv_opa_t = u8;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_style_list_t {
pub style_list: *mut *mut lv_style_t,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>,
pub __bindgen_padding_0: u32,
}
impl Default for lv_style_list_t {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl lv_style_list_t {
#[inline]
pub fn style_cnt(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 6u8) as u32) }
}
#[inline]
pub fn set_style_cnt(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 6u8, val as u64)
}
}
#[inline]
pub fn has_local(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) }
}
#[inline]
pub fn set_has_local(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(6usize, 1u8, val as u64)
}
}
#[inline]
pub fn has_trans(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) }
}
#[inline]
pub fn set_has_trans(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(7usize, 1u8, val as u64)
}
}
#[inline]
pub fn skip_trans(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) }
}
#[inline]
pub fn set_skip_trans(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(8usize, 1u8, val as u64)
}
}
#[inline]
pub fn ignore_trans(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) }
}
#[inline]
pub fn set_ignore_trans(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(9usize, 1u8, val as u64)
}
}
#[inline]
pub fn valid_cache(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u32) }
}
#[inline]
pub fn set_valid_cache(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(10usize, 1u8, val as u64)
}
}
#[inline]
pub fn ignore_cache(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u32) }
}
#[inline]
pub fn set_ignore_cache(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(11usize, 1u8, val as u64)
}
}
#[inline]
pub fn radius_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u32) }
}
#[inline]
pub fn set_radius_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(12usize, 1u8, val as u64)
}
}
#[inline]
pub fn opa_scale_cover(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u32) }
}
#[inline]
pub fn set_opa_scale_cover(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(13usize, 1u8, val as u64)
}
}
#[inline]
pub fn clip_corner_off(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u32) }
}
#[inline]
pub fn set_clip_corner_off(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(14usize, 1u8, val as u64)
}
}
#[inline]
pub fn transform_all_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u32) }
}
#[inline]
pub fn set_transform_all_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(15usize, 1u8, val as u64)
}
}
#[inline]
pub fn pad_all_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u32) }
}
#[inline]
pub fn set_pad_all_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(16usize, 1u8, val as u64)
}
}
#[inline]
pub fn blend_mode_all_normal(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u32) }
}
#[inline]
pub fn set_blend_mode_all_normal(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(17usize, 1u8, val as u64)
}
}
#[inline]
pub fn bg_opa_transp(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u32) }
}
#[inline]
pub fn set_bg_opa_transp(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(18usize, 1u8, val as u64)
}
}
#[inline]
pub fn bg_opa_cover(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u32) }
}
#[inline]
pub fn set_bg_opa_cover(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(19usize, 1u8, val as u64)
}
}
#[inline]
pub fn bg_grad_dir_none(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u32) }
}
#[inline]
pub fn set_bg_grad_dir_none(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(20usize, 1u8, val as u64)
}
}
#[inline]
pub fn border_width_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u32) }
}
#[inline]
pub fn set_border_width_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(21usize, 1u8, val as u64)
}
}
#[inline]
pub fn border_side_full(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u32) }
}
#[inline]
pub fn set_border_side_full(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(22usize, 1u8, val as u64)
}
}
#[inline]
pub fn border_post_off(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u32) }
}
#[inline]
pub fn set_border_post_off(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(23usize, 1u8, val as u64)
}
}
#[inline]
pub fn outline_width_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u32) }
}
#[inline]
pub fn set_outline_width_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(24usize, 1u8, val as u64)
}
}
#[inline]
pub fn pattern_img_null(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u32) }
}
#[inline]
pub fn set_pattern_img_null(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(25usize, 1u8, val as u64)
}
}
#[inline]
pub fn shadow_width_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u32) }
}
#[inline]
pub fn set_shadow_width_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(26usize, 1u8, val as u64)
}
}
#[inline]
pub fn value_txt_str(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u32) }
}
#[inline]
pub fn set_value_txt_str(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(27usize, 1u8, val as u64)
}
}
#[inline]
pub fn img_recolor_opa_transp(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(28usize, 1u8) as u32) }
}
#[inline]
pub fn set_img_recolor_opa_transp(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(28usize, 1u8, val as u64)
}
}
#[inline]
pub fn text_space_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(29usize, 1u8) as u32) }
}
#[inline]
pub fn set_text_space_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(29usize, 1u8, val as u64)
}
}
#[inline]
pub fn text_decor_none(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(30usize, 1u8) as u32) }
}
#[inline]
pub fn set_text_decor_none(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(30usize, 1u8, val as u64)
}
}
#[inline]
pub fn text_font_normal(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) }
}
#[inline]
pub fn set_text_font_normal(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(31usize, 1u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
style_cnt: u32,
has_local: u32,
has_trans: u32,
skip_trans: u32,
ignore_trans: u32,
valid_cache: u32,
ignore_cache: u32,
radius_zero: u32,
opa_scale_cover: u32,
clip_corner_off: u32,
transform_all_zero: u32,
pad_all_zero: u32,
blend_mode_all_normal: u32,
bg_opa_transp: u32,
bg_opa_cover: u32,
bg_grad_dir_none: u32,
border_width_zero: u32,
border_side_full: u32,
border_post_off: u32,
outline_width_zero: u32,
pattern_img_null: u32,
shadow_width_zero: u32,
value_txt_str: u32,
img_recolor_opa_transp: u32,
text_space_zero: u32,
text_decor_none: u32,
text_font_normal: u32,
) -> __BindgenBitfieldUnit<[u8; 4usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 6u8, {
let style_cnt: u32 = unsafe { ::core::mem::transmute(style_cnt) };
style_cnt as u64
});
__bindgen_bitfield_unit.set(6usize, 1u8, {
let has_local: u32 = unsafe { ::core::mem::transmute(has_local) };
has_local as u64
});
__bindgen_bitfield_unit.set(7usize, 1u8, {
let has_trans: u32 = unsafe { ::core::mem::transmute(has_trans) };
has_trans as u64
});
__bindgen_bitfield_unit.set(8usize, 1u8, {
let skip_trans: u32 = unsafe { ::core::mem::transmute(skip_trans) };
skip_trans as u64
});
__bindgen_bitfield_unit.set(9usize, 1u8, {
let ignore_trans: u32 = unsafe { ::core::mem::transmute(ignore_trans) };
ignore_trans as u64
});
__bindgen_bitfield_unit.set(10usize, 1u8, {
let valid_cache: u32 = unsafe { ::core::mem::transmute(valid_cache) };
valid_cache as u64
});
__bindgen_bitfield_unit.set(11usize, 1u8, {
let ignore_cache: u32 = unsafe { ::core::mem::transmute(ignore_cache) };
ignore_cache as u64
});
__bindgen_bitfield_unit.set(12usize, 1u8, {
let radius_zero: u32 = unsafe { ::core::mem::transmute(radius_zero) };
radius_zero as u64
});
__bindgen_bitfield_unit.set(13usize, 1u8, {
let opa_scale_cover: u32 = unsafe { ::core::mem::transmute(opa_scale_cover) };
opa_scale_cover as u64
});
__bindgen_bitfield_unit.set(14usize, 1u8, {
let clip_corner_off: u32 = unsafe { ::core::mem::transmute(clip_corner_off) };
clip_corner_off as u64
});
__bindgen_bitfield_unit.set(15usize, 1u8, {
let transform_all_zero: u32 = unsafe { ::core::mem::transmute(transform_all_zero) };
transform_all_zero as u64
});
__bindgen_bitfield_unit.set(16usize, 1u8, {
let pad_all_zero: u32 = unsafe { ::core::mem::transmute(pad_all_zero) };
pad_all_zero as u64
});
__bindgen_bitfield_unit.set(17usize, 1u8, {
let blend_mode_all_normal: u32 =
unsafe { ::core::mem::transmute(blend_mode_all_normal) };
blend_mode_all_normal as u64
});
__bindgen_bitfield_unit.set(18usize, 1u8, {
let bg_opa_transp: u32 = unsafe { ::core::mem::transmute(bg_opa_transp) };
bg_opa_transp as u64
});
__bindgen_bitfield_unit.set(19usize, 1u8, {
let bg_opa_cover: u32 = unsafe { ::core::mem::transmute(bg_opa_cover) };
bg_opa_cover as u64
});
__bindgen_bitfield_unit.set(20usize, 1u8, {
let bg_grad_dir_none: u32 = unsafe { ::core::mem::transmute(bg_grad_dir_none) };
bg_grad_dir_none as u64
});
__bindgen_bitfield_unit.set(21usize, 1u8, {
let border_width_zero: u32 = unsafe { ::core::mem::transmute(border_width_zero) };
border_width_zero as u64
});
__bindgen_bitfield_unit.set(22usize, 1u8, {
let border_side_full: u32 = unsafe { ::core::mem::transmute(border_side_full) };
border_side_full as u64
});
__bindgen_bitfield_unit.set(23usize, 1u8, {
let border_post_off: u32 = unsafe { ::core::mem::transmute(border_post_off) };
border_post_off as u64
});
__bindgen_bitfield_unit.set(24usize, 1u8, {
let outline_width_zero: u32 = unsafe { ::core::mem::transmute(outline_width_zero) };
outline_width_zero as u64
});
__bindgen_bitfield_unit.set(25usize, 1u8, {
let pattern_img_null: u32 = unsafe { ::core::mem::transmute(pattern_img_null) };
pattern_img_null as u64
});
__bindgen_bitfield_unit.set(26usize, 1u8, {
let shadow_width_zero: u32 = unsafe { ::core::mem::transmute(shadow_width_zero) };
shadow_width_zero as u64
});
__bindgen_bitfield_unit.set(27usize, 1u8, {
let value_txt_str: u32 = unsafe { ::core::mem::transmute(value_txt_str) };
value_txt_str as u64
});
__bindgen_bitfield_unit.set(28usize, 1u8, {
let img_recolor_opa_transp: u32 =
unsafe { ::core::mem::transmute(img_recolor_opa_transp) };
img_recolor_opa_transp as u64
});
__bindgen_bitfield_unit.set(29usize, 1u8, {
let text_space_zero: u32 = unsafe { ::core::mem::transmute(text_space_zero) };
text_space_zero as u64
});
__bindgen_bitfield_unit.set(30usize, 1u8, {
let text_decor_none: u32 = unsafe { ::core::mem::transmute(text_decor_none) };
text_decor_none as u64
});
__bindgen_bitfield_unit.set(31usize, 1u8, {
let text_font_normal: u32 = unsafe { ::core::mem::transmute(text_font_normal) };
text_font_normal as u64
});
__bindgen_bitfield_unit
}
}
#[doc = " Dummy type to make handling easier"]
pub type lv_ll_node_t = u8;
#[doc = " Description of a linked list"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_ll_t {
pub n_size: u32,
pub head: *mut lv_ll_node_t,
pub tail: *mut lv_ll_node_t,
}
impl Default for lv_ll_t {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
pub type lv_drag_dir_t = u8;
pub type lv_bidi_dir_t = u8;
pub const LV_IMG_CF_UNKNOWN: _bindgen_ty_23 = 0;
#[doc = "< Contains the file as it is. Needs custom decoder function"]
pub const LV_IMG_CF_RAW: _bindgen_ty_23 = 1;
#[doc = "< Contains the file as it is. The image has alpha. Needs custom decoder"]
#[doc = "function"]
pub const LV_IMG_CF_RAW_ALPHA: _bindgen_ty_23 = 2;
#[doc = "< Contains the file as it is. The image is chroma keyed. Needs"]
#[doc = "custom decoder function"]
pub const LV_IMG_CF_RAW_CHROMA_KEYED: _bindgen_ty_23 = 3;
#[doc = "< Color format and depth should match with LV_COLOR settings"]
pub const LV_IMG_CF_TRUE_COLOR: _bindgen_ty_23 = 4;
#[doc = "< Same as `LV_IMG_CF_TRUE_COLOR` but every pixel has an alpha byte"]
pub const LV_IMG_CF_TRUE_COLOR_ALPHA: _bindgen_ty_23 = 5;
#[doc = "< Same as `LV_IMG_CF_TRUE_COLOR` but LV_COLOR_TRANSP pixels"]
#[doc = "will be transparent"]
pub const LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED: _bindgen_ty_23 = 6;
#[doc = "< Can have 2 different colors in a palette (always chroma keyed)"]
pub const LV_IMG_CF_INDEXED_1BIT: _bindgen_ty_23 = 7;
#[doc = "< Can have 4 different colors in a palette (always chroma keyed)"]
pub const LV_IMG_CF_INDEXED_2BIT: _bindgen_ty_23 = 8;
#[doc = "< Can have 16 different colors in a palette (always chroma keyed)"]
pub const LV_IMG_CF_INDEXED_4BIT: _bindgen_ty_23 = 9;
#[doc = "< Can have 256 different colors in a palette (always chroma keyed)"]
pub const LV_IMG_CF_INDEXED_8BIT: _bindgen_ty_23 = 10;
#[doc = "< Can have one color and it can be drawn or not"]
pub const LV_IMG_CF_ALPHA_1BIT: _bindgen_ty_23 = 11;
#[doc = "< Can have one color but 4 different alpha value"]
pub const LV_IMG_CF_ALPHA_2BIT: _bindgen_ty_23 = 12;
#[doc = "< Can have one color but 16 different alpha value"]
pub const LV_IMG_CF_ALPHA_4BIT: _bindgen_ty_23 = 13;
#[doc = "< Can have one color but 256 different alpha value"]
pub const LV_IMG_CF_ALPHA_8BIT: _bindgen_ty_23 = 14;
#[doc = "< Reserved for further use."]
pub const LV_IMG_CF_RESERVED_15: _bindgen_ty_23 = 15;
#[doc = "< Reserved for further use."]
pub const LV_IMG_CF_RESERVED_16: _bindgen_ty_23 = 16;
#[doc = "< Reserved for further use."]
pub const LV_IMG_CF_RESERVED_17: _bindgen_ty_23 = 17;
#[doc = "< Reserved for further use."]
pub const LV_IMG_CF_RESERVED_18: _bindgen_ty_23 = 18;
#[doc = "< Reserved for further use."]
pub const LV_IMG_CF_RESERVED_19: _bindgen_ty_23 = 19;
#[doc = "< Reserved for further use."]
pub const LV_IMG_CF_RESERVED_20: _bindgen_ty_23 = 20;
#[doc = "< Reserved for further use."]
pub const LV_IMG_CF_RESERVED_21: _bindgen_ty_23 = 21;
#[doc = "< Reserved for further use."]
pub const LV_IMG_CF_RESERVED_22: _bindgen_ty_23 = 22;
#[doc = "< Reserved for further use."]
pub const LV_IMG_CF_RESERVED_23: _bindgen_ty_23 = 23;
#[doc = "< User holder encoding format."]
pub const LV_IMG_CF_USER_ENCODED_0: _bindgen_ty_23 = 24;
#[doc = "< User holder encoding format."]
pub const LV_IMG_CF_USER_ENCODED_1: _bindgen_ty_23 = 25;
#[doc = "< User holder encoding format."]
pub const LV_IMG_CF_USER_ENCODED_2: _bindgen_ty_23 = 26;
#[doc = "< User holder encoding format."]
pub const LV_IMG_CF_USER_ENCODED_3: _bindgen_ty_23 = 27;
#[doc = "< User holder encoding format."]
pub const LV_IMG_CF_USER_ENCODED_4: _bindgen_ty_23 = 28;
#[doc = "< User holder encoding format."]
pub const LV_IMG_CF_USER_ENCODED_5: _bindgen_ty_23 = 29;
#[doc = "< User holder encoding format."]
pub const LV_IMG_CF_USER_ENCODED_6: _bindgen_ty_23 = 30;
#[doc = "< User holder encoding format."]
pub const LV_IMG_CF_USER_ENCODED_7: _bindgen_ty_23 = 31;
#[doc = " TYPEDEFS"]
pub type _bindgen_ty_23 = u32;
pub type lv_img_cf_t = u8;
#[repr(C)]
#[repr(align(4))]
#[derive(Default, Copy, Clone)]
pub struct lv_img_header_t {
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u16>,
}
impl lv_img_header_t {
#[inline]
pub fn cf(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 5u8) as u32) }
}
#[inline]
pub fn set_cf(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 5u8, val as u64)
}
}
#[inline]
pub fn always_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 3u8) as u32) }
}
#[inline]
pub fn set_always_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(5usize, 3u8, val as u64)
}
}
#[inline]
pub fn reserved(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 2u8) as u32) }
}
#[inline]
pub fn set_reserved(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(8usize, 2u8, val as u64)
}
}
#[inline]
pub fn w(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 11u8) as u32) }
}
#[inline]
pub fn set_w(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(10usize, 11u8, val as u64)
}
}
#[inline]
pub fn h(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(21usize, 11u8) as u32) }
}
#[inline]
pub fn set_h(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(21usize, 11u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
cf: u32,
always_zero: u32,
reserved: u32,
w: u32,
h: u32,
) -> __BindgenBitfieldUnit<[u8; 4usize], u16> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u16> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 5u8, {
let cf: u32 = unsafe { ::core::mem::transmute(cf) };
cf as u64
});
__bindgen_bitfield_unit.set(5usize, 3u8, {
let always_zero: u32 = unsafe { ::core::mem::transmute(always_zero) };
always_zero as u64
});
__bindgen_bitfield_unit.set(8usize, 2u8, {
let reserved: u32 = unsafe { ::core::mem::transmute(reserved) };
reserved as u64
});
__bindgen_bitfield_unit.set(10usize, 11u8, {
let w: u32 = unsafe { ::core::mem::transmute(w) };
w as u64
});
__bindgen_bitfield_unit.set(21usize, 11u8, {
let h: u32 = unsafe { ::core::mem::transmute(h) };
h as u64
});
__bindgen_bitfield_unit
}
}
#[doc = " Image header it is compatible with"]
#[doc = " the result from image converter utility"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_img_dsc_t {
pub header: lv_img_header_t,
pub data_size: u32,
pub data: *const u8,
}
impl Default for lv_img_dsc_t {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_img_transform_dsc_t {
pub cfg: lv_img_transform_dsc_t__bindgen_ty_1,
pub res: lv_img_transform_dsc_t__bindgen_ty_2,
pub tmp: lv_img_transform_dsc_t__bindgen_ty_3,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_img_transform_dsc_t__bindgen_ty_1 {
pub src: *const ::cty::c_void,
pub src_w: lv_coord_t,
pub src_h: lv_coord_t,
pub pivot_x: lv_coord_t,
pub pivot_y: lv_coord_t,
pub angle: i16,
pub zoom: u16,
pub color: lv_color_t,
pub cf: lv_img_cf_t,
pub antialias: bool,
}
impl Default for lv_img_transform_dsc_t__bindgen_ty_1 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_img_transform_dsc_t__bindgen_ty_2 {
pub color: lv_color_t,
pub opa: lv_opa_t,
}
impl Default for lv_img_transform_dsc_t__bindgen_ty_2 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_img_transform_dsc_t__bindgen_ty_3 {
pub img_dsc: lv_img_dsc_t,
pub pivot_x_256: i32,
pub pivot_y_256: i32,
pub sinma: i32,
pub cosma: i32,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
pub zoom_inv: u32,
pub xs: lv_coord_t,
pub ys: lv_coord_t,
pub xs_int: lv_coord_t,
pub ys_int: lv_coord_t,
pub pxi: u32,
pub px_size: u8,
}
impl Default for lv_img_transform_dsc_t__bindgen_ty_3 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl lv_img_transform_dsc_t__bindgen_ty_3 {
#[inline]
pub fn chroma_keyed(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
}
#[inline]
pub fn set_chroma_keyed(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 1u8, val as u64)
}
}
#[inline]
pub fn has_alpha(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
}
#[inline]
pub fn set_has_alpha(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(1usize, 1u8, val as u64)
}
}
#[inline]
pub fn native_color(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
}
#[inline]
pub fn set_native_color(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(2usize, 1u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
chroma_keyed: u8,
has_alpha: u8,
native_color: u8,
) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {
let chroma_keyed: u8 = unsafe { ::core::mem::transmute(chroma_keyed) };
chroma_keyed as u64
});
__bindgen_bitfield_unit.set(1usize, 1u8, {
let has_alpha: u8 = unsafe { ::core::mem::transmute(has_alpha) };
has_alpha as u64
});
__bindgen_bitfield_unit.set(2usize, 1u8, {
let native_color: u8 = unsafe { ::core::mem::transmute(native_color) };
native_color as u64
});
__bindgen_bitfield_unit
}
}
impl Default for lv_img_transform_dsc_t {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Allocate an image buffer in RAM"]
#[doc = " - __`w`__: width of image"]
#[doc = " - __`h`__: height of image"]
#[doc = " - __`cf`__: a color format (`LV_IMG_CF_...`)"]
#[doc = " Return: an allocated image, or NULL on failure"]
pub fn lv_img_buf_alloc(w: lv_coord_t, h: lv_coord_t, cf: lv_img_cf_t) -> *mut lv_img_dsc_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the color of an image's pixel"]
#[doc = " - __`dsc`__: an image descriptor"]
#[doc = " - __`x`__: x coordinate of the point to get"]
#[doc = " - __`y`__: x coordinate of the point to get"]
#[doc = " - __`color`__: the color of the image. In case of `LV_IMG_CF_ALPHA_1/2/4/8` this color is used."]
#[doc = " Not used in other cases."]
#[doc = " - __`safe`__: true: check out of bounds"]
#[doc = " Return: color of the point"]
pub fn lv_img_buf_get_px_color(
dsc: *mut lv_img_dsc_t,
x: lv_coord_t,
y: lv_coord_t,
color: lv_color_t,
) -> lv_color_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the alpha value of an image's pixel"]
#[doc = " - __`dsc`__: pointer to an image descriptor"]
#[doc = " - __`x`__: x coordinate of the point to set"]
#[doc = " - __`y`__: x coordinate of the point to set"]
#[doc = " - __`safe`__: true: check out of bounds"]
#[doc = " Return: alpha value of the point"]
pub fn lv_img_buf_get_px_alpha(
dsc: *mut lv_img_dsc_t,
x: lv_coord_t,
y: lv_coord_t,
) -> lv_opa_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set the color of a pixel of an image. The alpha channel won't be affected."]
#[doc = " - __`dsc`__: pointer to an image descriptor"]
#[doc = " - __`x`__: x coordinate of the point to set"]
#[doc = " - __`y`__: x coordinate of the point to set"]
#[doc = " - __`c`__: color of the point"]
#[doc = " - __`safe`__: true: check out of bounds"]
pub fn lv_img_buf_set_px_color(
dsc: *mut lv_img_dsc_t,
x: lv_coord_t,
y: lv_coord_t,
c: lv_color_t,
);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set the alpha value of a pixel of an image. The color won't be affected"]
#[doc = " - __`dsc`__: pointer to an image descriptor"]
#[doc = " - __`x`__: x coordinate of the point to set"]
#[doc = " - __`y`__: x coordinate of the point to set"]
#[doc = " - __`opa`__: the desired opacity"]
#[doc = " - __`safe`__: true: check out of bounds"]
pub fn lv_img_buf_set_px_alpha(
dsc: *mut lv_img_dsc_t,
x: lv_coord_t,
y: lv_coord_t,
opa: lv_opa_t,
);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set the palette color of an indexed image. Valid only for `LV_IMG_CF_INDEXED1/2/4/8`"]
#[doc = " - __`dsc`__: pointer to an image descriptor"]
#[doc = " - __`id`__: the palette color to set:"]
#[doc = " - for `LV_IMG_CF_INDEXED1`: 0..1"]
#[doc = " - for `LV_IMG_CF_INDEXED2`: 0..3"]
#[doc = " - for `LV_IMG_CF_INDEXED4`: 0..15"]
#[doc = " - for `LV_IMG_CF_INDEXED8`: 0..255"]
#[doc = " - __`c`__: the color to set"]
pub fn lv_img_buf_set_palette(dsc: *mut lv_img_dsc_t, id: u8, c: lv_color_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Free an allocated image buffer"]
#[doc = " - __`dsc`__: image buffer to free"]
pub fn lv_img_buf_free(dsc: *mut lv_img_dsc_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the memory consumption of a raw bitmap, given color format and dimensions."]
#[doc = " - __`w`__: width"]
#[doc = " - __`h`__: height"]
#[doc = " - __`cf`__: color format"]
#[doc = " Return: size in bytes"]
pub fn lv_img_buf_get_img_size(w: lv_coord_t, h: lv_coord_t, cf: lv_img_cf_t) -> u32;
}
pub const LV_IMG_SRC_VARIABLE: _bindgen_ty_24 = 0;
#[doc = " Binary/C variable"]
pub const LV_IMG_SRC_FILE: _bindgen_ty_24 = 1;
#[doc = " File in filesystem"]
pub const LV_IMG_SRC_SYMBOL: _bindgen_ty_24 = 2;
#[doc = " Symbol (@ref lv_symbol_def.h)"]
pub const LV_IMG_SRC_UNKNOWN: _bindgen_ty_24 = 3;
#[doc = " Source of image."]
pub type _bindgen_ty_24 = u32;
pub type lv_img_src_t = u8;
#[doc = " Get info from an image and store in the `header`"]
#[doc = " - __`src`__: the image source. Can be a pointer to a C array or a file name (Use"]
#[doc = " `lv_img_src_get_type` to determine the type)"]
#[doc = " - __`header`__: store the info here"]
#[doc = " Return: LV_RES_OK: info written correctly; LV_RES_INV: failed"]
pub type lv_img_decoder_info_f_t = ::core::option::Option<
unsafe extern "C" fn(
decoder: *mut _lv_img_decoder,
src: *const ::cty::c_void,
header: *mut lv_img_header_t,
) -> lv_res_t,
>;
#[doc = " Open an image for decoding. Prepare it as it is required to read it later"]
#[doc = " - __`decoder`__: pointer to the decoder the function associated with"]
#[doc = " - __`dsc`__: pointer to decoder descriptor. `src`, `style` are already initialized in it."]
pub type lv_img_decoder_open_f_t = ::core::option::Option<
unsafe extern "C" fn(decoder: *mut _lv_img_decoder, dsc: *mut _lv_img_decoder_dsc) -> lv_res_t,
>;
#[doc = " Decode `len` pixels starting from the given `x`, `y` coordinates and store them in `buf`."]
#[doc = " Required only if the \"open\" function can't return with the whole decoded pixel array."]
#[doc = " - __`decoder`__: pointer to the decoder the function associated with"]
#[doc = " - __`dsc`__: pointer to decoder descriptor"]
#[doc = " - __`x`__: start x coordinate"]
#[doc = " - __`y`__: start y coordinate"]
#[doc = " - __`len`__: number of pixels to decode"]
#[doc = " - __`buf`__: a buffer to store the decoded pixels"]
#[doc = " Return: LV_RES_OK: ok; LV_RES_INV: failed"]
pub type lv_img_decoder_read_line_f_t = ::core::option::Option<
unsafe extern "C" fn(
decoder: *mut _lv_img_decoder,
dsc: *mut _lv_img_decoder_dsc,
x: lv_coord_t,
y: lv_coord_t,
len: lv_coord_t,
buf: *mut u8,
) -> lv_res_t,
>;
#[doc = " Close the pending decoding. Free resources etc."]
#[doc = " - __`decoder`__: pointer to the decoder the function associated with"]
#[doc = " - __`dsc`__: pointer to decoder descriptor"]
pub type lv_img_decoder_close_f_t = ::core::option::Option<
unsafe extern "C" fn(decoder: *mut _lv_img_decoder, dsc: *mut _lv_img_decoder_dsc),
>;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct _lv_img_decoder {
pub info_cb: lv_img_decoder_info_f_t,
pub open_cb: lv_img_decoder_open_f_t,
pub read_line_cb: lv_img_decoder_read_line_f_t,
pub close_cb: lv_img_decoder_close_f_t,
pub user_data: lv_img_decoder_user_data_t,
}
impl Default for _lv_img_decoder {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
pub type lv_img_decoder_t = _lv_img_decoder;
#[doc = "Describe an image decoding session. Stores data about the decoding"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct _lv_img_decoder_dsc {
#[doc = "The decoder which was able to open the image source"]
pub decoder: *mut lv_img_decoder_t,
#[doc = "The image source. A file path like \"S:my_img.png\" or pointer to an `lv_img_dsc_t` variable"]
pub src: *const ::cty::c_void,
#[doc = "Style to draw the image."]
pub color: lv_color_t,
#[doc = "Type of the source: file or variable. Can be set in `open` function if required"]
pub src_type: lv_img_src_t,
#[doc = "Info about the opened image: color format, size, etc. MUST be set in `open` function"]
pub header: lv_img_header_t,
#[doc = " Pointer to a buffer where the image's data (pixels) are stored in a decoded, plain format."]
#[doc = " MUST be set in `open` function"]
pub img_data: *const u8,
#[doc = " How much time did it take to open the image. [ms]"]
#[doc = " If not set `lv_img_cache` will measure and set the time to open"]
pub time_to_open: u32,
#[doc = "A text to display instead of the image when the image can't be opened."]
#[doc = " Can be set in `open` function or set NULL."]
pub error_msg: *const ::cty::c_char,
#[doc = "Store any custom data here is required"]
pub user_data: *mut ::cty::c_void,
}
impl Default for _lv_img_decoder_dsc {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
pub type lv_img_decoder_dsc_t = _lv_img_decoder_dsc;
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get information about an image."]
#[doc = " Try the created image decoder one by one. Once one is able to get info that info will be used."]
#[doc = " - __`src`__: the image source. Can be"]
#[doc = " 1) File name: E.g. \"S:folder/img1.png\" (The drivers needs to registered via `lv_fs_add_drv()`)"]
#[doc = " 2) Variable: Pointer to an `lv_img_dsc_t` variable"]
#[doc = " 3) Symbol: E.g. `LV_SYMBOL_OK`"]
#[doc = " - __`header`__: the image info will be stored here"]
#[doc = " Return: LV_RES_OK: success; LV_RES_INV: wasn't able to get info about the image"]
pub fn lv_img_decoder_get_info(
src: *const ::cty::c_char,
header: *mut lv_img_header_t,
) -> lv_res_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Open an image."]
#[doc = " Try the created image decoder one by one. Once one is able to open the image that decoder is save in `dsc`"]
#[doc = " - __`dsc`__: describe a decoding session. Simply a pointer to an `lv_img_decoder_dsc_t` variable."]
#[doc = " - __`src`__: the image source. Can be"]
#[doc = " 1) File name: E.g. \"S:folder/img1.png\" (The drivers needs to registered via `lv_fs_add_drv()`)"]
#[doc = " 2) Variable: Pointer to an `lv_img_dsc_t` variable"]
#[doc = " 3) Symbol: E.g. `LV_SYMBOL_OK`"]
#[doc = " - __`color`__: The color of the image with `LV_IMG_CF_ALPHA_...`"]
#[doc = " Return: LV_RES_OK: opened the image. `dsc->img_data` and `dsc->header` are set."]
#[doc = " LV_RES_INV: none of the registered image decoders were able to open the image."]
pub fn lv_img_decoder_open(
dsc: *mut lv_img_decoder_dsc_t,
src: *const ::cty::c_void,
color: lv_color_t,
) -> lv_res_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Read a line from an opened image"]
#[doc = " - __`dsc`__: pointer to `lv_img_decoder_dsc_t` used in `lv_img_decoder_open`"]
#[doc = " - __`x`__: start X coordinate (from left)"]
#[doc = " - __`y`__: start Y coordinate (from top)"]
#[doc = " - __`len`__: number of pixels to read"]
#[doc = " - __`buf`__: store the data here"]
#[doc = " Return: LV_RES_OK: success; LV_RES_INV: an error occurred"]
pub fn lv_img_decoder_read_line(
dsc: *mut lv_img_decoder_dsc_t,
x: lv_coord_t,
y: lv_coord_t,
len: lv_coord_t,
buf: *mut u8,
) -> lv_res_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Close a decoding session"]
#[doc = " - __`dsc`__: pointer to `lv_img_decoder_dsc_t` used in `lv_img_decoder_open`"]
pub fn lv_img_decoder_close(dsc: *mut lv_img_decoder_dsc_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Create a new image decoder"]
#[doc = " Return: pointer to the new image decoder"]
pub fn lv_img_decoder_create() -> *mut lv_img_decoder_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Delete an image decoder"]
#[doc = " - __`decoder`__: pointer to an image decoder"]
pub fn lv_img_decoder_delete(decoder: *mut lv_img_decoder_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set a callback to get information about the image"]
#[doc = " - __`decoder`__: pointer to an image decoder"]
#[doc = " - __`info_cb`__: a function to collect info about an image (fill an `lv_img_header_t` struct)"]
pub fn lv_img_decoder_set_info_cb(
decoder: *mut lv_img_decoder_t,
info_cb: lv_img_decoder_info_f_t,
);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set a callback to open an image"]
#[doc = " - __`decoder`__: pointer to an image decoder"]
#[doc = " - __`open_cb`__: a function to open an image"]
pub fn lv_img_decoder_set_open_cb(
decoder: *mut lv_img_decoder_t,
open_cb: lv_img_decoder_open_f_t,
);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set a callback to a decoded line of an image"]
#[doc = " - __`decoder`__: pointer to an image decoder"]
#[doc = " - __`read_line_cb`__: a function to read a line of an image"]
pub fn lv_img_decoder_set_read_line_cb(
decoder: *mut lv_img_decoder_t,
read_line_cb: lv_img_decoder_read_line_f_t,
);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set a callback to close a decoding session. E.g. close files and free other resources."]
#[doc = " - __`decoder`__: pointer to an image decoder"]
#[doc = " - __`close_cb`__: a function to close a decoding session"]
pub fn lv_img_decoder_set_close_cb(
decoder: *mut lv_img_decoder_t,
close_cb: lv_img_decoder_close_f_t,
);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get info about a built-in image"]
#[doc = " - __`decoder`__: the decoder where this function belongs"]
#[doc = " - __`src`__: the image source: pointer to an `lv_img_dsc_t` variable, a file path or a symbol"]
#[doc = " - __`header`__: store the image data here"]
#[doc = " Return: LV_RES_OK: the info is successfully stored in `header`; LV_RES_INV: unknown format or other error."]
pub fn lv_img_decoder_built_in_info(
decoder: *mut lv_img_decoder_t,
src: *const ::cty::c_void,
header: *mut lv_img_header_t,
) -> lv_res_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Open a built in image"]
#[doc = " - __`decoder`__: the decoder where this function belongs"]
#[doc = " - __`dsc`__: pointer to decoder descriptor. `src`, `style` are already initialized in it."]
#[doc = " Return: LV_RES_OK: the info is successfully stored in `header`; LV_RES_INV: unknown format or other error."]
pub fn lv_img_decoder_built_in_open(
decoder: *mut lv_img_decoder_t,
dsc: *mut lv_img_decoder_dsc_t,
) -> lv_res_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Decode `len` pixels starting from the given `x`, `y` coordinates and store them in `buf`."]
#[doc = " Required only if the \"open\" function can't return with the whole decoded pixel array."]
#[doc = " - __`decoder`__: pointer to the decoder the function associated with"]
#[doc = " - __`dsc`__: pointer to decoder descriptor"]
#[doc = " - __`x`__: start x coordinate"]
#[doc = " - __`y`__: start y coordinate"]
#[doc = " - __`len`__: number of pixels to decode"]
#[doc = " - __`buf`__: a buffer to store the decoded pixels"]
#[doc = " Return: LV_RES_OK: ok; LV_RES_INV: failed"]
pub fn lv_img_decoder_built_in_read_line(
decoder: *mut lv_img_decoder_t,
dsc: *mut lv_img_decoder_dsc_t,
x: lv_coord_t,
y: lv_coord_t,
len: lv_coord_t,
buf: *mut u8,
) -> lv_res_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Close the pending decoding. Free resources etc."]
#[doc = " - __`decoder`__: pointer to the decoder the function associated with"]
#[doc = " - __`dsc`__: pointer to decoder descriptor"]
pub fn lv_img_decoder_built_in_close(
decoder: *mut lv_img_decoder_t,
dsc: *mut lv_img_decoder_dsc_t,
);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the type of an image source"]
#[doc = " - __`src`__: pointer to an image source:"]
#[doc = " - pointer to an 'lv_img_t' variable (image stored internally and compiled into the code)"]
#[doc = " - a path to a file (e.g. \"S:/folder/image.bin\")"]
#[doc = " - or a symbol (e.g. LV_SYMBOL_CLOSE)"]
#[doc = " Return: type of the image source LV_IMG_SRC_VARIABLE/FILE/SYMBOL/UNKNOWN"]
pub fn lv_img_src_get_type(src: *const ::cty::c_void) -> lv_img_src_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the pixel size of a color format in bits"]
#[doc = " - __`cf`__: a color format (`LV_IMG_CF_...`)"]
#[doc = " Return: the pixel size in bits"]
pub fn lv_img_cf_get_px_size(cf: lv_img_cf_t) -> u8;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Check if a color format is chroma keyed or not"]
#[doc = " - __`cf`__: a color format (`LV_IMG_CF_...`)"]
#[doc = " Return: true: chroma keyed; false: not chroma keyed"]
pub fn lv_img_cf_is_chroma_keyed(cf: lv_img_cf_t) -> bool;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Check if a color format has alpha channel or not"]
#[doc = " - __`cf`__: a color format (`LV_IMG_CF_...`)"]
#[doc = " Return: true: has alpha channel; false: doesn't have alpha channel"]
pub fn lv_img_cf_has_alpha(cf: lv_img_cf_t) -> bool;
}
pub type lv_design_mode_t = u8;
pub type lv_design_res_t = u8;
#[doc = " The design callback is used to draw the object on the screen."]
#[doc = " It accepts the object, a mask area, and the mode in which to draw the object."]
pub type lv_design_cb_t = ::core::option::Option<
unsafe extern "C" fn(
obj: *mut _lv_obj_t,
clip_area: *const lv_area_t,
mode: lv_design_mode_t,
) -> lv_design_res_t,
>;
pub type lv_event_t = u8;
#[doc = " @brief Event callback."]
#[doc = " Events are used to notify the user of some action being taken on the object."]
#[doc = " For details, see ::lv_event_t."]
pub type lv_event_cb_t =
::core::option::Option<unsafe extern "C" fn(obj: *mut _lv_obj_t, event: lv_event_t)>;
pub type lv_signal_t = u8;
pub type lv_signal_cb_t = ::core::option::Option<
unsafe extern "C" fn(
obj: *mut _lv_obj_t,
sign: lv_signal_t,
param: *mut ::cty::c_void,
) -> lv_res_t,
>;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_realign_t {
pub base: *const _lv_obj_t,
pub xofs: lv_coord_t,
pub yofs: lv_coord_t,
pub align: lv_align_t,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
pub __bindgen_padding_0: u16,
}
impl Default for lv_realign_t {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl lv_realign_t {
#[inline]
pub fn auto_realign(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
}
#[inline]
pub fn set_auto_realign(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 1u8, val as u64)
}
}
#[inline]
pub fn mid_align(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
}
#[inline]
pub fn set_mid_align(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(1usize, 1u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
auto_realign: u8,
mid_align: u8,
) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {
let auto_realign: u8 = unsafe { ::core::mem::transmute(auto_realign) };
auto_realign as u64
});
__bindgen_bitfield_unit.set(1usize, 1u8, {
let mid_align: u8 = unsafe { ::core::mem::transmute(mid_align) };
mid_align as u64
});
__bindgen_bitfield_unit
}
}
pub type lv_state_t = u8;
pub type lv_obj_t = _lv_obj_t;
#[doc = " TYPEDEFS"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_img_ext_t {
pub src: *const ::cty::c_void,
pub offset: lv_point_t,
pub w: lv_coord_t,
pub h: lv_coord_t,
pub angle: u16,
pub pivot: lv_point_t,
pub zoom: u16,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u8>,
pub __bindgen_padding_0: [u16; 3usize],
}
impl Default for lv_img_ext_t {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl lv_img_ext_t {
#[inline]
pub fn src_type(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
}
#[inline]
pub fn set_src_type(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 2u8, val as u64)
}
}
#[inline]
pub fn auto_size(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
}
#[inline]
pub fn set_auto_size(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(2usize, 1u8, val as u64)
}
}
#[inline]
pub fn cf(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 5u8) as u8) }
}
#[inline]
pub fn set_cf(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(3usize, 5u8, val as u64)
}
}
#[inline]
pub fn antialias(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
}
#[inline]
pub fn set_antialias(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(8usize, 1u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
src_type: u8,
auto_size: u8,
cf: u8,
antialias: u8,
) -> __BindgenBitfieldUnit<[u8; 2usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 2u8, {
let src_type: u8 = unsafe { ::core::mem::transmute(src_type) };
src_type as u64
});
__bindgen_bitfield_unit.set(2usize, 1u8, {
let auto_size: u8 = unsafe { ::core::mem::transmute(auto_size) };
auto_size as u64
});
__bindgen_bitfield_unit.set(3usize, 5u8, {
let cf: u8 = unsafe { ::core::mem::transmute(cf) };
cf as u64
});
__bindgen_bitfield_unit.set(8usize, 1u8, {
let antialias: u8 = unsafe { ::core::mem::transmute(antialias) };
antialias as u64
});
__bindgen_bitfield_unit
}
}
pub const LV_IMG_PART_MAIN: _bindgen_ty_35 = 0;
pub type _bindgen_ty_35 = u32;
pub type lv_img_part_t = u8;
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Create an image objects"]
#[doc = " - __`par`__: pointer to an object, it will be the parent of the new button"]
#[doc = " - __`copy`__: pointer to a image object, if not NULL then the new object will be copied from it"]
#[doc = " Return: pointer to the created image"]
pub fn lv_img_create(par: *mut lv_obj_t, copy: *const lv_obj_t) -> *mut lv_obj_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set the pixel map to display by the image"]
#[doc = " - __`img`__: pointer to an image object"]
#[doc = " - __`data`__: the image data"]
pub fn lv_img_set_src(img: *mut lv_obj_t, src_img: *const ::cty::c_void);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Enable the auto size feature."]
#[doc = " If enabled the object size will be same as the picture size."]
#[doc = " - __`img`__: pointer to an image"]
#[doc = " - __`en`__: true: auto size enable, false: auto size disable"]
pub fn lv_img_set_auto_size(img: *mut lv_obj_t, autosize_en: bool);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set an offset for the source of an image."]
#[doc = " so the image will be displayed from the new origin."]
#[doc = " - __`img`__: pointer to an image"]
#[doc = " - __`x:`__: the new offset along x axis."]
pub fn lv_img_set_offset_x(img: *mut lv_obj_t, x: lv_coord_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set an offset for the source of an image."]
#[doc = " so the image will be displayed from the new origin."]
#[doc = " - __`img`__: pointer to an image"]
#[doc = " - __`y:`__: the new offset along y axis."]
pub fn lv_img_set_offset_y(img: *mut lv_obj_t, y: lv_coord_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set the rotation center of the image."]
#[doc = " The image will be rotated around this point"]
#[doc = " - __`img`__: pointer to an image object"]
#[doc = " - __`pivot_x`__: rotation center x of the image"]
#[doc = " - __`pivot_y`__: rotation center y of the image"]
pub fn lv_img_set_pivot(img: *mut lv_obj_t, pivot_x: lv_coord_t, pivot_y: lv_coord_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set the rotation angle of the image."]
#[doc = " The image will be rotated around the set pivot set by `lv_img_set_pivot()`"]
#[doc = " - __`img`__: pointer to an image object"]
#[doc = " - __`angle`__: rotation angle in degree with 0.1 degree resolution (0..3600: clock wise)"]
pub fn lv_img_set_angle(img: *mut lv_obj_t, angle: i16);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set the zoom factor of the image."]
#[doc = " - __`img`__: pointer to an image object"]
#[doc = " - __`zoom`__: the zoom factor."]
#[doc = " - 256 or LV_ZOOM_IMG_NONE for no zoom"]
#[doc = " - <256: scale down"]
#[doc = " - >256 scale up"]
#[doc = " - 128 half size"]
#[doc = " - 512 double size"]
pub fn lv_img_set_zoom(img: *mut lv_obj_t, zoom: u16);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Enable/disable anti-aliasing for the transformations (rotate, zoom) or not"]
#[doc = " - __`img`__: pointer to an image object"]
#[doc = " - __`antialias`__: true: anti-aliased; false: not anti-aliased"]
pub fn lv_img_set_antialias(img: *mut lv_obj_t, antialias: bool);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the source of the image"]
#[doc = " - __`img`__: pointer to an image object"]
#[doc = " Return: the image source (symbol, file name or C array)"]
pub fn lv_img_get_src(img: *mut lv_obj_t) -> *const ::cty::c_void;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the auto size enable attribute"]
#[doc = " - __`img`__: pointer to an image"]
#[doc = " Return: true: auto size is enabled, false: auto size is disabled"]
pub fn lv_img_get_auto_size(img: *const lv_obj_t) -> bool;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the offset.x attribute of the img object."]
#[doc = " - __`img`__: pointer to an image"]
#[doc = " Return: offset.x value."]
pub fn lv_img_get_offset_x(img: *mut lv_obj_t) -> lv_coord_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the offset.y attribute of the img object."]
#[doc = " - __`img`__: pointer to an image"]
#[doc = " Return: offset.y value."]
pub fn lv_img_get_offset_y(img: *mut lv_obj_t) -> lv_coord_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the rotation angle of the image."]
#[doc = " - __`img`__: pointer to an image object"]
#[doc = " Return: rotation angle in degree (0..359)"]
pub fn lv_img_get_angle(img: *mut lv_obj_t) -> u16;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the rotation center of the image."]
#[doc = " - __`img`__: pointer to an image object"]
#[doc = " - __`center`__: rotation center of the image"]
pub fn lv_img_get_pivot(img: *mut lv_obj_t, center: *mut lv_point_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the zoom factor of the image."]
#[doc = " - __`img`__: pointer to an image object"]
#[doc = " Return: zoom factor (256: no zoom)"]
pub fn lv_img_get_zoom(img: *mut lv_obj_t) -> u16;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get whether the transformations (rotate, zoom) are anti-aliased or not"]
#[doc = " - __`img`__: pointer to an image object"]
#[doc = " Return: true: anti-aliased; false: not anti-aliased"]
pub fn lv_img_get_antialias(img: *mut lv_obj_t) -> bool;
}