Skip to main content

SubBlock

Struct SubBlock 

Source
pub struct SubBlock(/* private fields */);
Expand description

sub-block object.

Implementations§

Source§

impl SubBlock

Source

pub fn create_bitmap(&self) -> Result<Bitmap, Error>

Create a bitmap object from the specified sub-block object. The bitmap object can be used to access the pixel data contained in the sub-block. If the subblock contains compressed data, then decompression will be performed in this call.

\param sub_block_object The sub-block object. \param [out] bitmap_object If successful, the handle to the newly created bitmap object is put here.

\returns An error-code indicating success or failure of the operation.

Source

pub fn get_info(&self) -> Result<SubBlockInfo, Error>

Get Information about the sub-block.

\param sub_block_object The sub-block object. \param [out] sub_block_info If successful, information about the sub-block object is put here.

\returns An error-code indicating success or failure of the operation.

Source

pub fn get_raw_data( &self, tp: RawDataType, size: i32, ) -> Result<(i32, Vec<u8>), Error>

Copy the raw data from the specified sub-block object to the specified memory buffer. The value of the ‘size’ parameter on input is the size of the buffer pointed to by ‘data’. On output, the value of ‘size’ is the actual size of the data. At most the initial value of ‘size’ bytes are copied to the buffer. If the initial value of ‘size’ is zero (0) or ‘data’ is null, then no data is copied. For the ‘type’ parameter, the following values are valid: 0 (data) and 1 (metadata). For 0 (data), the data is the raw pixel data of the bitmap. This data may be compressed. For 1 (metadata), the data is the raw metadata in XML-format (UTF8-encoded).

\param sub_block_object The sub block object. \param type The type - 0 for "pixel-data", 1 for "sub-block metadata". \param [in,out] size On input, the size of the memory block pointed to by ‘data’, on output the actual size of the available data. \param [out] data Pointer where the data is to be copied to. At most the initial content of ‘size’ bytes are copied.

\returns An error-code indicating success or failure of the operation.

Source

pub fn release(&self) -> Result<(), Error>

Release the specified sub-block object.

\param sub_block_object The sub block object to be released.

\returns An error-code indicating success or failure of the operation.

Trait Implementations§

Source§

impl Clone for SubBlock

Source§

fn clone(&self) -> SubBlock

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 SubBlock

Source§

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

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

impl Deref for SubBlock

Source§

type Target = i64

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Drop for SubBlock

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl TryFrom<&SubBlock> for Bitmap

Source§

type Error = Error

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

fn try_from(sub_block: &SubBlock) -> Result<Self, Error>

Performs the conversion.

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.