mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-23 11:04:40 +00:00
LibGfx: Move AnimationWriter to its own file
No behavior change.
This commit is contained in:
parent
58cbecbe0c
commit
6c79efcae4
|
@ -63,6 +63,7 @@ shared_library("LibGfx") {
|
|||
"ICC/TagTypes.cpp",
|
||||
"ICC/Tags.cpp",
|
||||
"ICC/WellKnownProfiles.cpp",
|
||||
"ImageFormats/AnimationWriter.cpp",
|
||||
"ImageFormats/BMPLoader.cpp",
|
||||
"ImageFormats/BMPWriter.cpp",
|
||||
"ImageFormats/BooleanDecoder.cpp",
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <LibGfx/ICC/BinaryWriter.h>
|
||||
#include <LibGfx/ICC/Profile.h>
|
||||
#include <LibGfx/ICC/WellKnownProfiles.h>
|
||||
#include <LibGfx/ImageFormats/AnimationWriter.h>
|
||||
#include <LibGfx/ImageFormats/BMPLoader.h>
|
||||
#include <LibGfx/ImageFormats/BMPWriter.h>
|
||||
#include <LibGfx/ImageFormats/JPEGLoader.h>
|
||||
|
|
|
@ -36,6 +36,7 @@ set(SOURCES
|
|||
ICC/Tags.cpp
|
||||
ICC/TagTypes.cpp
|
||||
ICC/WellKnownProfiles.cpp
|
||||
ImageFormats/AnimationWriter.cpp
|
||||
ImageFormats/BMPLoader.cpp
|
||||
ImageFormats/BMPWriter.cpp
|
||||
ImageFormats/BooleanDecoder.cpp
|
||||
|
|
13
Userland/Libraries/LibGfx/ImageFormats/AnimationWriter.cpp
Normal file
13
Userland/Libraries/LibGfx/ImageFormats/AnimationWriter.cpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Nico Weber <thakis@chromium.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibGfx/ImageFormats/AnimationWriter.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
AnimationWriter::~AnimationWriter() = default;
|
||||
|
||||
}
|
26
Userland/Libraries/LibGfx/ImageFormats/AnimationWriter.h
Normal file
26
Userland/Libraries/LibGfx/ImageFormats/AnimationWriter.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Nico Weber <thakis@chromium.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Error.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibGfx/Point.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
class AnimationWriter {
|
||||
public:
|
||||
virtual ~AnimationWriter();
|
||||
|
||||
// Flushes the frame to disk.
|
||||
// IntRect { at, at + bitmap.size() } must fit in the dimensions
|
||||
// passed to `start_writing_animation()`.
|
||||
// FIXME: Consider passing in disposal method and blend mode.
|
||||
virtual ErrorOr<void> add_frame(Bitmap&, int duration_ms, IntPoint at = {}) = 0;
|
||||
};
|
||||
|
||||
}
|
|
@ -11,6 +11,7 @@
|
|||
#include <AK/Debug.h>
|
||||
#include <LibCompress/DeflateTables.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/ImageFormats/AnimationWriter.h>
|
||||
#include <LibGfx/ImageFormats/WebPShared.h>
|
||||
#include <LibGfx/ImageFormats/WebPWriter.h>
|
||||
#include <LibRIFF/RIFF.h>
|
||||
|
|
|
@ -13,21 +13,12 @@
|
|||
|
||||
namespace Gfx {
|
||||
|
||||
class AnimationWriter;
|
||||
|
||||
struct WebPEncoderOptions {
|
||||
Optional<ReadonlyBytes> icc_data;
|
||||
};
|
||||
|
||||
class AnimationWriter {
|
||||
public:
|
||||
virtual ~AnimationWriter() = default;
|
||||
|
||||
// Flushes the frame to disk.
|
||||
// IntRect { at, at + bitmap.size() } must fit in the dimensions
|
||||
// passed to `start_writing_animation()`.
|
||||
// FIXME: Consider passing in disposal method and blend mode.
|
||||
virtual ErrorOr<void> add_frame(Bitmap&, int duration_ms, IntPoint at = {}) = 0;
|
||||
};
|
||||
|
||||
class WebPWriter {
|
||||
public:
|
||||
using Options = WebPEncoderOptions;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <LibCore/ArgsParser.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCore/MappedFile.h>
|
||||
#include <LibGfx/ImageFormats/AnimationWriter.h>
|
||||
#include <LibGfx/ImageFormats/ImageDecoder.h>
|
||||
#include <LibGfx/ImageFormats/WebPWriter.h>
|
||||
|
||||
|
|
Loading…
Reference in a new issue