Apply an affine transform to a 2D sprite?

Is there a way to apply an arbitary affine transform as a 3-by-3 matrix to a 2D sprite.

I’m looking for the equivalent of what can be done with, say, C#'s System.Drawing.Drawing2D.Matrix class. I see there is a cocos2d-x sturct called “AffineTransform” but not sure how to apply one to a sprite.

I want to be able to represent the entire state of the sprite with one of these if it is possible.

Yes, you can do that using the following APIs:

   // cocos2d::Node API:
    virtual void setNodeToParentTransform(const Mat4& transform);