mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:18:12 +00:00
LibGfx: Change BMPWriter API to be consistent with other image writers
This commit is contained in:
parent
01387eb72b
commit
f1a3028ef1
6 changed files with 15 additions and 12 deletions
|
@ -176,8 +176,7 @@ ErrorOr<void> Image::export_bmp_to_file(NonnullOwnPtr<Stream> stream, bool prese
|
|||
auto bitmap_format = preserve_alpha_channel ? Gfx::BitmapFormat::BGRA8888 : Gfx::BitmapFormat::BGRx8888;
|
||||
auto bitmap = TRY(compose_bitmap(bitmap_format));
|
||||
|
||||
Gfx::BMPWriter dumper;
|
||||
auto encoded_data = dumper.dump(bitmap);
|
||||
auto encoded_data = TRY(Gfx::BMPWriter::encode(*bitmap));
|
||||
TRY(stream->write_entire_buffer(encoded_data));
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue