mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Add SVGComponentTransferFunctionElement
This will be the base for <feFuncR>, <feFuncG>, <feFuncB> and <feFuncA>.
This commit is contained in:
parent
03a8de566b
commit
db321cb74f
Notes:
github-actions[bot]
2025-11-09 00:23:58 +00:00
Author: https://github.com/gmta
Commit: db321cb74f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6709
10 changed files with 262 additions and 0 deletions
62
Libraries/LibWeb/SVG/SVGComponentTransferFunctionElement.h
Normal file
62
Libraries/LibWeb/SVG/SVGComponentTransferFunctionElement.h
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/SVG/SVGAnimatedEnumeration.h>
|
||||
#include <LibWeb/SVG/SVGAnimatedNumber.h>
|
||||
#include <LibWeb/SVG/SVGAnimatedNumberList.h>
|
||||
#include <LibWeb/SVG/SVGElement.h>
|
||||
|
||||
namespace Web::SVG {
|
||||
|
||||
// https://www.w3.org/TR/filter-effects-1/#InterfaceSVGComponentTransferFunctionElement
|
||||
class SVGComponentTransferFunctionElement
|
||||
: public SVGElement {
|
||||
WEB_PLATFORM_OBJECT(SVGComponentTransferFunctionElement, SVGElement);
|
||||
|
||||
public:
|
||||
enum class Type : u8 {
|
||||
Unknown = 0,
|
||||
Identity = 1,
|
||||
Table = 2,
|
||||
Discrete = 3,
|
||||
Linear = 4,
|
||||
Gamma = 5,
|
||||
};
|
||||
|
||||
virtual ~SVGComponentTransferFunctionElement() override = default;
|
||||
|
||||
virtual void attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value, Optional<FlyString> const& namespace_) override;
|
||||
|
||||
GC::Ref<SVGAnimatedEnumeration> type();
|
||||
GC::Ref<SVGAnimatedNumberList> table_values();
|
||||
GC::Ref<SVGAnimatedNumber> slope();
|
||||
GC::Ref<SVGAnimatedNumber> intercept();
|
||||
GC::Ref<SVGAnimatedNumber> amplitude();
|
||||
GC::Ref<SVGAnimatedNumber> exponent();
|
||||
GC::Ref<SVGAnimatedNumber> offset();
|
||||
|
||||
protected:
|
||||
SVGComponentTransferFunctionElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
private:
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
Type type_from_attribute() const;
|
||||
|
||||
GC::Ptr<SVGAnimatedEnumeration> m_type;
|
||||
GC::Ptr<SVGAnimatedNumberList> m_table_values;
|
||||
GC::Ptr<SVGAnimatedNumber> m_slope;
|
||||
GC::Ptr<SVGAnimatedNumber> m_intercept;
|
||||
GC::Ptr<SVGAnimatedNumber> m_amplitude;
|
||||
GC::Ptr<SVGAnimatedNumber> m_exponent;
|
||||
GC::Ptr<SVGAnimatedNumber> m_offset;
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue