static void create_matrix (OpTransform *op, GeglMatrix3 *matrix) { GeglChantOperation *chant = GEGL_CHANT_OPERATION (op); matrix->coeff [0][0] = chant->x; matrix->coeff [1][1] = chant->y; }
static void create_matrix (OpAffine *op, GeglMatrix3 matrix) { GeglChantOperation *chant = GEGL_CHANT_OPERATION (op); matrix [0][2] = chant->x; matrix [1][2] = chant->y; }
static void create_matrix (OpAffine *op, GeglMatrix3 matrix) { GeglChantOperation *chant = GEGL_CHANT_OPERATION (op); gdouble radians = chant->degrees * (2 * G_PI / 360.); matrix [0][0] = matrix [1][1] = cos (radians); matrix [0][1] = sin (radians); matrix [1][0] = - matrix [0][1]; }
static void create_matrix (OpAffine *op, GeglMatrix3 matrix) { GeglChantOperation *chant = GEGL_CHANT_OPERATION (op); gdouble ux=0, uy=0; gdouble l; ux = chant->x; uy = chant->y; l = sqrt(uy*uy + ux*ux); ux /= l; uy /= l; matrix [0][0] = 2*ux*ux - 1; matrix [1][1] = 2*uy*uy - 1; matrix [0][1] = matrix [1][0] = 2*ux*uy; }