fn send_fragment_result(
fragment_task: &FragmentTask,
cli_args: &CliClientArgs,
pixel_data: PixelData,
data: Vec<u8>,
) -> Result<TcpStream, FractalError>
Expand description
Send a FragmentResult
to the server after generating a fractal image.
§Arguments
img
- AnImageBuffer
containing the fractal image.fragment_task
- AFragmentTask
containing details such as the fractal type, resolution, and range.cli_args
- ACliClientArgs
containing the command line arguments.pixel_data
- APixelData
struct containing the image data.data
- AVec<u8>
containing the image data.
§Return
Result<(), FractalError>
- Anio::Error
if the image could not be saved.
§Details
This function converts the ImageBuffer
to a Vec<u8>
and then to a PixelData
struct.