chromium/ui/gfx/geometry/transform.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/354829279): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "ui/gfx/geometry/transform.h"

#include <ostream>

#include "base/check_op.h"
#include "base/notreached.h"
#include "base/numerics/angle_conversions.h"
#include "base/strings/stringprintf.h"
#include "ui/gfx/geometry/axis_transform2d.h"
#include "ui/gfx/geometry/box_f.h"
#include "ui/gfx/geometry/clamp_float_geometry.h"
#include "ui/gfx/geometry/decomposed_transform.h"
#include "ui/gfx/geometry/double4.h"
#include "ui/gfx/geometry/point3_f.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/quad_f.h"
#include "ui/gfx/geometry/quaternion.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/sin_cos_degrees.h"
#include "ui/gfx/geometry/transform_util.h"
#include "ui/gfx/geometry/vector3d_f.h"

namespace gfx {

namespace {

const double kEpsilon =;

double TanDegrees(double degrees) {}

inline bool ApproximatelyZero(double x, double tolerance) {}

inline bool ApproximatelyOne(double x, double tolerance) {}

Matrix44 AxisTransform2dToMatrix44(const AxisTransform2d& axis_2d) {}

template <typename T>
void AxisTransform2dToColMajor(const AxisTransform2d& axis_2d, T a[16]) {}

}  // namespace

// clang-format off
Transform::Transform(const Quaternion& q)
    :{}
// clang-format on

Matrix44 Transform::GetFullMatrix() const {}

Matrix44& Transform::EnsureFullMatrix() {}

// static
Transform Transform::ColMajor(const double a[16]) {}

// static
Transform Transform::ColMajorF(const float a[16]) {}

void Transform::GetColMajor(double a[16]) const {}

void Transform::GetColMajorF(float a[16]) const {}

void Transform::RotateAboutXAxis(double degrees) {}

void Transform::RotateAboutYAxis(double degrees) {}

void Transform::RotateAboutZAxis(double degrees) {}

void Transform::RotateAbout(double x, double y, double z, double degrees) {}

void Transform::RotateAbout(const Vector3dF& axis, double degrees) {}

double Transform::Determinant() const {}

void Transform::Scale(float x, float y) {}

void Transform::PostScale(float x, float y) {}

void Transform::Scale3d(float x, float y, float z) {}

void Transform::PostScale3d(float x, float y, float z) {}

void Transform::Translate(const Vector2dF& offset) {}

void Transform::Translate(float x, float y) {}

void Transform::PostTranslate(const Vector2dF& offset) {}

void Transform::PostTranslate(float x, float y) {}

void Transform::PostTranslate3d(const Vector3dF& offset) {}

void Transform::PostTranslate3d(float x, float y, float z) {}

void Transform::Translate3d(const Vector3dF& offset) {}

void Transform::Translate3d(float x, float y, float z) {}

void Transform::Skew(double degrees_x, double degrees_y) {}

void Transform::ApplyPerspectiveDepth(double depth) {}

void Transform::PreConcat(const Transform& transform) {}

void Transform::PostConcat(const Transform& transform) {}

Transform Transform::operator*(const Transform& transform) const {}

void Transform::PreConcat(const AxisTransform2d& transform) {}

void Transform::PostConcat(const AxisTransform2d& transform) {}

bool Transform::IsApproximatelyIdentityOrTranslation(double tolerance) const {}

bool Transform::IsApproximatelyIdentityOrIntegerTranslation(
    double tolerance) const {}

bool Transform::Is2dProportionalUpscaleAndOr2dTranslation() const {}

bool Transform::IsIdentityOrIntegerTranslation() const {}

bool Transform::IsIdentityOrInteger2dTranslation() const {}

bool Transform::Creates3d() const {}

bool Transform::IsBackFaceVisible() const {}

bool Transform::GetInverse(Transform* transform) const {}

Transform Transform::GetCheckedInverse() const {}

Transform Transform::InverseOrIdentity() const {}

bool Transform::Preserves2dAffine() const {}

bool Transform::Preserves2dAxisAlignment() const {}

bool Transform::NonDegeneratePreserves2dAxisAlignment() const {}

void Transform::Transpose() {}

void Transform::ApplyTransformOrigin(float x, float y, float z) {}

void Transform::Zoom(float zoom_factor) {}

void Transform::Flatten() {}

bool Transform::IsFlat() const {}

bool Transform::Is2dTransform() const {}

Vector2dF Transform::To2dTranslation() const {}

Vector3dF Transform::To3dTranslation() const {}

Vector2dF Transform::To2dScale() const {}

Point Transform::MapPoint(const Point& point) const {}

PointF Transform::MapPoint(const PointF& point) const {}

Point3F Transform::MapPoint(const Point3F& point) const {}

Vector3dF Transform::MapVector(const Vector3dF& vector) const {}

void Transform::TransformVector4(float vector[4]) const {}

std::optional<PointF> Transform::InverseMapPoint(const PointF& point) const {}

std::optional<Point> Transform::InverseMapPoint(const Point& point) const {}

std::optional<Point3F> Transform::InverseMapPoint(const Point3F& point) const {}

RectF Transform::MapRect(const RectF& rect) const {}

Rect Transform::MapRect(const Rect& rect) const {}

std::optional<RectF> Transform::InverseMapRect(const RectF& rect) const {}

std::optional<Rect> Transform::InverseMapRect(const Rect& rect) const {}

BoxF Transform::MapBox(const BoxF& box) const {}

QuadF Transform::MapQuad(const QuadF& quad) const {}

PointF Transform::ProjectPoint(const PointF& point, bool* clamped) const {}

QuadF Transform::ProjectQuad(const QuadF& quad) const {}

std::optional<DecomposedTransform> Transform::Decompose() const {}

// static
Transform Transform::Compose(const DecomposedTransform& decomp) {}

bool Transform::Blend(const Transform& from, double progress) {}

bool Transform::Accumulate(const Transform& other) {}

void Transform::Round2dTranslationComponents() {}

void Transform::RoundToIdentityOrIntegerTranslation() {}

PointF Transform::MapPointInternal(const Matrix44& matrix,
                                   const PointF& point) const {}

Point3F Transform::MapPointInternal(const Matrix44& matrix,
                                    const Point3F& point) const {}

bool Transform::ApproximatelyEqual(const gfx::Transform& transform,
                                   float abs_translation_tolerance,
                                   float abs_other_tolerance,
                                   float rel_scale_tolerance) const {}

std::string Transform::ToString() const {}

std::string Transform::ToDecomposedString() const {}

}  // namespace gfx