Transformation.h 706 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2023, Sam Atkins <atkinssj@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibGfx/Matrix4x4.h>
  8. #include <LibWeb/CSS/Angle.h>
  9. #include <LibWeb/CSS/CalculatedOr.h>
  10. #include <LibWeb/CSS/Length.h>
  11. #include <LibWeb/CSS/PercentageOr.h>
  12. #include <LibWeb/CSS/TransformFunctions.h>
  13. namespace Web::CSS {
  14. using TransformValue = Variant<AngleOrCalculated, LengthPercentage, double>;
  15. class Transformation {
  16. public:
  17. Transformation(TransformFunction function, Vector<TransformValue>&& values);
  18. Gfx::FloatMatrix4x4 to_matrix(Painting::PaintableBox const&) const;
  19. private:
  20. TransformFunction m_function;
  21. Vector<TransformValue> m_values;
  22. };
  23. }