Flutter Engine
 
Loading...
Searching...
No Matches
impeller::MatrixDecomposition Struct Reference

#include <matrix_decomposition.h>

Public Types

enum class  Component {
  kTranslation = 1 << 0 ,
  kScale = 1 << 1 ,
  kShear = 1 << 2 ,
  kPerspective = 1 << 3 ,
  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.

Member Function Documentation

◆ GetComponentsMask()

uint64_t impeller::MatrixDecomposition::GetComponentsMask ( ) const

Definition at line 433 of file matrix.cc.

433 {
434 uint64_t mask = 0;
435
436 Quaternion noRotation(0.0, 0.0, 0.0, 1.0);
437 if (rotation != noRotation) {
438 mask = mask | static_cast<uint64_t>(Component::kRotation);
439 }
440
441 Vector4 defaultPerspective(0.0, 0.0, 0.0, 1.0);
442 if (perspective != defaultPerspective) {
443 mask = mask | static_cast<uint64_t>(Component::kPerspective);
444 }
445
446 Shear noShear(0.0, 0.0, 0.0);
447 if (shear != noShear) {
448 mask = mask | static_cast<uint64_t>(Component::kShear);
449 }
450
451 Vector3 defaultScale(1.0, 1.0, 1.0);
452 if (scale != defaultScale) {
453 mask = mask | static_cast<uint64_t>(Component::kScale);
454 }
455
456 Vector3 defaultTranslation(0.0, 0.0, 0.0);
457 if (translation != defaultTranslation) {
458 mask = mask | static_cast<uint64_t>(Component::kTranslation);
459 }
460
461 return mask;
462}

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

Member Data Documentation

◆ perspective

Vector4 impeller::MatrixDecomposition::perspective

Definition at line 19 of file matrix_decomposition.h.

Referenced by impeller::Matrix::Decompose(), and GetComponentsMask().

◆ rotation

◆ scale

Vector3 impeller::MatrixDecomposition::scale

◆ shear

Shear impeller::MatrixDecomposition::shear

Definition at line 18 of file matrix_decomposition.h.

Referenced by impeller::Matrix::Decompose(), and GetComponentsMask().

◆ translation

Vector3 impeller::MatrixDecomposition::translation

The documentation for this struct was generated from the following files: