PixelPerfectEngine.graphics.transformFunctions

Undocumented in source.

Members

Functions

reverseTransformFunctionFP
int[2] reverseTransformFunctionFP(int[2] xy, float[4] ABCD, int[4] x0y0, float[4] sXsY)

Reverse transform function, returns the point where a given texel needs to be written. The function reads as: [x',y'] = [A,B,C,D] * ([x,y] + [sX,sY] - [x_0,y_0]) + [x_0,y_0] ABCD: A/0: Horizontal scaling. 1 means no scaling at all, negative values end up in a mirrored image. B/1: Horizontal shearing. 0 means no shearing at all. C/2: Vertical shearing. 0 means no shearing at all. D/3: Vertical scaling. 1 means no scaling at all, negative values end up in a mirrored image. </ br> xy: Contains the screen coordinates. x:0 y:1 </ br> x0y0: Origin point. x_0:0/2 y_0:1/3 </ br> sXsY: Scrolling point. sX:0/2 sY:1/3

rotateFunction
short[4] rotateFunction(double theta, short[4] input)

Relative rotation clockwise by given degrees. Returns the new transform points. </ br> theta: Degrees of clockwise rotation. </ br> input: Input of the transform points at 0 degrees.

transformFunctionFP
int[2] transformFunctionFP(int[2] xy, float[4] ABCD, float[4] x0y0, int[4] sXsY)

Main transform function, returns the point where the pixel is needed to be read from. The function reads as: [x',y'] = [A,B,C,D] * ([x,y] + [sX,sY] - [x_0,y_0]) + [x_0,y_0] ABCD: A/0: Horizontal scaling. 1 means no scaling at all, negative values end up in a mirrored image. B/1: Horizontal shearing. 0 means no shearing at all. C/2: Vertical shearing. 0 means no shearing at all. D/3: Vertical scaling. 1 means no scaling at all, negative values end up in a mirrored image. </ br> xy: Contains the screen coordinates. x:0 y:1 </ br> x0y0: Origin point. x_0:0/2 y_0:1/3 </ br> sXsY: Scrolling point. sX:0/2 sY:1/3

transformFunctionInt
int[2] transformFunctionInt(short[2] xy, short[4] ABCD, short[2] x0y0, short[2] sXsY)

Main transform function with fixed point aritmetics. Returns the point where the pixel is needed to be read from. 256 equals with 1. The function reads as: [x',y'] = ([A,B,C,D] * ([x,y] + [sX,sY] - [x_0,y_0]))>>>8 + [x_0,y_0] ABCD: A/0: Horizontal scaling. 256 means no scaling at all, negative values end up in a mirrored image. B/1: Horizontal shearing. 0 means no shearing at all. C/2: Vertical shearing. 0 means no shearing at all. D/3: Vertical scaling. 256 means no scaling at all, negative values end up in a mirrored image. </ br> xy: Contains the screen coordinates. x:0 y:1 </ br> x0y0: Origin point. x_0:0/2 y_0:1/3 </ br> sXsY: Scrolling point. sX:0/2 sY:1/3

Static variables

maskAC
uint[4] maskAC;
Undocumented in source.

Meta