_cef_image_t

Struct _cef_image_t 

Source
#[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_t

Base 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

Source§

fn clone(&self) -> _cef_image_t

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for _cef_image_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for _cef_image_t

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.