Public Member Functions | Static Public Member Functions

nsStyleTransformMatrix Class Reference

#include <nsStyleTransformMatrix.h>

List of all members.

Public Member Functions

 nsStyleTransformMatrix ()
 Constructor sets the matrix to the identity.
gfxMatrix GetThebesMatrix (const nsRect &aBounds, float aFactor) const
 Given a frame's bounding rectangle, returns a gfxMatrix corresponding to the transformation represented by this matrix.
nsStyleTransformMatrixoperator*= (const nsStyleTransformMatrix &aOther)
 Multiplies this matrix by another matrix, in that order.
const nsStyleTransformMatrix operator* (const nsStyleTransformMatrix &aOther) const
 Returns a new nsStyleTransformMatrix that is equal to one matrix multiplied by another matrix, in that order.
void SetToTransformFunction (const nsCSSValue::Array *aData, nsStyleContext *aContext, nsPresContext *aPresContext, PRBool &aCanStoreInRuleTree)
 Given an nsCSSValue::Array* containing a -moz-transform function, updates this matrix to hold the value of that function.
void SetToIdentity ()
 Sets this matrix to be the identity matrix.
float GetMainMatrixEntry (PRInt32 aIndex) const
 Returns the value of the entry at the 2x2 submatrix of the transform matrix that defines the non-affine linear transform.
nscoord GetXTranslation (const nsRect &aBounds) const
 Returns the value of the X or Y translation component of the matrix, given the specified bounds.
nscoord GetYTranslation (const nsRect &aBounds) const
nscoord GetCoordXTranslation () const
 Get the raw components used for GetXTranslation and GetYTranslation.
nscoord GetCoordYTranslation () const
float GetWidthRelativeXTranslation () const
float GetWidthRelativeYTranslation () const
float GetHeightRelativeXTranslation () const
float GetHeightRelativeYTranslation () const
PRBool operator== (const nsStyleTransformMatrix &aOther) const
 Returns whether the two matrices are equal or not.
PRBool operator!= (const nsStyleTransformMatrix &aOther) const

Static Public Member Functions

static nsCSSKeyword TransformFunctionOf (const nsCSSValue::Array *aData)
 Return the transform function, as an nsCSSKeyword, for the given nsCSSValue::Array from a transform list.
static nsStyleTransformMatrix ReadTransforms (const nsCSSValueList *aList, nsStyleContext *aContext, nsPresContext *aPresContext, PRBool &aCanStoreInRuleTree)
 The same as SetToTransformFunction, but for a list of transform functions.

Constructor & Destructor Documentation

nsStyleTransformMatrix::nsStyleTransformMatrix (  ) 

Constructor sets the matrix to the identity.


Member Function Documentation

nscoord nsStyleTransformMatrix::GetCoordXTranslation (  )  const [inline]

Get the raw components used for GetXTranslation and GetYTranslation.

nscoord nsStyleTransformMatrix::GetCoordYTranslation (  )  const [inline]
float nsStyleTransformMatrix::GetHeightRelativeXTranslation (  )  const [inline]
float nsStyleTransformMatrix::GetHeightRelativeYTranslation (  )  const [inline]
float nsStyleTransformMatrix::GetMainMatrixEntry ( PRInt32  aIndex  )  const [inline]

Returns the value of the entry at the 2x2 submatrix of the transform matrix that defines the non-affine linear transform.

The order is given as |elem[0] elem[2]| |elem[1] elem[3]|

Parameters:
aIndex The element index.
Returns:
The value of the element at that index.
gfxMatrix nsStyleTransformMatrix::GetThebesMatrix ( const nsRect aBounds,
float  aFactor 
) const

Given a frame's bounding rectangle, returns a gfxMatrix corresponding to the transformation represented by this matrix.

The transformation takes points in the frame's local space and converts them to points in the frame's transformed space.

Parameters:
aBounds The frame's bounding rectangle.
aFactor The number of app units per device pixel.
Returns:
A Thebes matrix corresponding to the transform.
float nsStyleTransformMatrix::GetWidthRelativeXTranslation (  )  const [inline]
float nsStyleTransformMatrix::GetWidthRelativeYTranslation (  )  const [inline]
nscoord nsStyleTransformMatrix::GetXTranslation ( const nsRect aBounds  )  const

Returns the value of the X or Y translation component of the matrix, given the specified bounds.

Parameters:
aBounds The bounds of the element.
Returns:
The value of the X or Ytranslation component.
nscoord nsStyleTransformMatrix::GetYTranslation ( const nsRect aBounds  )  const
PRBool nsStyleTransformMatrix::operator!= ( const nsStyleTransformMatrix aOther  )  const [inline]
const nsStyleTransformMatrix nsStyleTransformMatrix::operator* ( const nsStyleTransformMatrix aOther  )  const

Returns a new nsStyleTransformMatrix that is equal to one matrix multiplied by another matrix, in that order.

If C is the result of A * B, then for any vector x, the equivalence C(x) = A(B(x)).

Parameters:
aOther The matrix to multiply this matrix by.
Returns:
A new nsStyleTransformMatrix equal to this matrix multiplied by the other matrix.
nsStyleTransformMatrix& nsStyleTransformMatrix::operator*= ( const nsStyleTransformMatrix aOther  ) 

Multiplies this matrix by another matrix, in that order.

If A' is the value of A after A *= B, then for any vector x, the equivalence A'(x) == A(B(x)) holds.

Parameters:
aOther The matrix to multiply this matrix by.
Returns:
A reference to this matrix.
PRBool nsStyleTransformMatrix::operator== ( const nsStyleTransformMatrix aOther  )  const

Returns whether the two matrices are equal or not.

Parameters:
aOther The matrix to compare to.
Returns:
Whether the two matrices are equal.
static nsStyleTransformMatrix nsStyleTransformMatrix::ReadTransforms ( const nsCSSValueList aList,
nsStyleContext aContext,
nsPresContext aPresContext,
PRBool aCanStoreInRuleTree 
) [static]

The same as SetToTransformFunction, but for a list of transform functions.

void nsStyleTransformMatrix::SetToIdentity (  ) 

Sets this matrix to be the identity matrix.

void nsStyleTransformMatrix::SetToTransformFunction ( const nsCSSValue::Array aData,
nsStyleContext aContext,
nsPresContext aPresContext,
PRBool aCanStoreInRuleTree 
)

Given an nsCSSValue::Array* containing a -moz-transform function, updates this matrix to hold the value of that function.

Parameters:
aData The nsCSSValue::Array* containing the transform function.
aContext The style context, used for unit conversion.
aPresContext The presentation context, used for unit conversion.
aCanStoreInRuleTree Set to false if the result cannot be cached in the rule tree, otherwise untouched.

aContext and aPresContext may be null if all of the (non-percent) length values in aData are already known to have been converted to eCSSUnit_Pixel (as they are in an nsStyleAnimation::Value)

static nsCSSKeyword nsStyleTransformMatrix::TransformFunctionOf ( const nsCSSValue::Array aData  )  [static]

Return the transform function, as an nsCSSKeyword, for the given nsCSSValue::Array from a transform list.


The documentation for this class was generated from the following file: