1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:07:46 +00:00

AK: Move Stream and SeekableStream from LibCore

`Stream` will be qualified as `AK::Stream` until we remove the
`Core::Stream` namespace. `IODevice` now reuses the `SeekMode` that is
defined by `SeekableStream`, since defining its own would require us to
qualify it with `AK::SeekMode` everywhere.
This commit is contained in:
Tim Schumacher 2023-01-22 05:09:11 +01:00 committed by Andrew Kaster
parent 5f2ea31816
commit 8464da1439
96 changed files with 620 additions and 586 deletions

View file

@ -172,7 +172,7 @@ RefPtr<Gfx::Bitmap> Image::copy_bitmap(Selection const& selection) const
return cropped_bitmap_or_error.release_value_but_fixme_should_propagate_errors();
}
ErrorOr<void> Image::export_bmp_to_file(NonnullOwnPtr<Core::Stream::Stream> stream, bool preserve_alpha_channel) const
ErrorOr<void> Image::export_bmp_to_file(NonnullOwnPtr<AK::Stream> stream, bool preserve_alpha_channel) const
{
auto bitmap_format = preserve_alpha_channel ? Gfx::BitmapFormat::BGRA8888 : Gfx::BitmapFormat::BGRx8888;
auto bitmap = TRY(compose_bitmap(bitmap_format));
@ -183,7 +183,7 @@ ErrorOr<void> Image::export_bmp_to_file(NonnullOwnPtr<Core::Stream::Stream> stre
return {};
}
ErrorOr<void> Image::export_png_to_file(NonnullOwnPtr<Core::Stream::Stream> stream, bool preserve_alpha_channel) const
ErrorOr<void> Image::export_png_to_file(NonnullOwnPtr<AK::Stream> stream, bool preserve_alpha_channel) const
{
auto bitmap_format = preserve_alpha_channel ? Gfx::BitmapFormat::BGRA8888 : Gfx::BitmapFormat::BGRx8888;
auto bitmap = TRY(compose_bitmap(bitmap_format));
@ -193,7 +193,7 @@ ErrorOr<void> Image::export_png_to_file(NonnullOwnPtr<Core::Stream::Stream> stre
return {};
}
ErrorOr<void> Image::export_qoi_to_file(NonnullOwnPtr<Core::Stream::Stream> stream) const
ErrorOr<void> Image::export_qoi_to_file(NonnullOwnPtr<AK::Stream> stream) const
{
auto bitmap = TRY(compose_bitmap(Gfx::BitmapFormat::BGRA8888));

View file

@ -72,9 +72,9 @@ public:
void paint_into(GUI::Painter&, Gfx::IntRect const& dest_rect) const;
ErrorOr<void> serialize_as_json(JsonObjectSerializer<StringBuilder>& json) const;
ErrorOr<void> export_bmp_to_file(NonnullOwnPtr<Core::Stream::Stream>, bool preserve_alpha_channel) const;
ErrorOr<void> export_png_to_file(NonnullOwnPtr<Core::Stream::Stream>, bool preserve_alpha_channel) const;
ErrorOr<void> export_qoi_to_file(NonnullOwnPtr<Core::Stream::Stream>) const;
ErrorOr<void> export_bmp_to_file(NonnullOwnPtr<AK::Stream>, bool preserve_alpha_channel) const;
ErrorOr<void> export_png_to_file(NonnullOwnPtr<AK::Stream>, bool preserve_alpha_channel) const;
ErrorOr<void> export_qoi_to_file(NonnullOwnPtr<AK::Stream>) const;
void move_layer_to_front(Layer&);
void move_layer_to_back(Layer&);