#[repr(C)]pub struct _cef_image_t {Show 14 fields
pub base: cef_base_ref_counted_t,
pub is_empty: Option<unsafe extern "C" fn(self_: *mut _cef_image_t) -> c_int>,
pub is_same: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, that: *mut _cef_image_t) -> c_int>,
pub add_bitmap: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, pixel_width: c_int, pixel_height: c_int, color_type: cef_color_type_t, alpha_type: cef_alpha_type_t, pixel_data: *const c_void, pixel_data_size: usize) -> c_int>,
pub add_png: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, png_data: *const c_void, png_data_size: usize) -> c_int>,
pub add_jpeg: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, jpeg_data: *const c_void, jpeg_data_size: usize) -> c_int>,
pub get_width: Option<unsafe extern "C" fn(self_: *mut _cef_image_t) -> usize>,
pub get_height: Option<unsafe extern "C" fn(self_: *mut _cef_image_t) -> usize>,
pub has_representation: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32) -> c_int>,
pub remove_representation: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32) -> c_int>,
pub get_representation_info: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, actual_scale_factor: *mut f32, pixel_width: *mut c_int, pixel_height: *mut c_int) -> c_int>,
pub get_as_bitmap: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, color_type: cef_color_type_t, alpha_type: cef_alpha_type_t, pixel_width: *mut c_int, pixel_height: *mut c_int) -> *mut _cef_binary_value_t>,
pub get_as_png: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, with_transparency: c_int, pixel_width: *mut c_int, pixel_height: *mut c_int) -> *mut _cef_binary_value_t>,
pub get_as_jpeg: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, quality: c_int, pixel_width: *mut c_int, pixel_height: *mut c_int) -> *mut _cef_binary_value_t>,
}Expand description
Container for a single image represented at different scale factors. All image representations should be the same size in density independent pixel (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels then the image at scale factor 2.0 should be 200x200 pixels – both images will display with a DIP size of 100x100 units. The functions of this structure can be called on any browser process thread.
NOTE: This struct is allocated DLL-side.
Fields§
§base: cef_base_ref_counted_tBase structure.
is_empty: Option<unsafe extern "C" fn(self_: *mut _cef_image_t) -> c_int>Returns true (1) if this Image is NULL.
is_same: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, that: *mut _cef_image_t) -> c_int>Returns true (1) if this Image and |that| Image share the same underlying storage. Will also return true (1) if both images are NULL.
add_bitmap: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, pixel_width: c_int, pixel_height: c_int, color_type: cef_color_type_t, alpha_type: cef_alpha_type_t, pixel_data: *const c_void, pixel_data_size: usize) -> c_int>Add a bitmap image representation for |scale_factor|. Only 32-bit RGBA/BGRA formats are supported. |pixel_width| and |pixel_height| are the bitmap representation size in pixel coordinates. |pixel_data| is the array of pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in size. |color_type| and |alpha_type| values specify the pixel format.
add_png: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, png_data: *const c_void, png_data_size: usize) -> c_int>Add a PNG image representation for |scale_factor|. |png_data| is the image data of size |png_data_size|. Any alpha transparency in the PNG data will be maintained.
add_jpeg: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, jpeg_data: *const c_void, jpeg_data_size: usize) -> c_int>Create a JPEG image representation for |scale_factor|. |jpeg_data| is the image data of size |jpeg_data_size|. The JPEG format does not support transparency so the alpha byte will be set to 0xFF for all pixels.
get_width: Option<unsafe extern "C" fn(self_: *mut _cef_image_t) -> usize>Returns the image width in density independent pixel (DIP) units.
get_height: Option<unsafe extern "C" fn(self_: *mut _cef_image_t) -> usize>Returns the image height in density independent pixel (DIP) units.
has_representation: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32) -> c_int>Returns true (1) if this image contains a representation for |scale_factor|.
remove_representation: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32) -> c_int>Removes the representation for |scale_factor|. Returns true (1) on success.
get_representation_info: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, actual_scale_factor: *mut f32, pixel_width: *mut c_int, pixel_height: *mut c_int) -> c_int>Returns information for the representation that most closely matches |scale_factor|. |actual_scale_factor| is the actual scale factor for the representation. |pixel_width| and |pixel_height| are the representation size in pixel coordinates. Returns true (1) on success.
get_as_bitmap: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, color_type: cef_color_type_t, alpha_type: cef_alpha_type_t, pixel_width: *mut c_int, pixel_height: *mut c_int) -> *mut _cef_binary_value_t>Returns the bitmap representation that most closely matches |scale_factor|. Only 32-bit RGBA/BGRA formats are supported. |color_type| and |alpha_type| values specify the desired output pixel format. |pixel_width| and |pixel_height| are the output representation size in pixel coordinates. Returns a cef_binary_value_t containing the pixel data on success or NULL on failure.
get_as_png: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, with_transparency: c_int, pixel_width: *mut c_int, pixel_height: *mut c_int) -> *mut _cef_binary_value_t>Returns the PNG representation that most closely matches |scale_factor|. If |with_transparency| is true (1) any alpha transparency in the image will be represented in the resulting PNG data. |pixel_width| and |pixel_height| are the output representation size in pixel coordinates. Returns a cef_binary_value_t containing the PNG image data on success or NULL on failure.
get_as_jpeg: Option<unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32, quality: c_int, pixel_width: *mut c_int, pixel_height: *mut c_int) -> *mut _cef_binary_value_t>Returns the JPEG representation that most closely matches |scale_factor|. |quality| determines the compression level with 0 == lowest and 100 == highest. The JPEG format does not support alpha transparency and the alpha channel, if any, will be discarded. |pixel_width| and |pixel_height| are the output representation size in pixel coordinates. Returns a cef_binary_value_t containing the JPEG image data on success or NULL on failure.
Trait Implementations§
Source§impl Clone for _cef_image_t
impl Clone for _cef_image_t
Source§fn clone(&self) -> _cef_image_t
fn clone(&self) -> _cef_image_t
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more