/* * Copyright (c) 2025, Jelle Raaijmakers * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include 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 const& old_value, Optional const& value, Optional const& namespace_) override; GC::Ref type(); GC::Ref table_values(); GC::Ref slope(); GC::Ref intercept(); GC::Ref amplitude(); GC::Ref exponent(); GC::Ref 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 m_type; GC::Ptr m_table_values; GC::Ptr m_slope; GC::Ptr m_intercept; GC::Ptr m_amplitude; GC::Ptr m_exponent; GC::Ptr m_offset; }; }