Flutter Impeller
impeller::MatrixDecomposition Struct Reference

#include <matrix_decomposition.h>

Public Types

enum  Component {
  Component::kTranslation = 1 << 0,
  Component::kScale = 1 << 1,
  Component::kShear = 1 << 2,
  Component::kPerspective = 1 << 3,
  Component::kRotation = 1 << 4
}
 

Public Member Functions

uint64_t GetComponentsMask () const
 

Public Attributes

Vector3 translation
 
Vector3 scale
 
Shear shear
 
Vector4 perspective
 
Quaternion rotation
 

Detailed Description

Definition at line 14 of file matrix_decomposition.h.

Member Enumeration Documentation

◆ Component

Enumerator
kTranslation 
kScale 
kShear 
kPerspective 
kRotation 

Definition at line 21 of file matrix_decomposition.h.

21  {
22  kTranslation = 1 << 0,
23  kScale = 1 << 1,
24  kShear = 1 << 2,
25  kPerspective = 1 << 3,
26  kRotation = 1 << 4,
27  };

Member Function Documentation

◆ GetComponentsMask()

uint64_t impeller::MatrixDecomposition::GetComponentsMask ( ) const

Definition at line 378 of file matrix.cc.

378  {
379  uint64_t mask = 0;
380 
381  Quaternion noRotation(0.0, 0.0, 0.0, 1.0);
382  if (rotation != noRotation) {
383  mask = mask | static_cast<uint64_t>(Component::kRotation);
384  }
385 
386  Vector4 defaultPerspective(0.0, 0.0, 0.0, 1.0);
387  if (perspective != defaultPerspective) {
388  mask = mask | static_cast<uint64_t>(Component::kPerspective);
389  }
390 
391  Shear noShear(0.0, 0.0, 0.0);
392  if (shear != noShear) {
393  mask = mask | static_cast<uint64_t>(Component::kShear);
394  }
395 
396  Vector3 defaultScale(1.0, 1.0, 1.0);
397  if (scale != defaultScale) {
398  mask = mask | static_cast<uint64_t>(Component::kScale);
399  }
400 
401  Vector3 defaultTranslation(0.0, 0.0, 0.0);
402  if (translation != defaultTranslation) {
403  mask = mask | static_cast<uint64_t>(Component::kTranslation);
404  }
405 
406  return mask;
407 }

References kPerspective, kRotation, kScale, kShear, kTranslation, perspective, rotation, scale, shear, and translation.

Member Data Documentation

◆ perspective

Vector4 impeller::MatrixDecomposition::perspective

◆ rotation

◆ scale

◆ shear

Shear impeller::MatrixDecomposition::shear

◆ translation


The documentation for this struct was generated from the following files:
impeller::MatrixDecomposition::Component::kPerspective
@ kPerspective
impeller::MatrixDecomposition::shear
Shear shear
Definition: matrix_decomposition.h:17
impeller::MatrixDecomposition::Component::kScale
@ kScale
impeller::MatrixDecomposition::Component::kTranslation
@ kTranslation
impeller::MatrixDecomposition::perspective
Vector4 perspective
Definition: matrix_decomposition.h:18
impeller::MatrixDecomposition::translation
Vector3 translation
Definition: matrix_decomposition.h:15
impeller::MatrixDecomposition::Component::kShear
@ kShear
impeller::MatrixDecomposition::rotation
Quaternion rotation
Definition: matrix_decomposition.h:19
impeller::MatrixDecomposition::scale
Vector3 scale
Definition: matrix_decomposition.h:16
impeller::MatrixDecomposition::Component::kRotation
@ kRotation