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 15 of file matrix_decomposition.h.

Member Enumeration Documentation

◆ Component

Enumerator
kTranslation 
kScale 
kShear 
kPerspective 
kRotation 

Definition at line 22 of file matrix_decomposition.h.

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

Member Function Documentation

◆ GetComponentsMask()

uint64_t impeller::MatrixDecomposition::GetComponentsMask ( ) const

Definition at line 370 of file matrix.cc.

370  {
371  uint64_t mask = 0;
372 
373  Quaternion noRotation(0.0, 0.0, 0.0, 1.0);
374  if (rotation != noRotation) {
375  mask = mask | static_cast<uint64_t>(Component::kRotation);
376  }
377 
378  Vector4 defaultPerspective(0.0, 0.0, 0.0, 1.0);
379  if (perspective != defaultPerspective) {
380  mask = mask | static_cast<uint64_t>(Component::kPerspective);
381  }
382 
383  Shear noShear(0.0, 0.0, 0.0);
384  if (shear != noShear) {
385  mask = mask | static_cast<uint64_t>(Component::kShear);
386  }
387 
388  Vector3 defaultScale(1.0, 1.0, 1.0);
389  if (scale != defaultScale) {
390  mask = mask | static_cast<uint64_t>(Component::kScale);
391  }
392 
393  Vector3 defaultTranslation(0.0, 0.0, 0.0);
394  if (translation != defaultTranslation) {
395  mask = mask | static_cast<uint64_t>(Component::kTranslation);
396  }
397 
398  return mask;
399 }

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:18
impeller::MatrixDecomposition::Component::kScale
@ kScale
impeller::MatrixDecomposition::Component::kTranslation
@ kTranslation
impeller::MatrixDecomposition::perspective
Vector4 perspective
Definition: matrix_decomposition.h:19
impeller::MatrixDecomposition::translation
Vector3 translation
Definition: matrix_decomposition.h:16
impeller::MatrixDecomposition::Component::kShear
@ kShear
impeller::MatrixDecomposition::rotation
Quaternion rotation
Definition: matrix_decomposition.h:20
impeller::MatrixDecomposition::scale
Vector3 scale
Definition: matrix_decomposition.h:17
impeller::MatrixDecomposition::Component::kRotation
@ kRotation