Skip to main content

convert_in_memory

Function convert_in_memory 

Source
pub fn convert_in_memory(
    in_file: Vec<u8>,
    parameters: &CSParameters,
    format: SupportedFileTypes,
) -> Result<Vec<u8>, CaesiumError>
Expand description

Converts an image file in memory to a specified format and returns the converted image as a byte vector.

§Arguments

  • in_file - A vector of bytes representing the input image file.
  • parameters - A reference to CSParameters containing conversion settings.
  • format - The target format to convert the image to.

§Returns

  • Result<Vec<u8>, CaesiumError> - Returns a vector of bytes representing the converted image if successful, otherwise returns a CaesiumError.