=cut
*/
-#include "image.h"
+#include "imager.h"
#include <math.h> /* for floor() */
i_img *i_rotate90(i_img *src, int degrees) {
return out;
}
-i_img *i_matrix_transform_bg(i_img *src, int xsize, int ysize, double *matrix,
- i_color *backp, i_fcolor *fbackp) {
+i_img *i_matrix_transform_bg(i_img *src, int xsize, int ysize, const double *matrix,
+ const i_color *backp, const i_fcolor *fbackp) {
i_img *result = i_sametype(src, xsize, ysize);
int x, y;
int ch;
int i, j;
double sx, sy, sz;
- double out[3];
if (src->type == i_direct_type) {
if (src->bits == i_8_bits) {
sx = (x * matrix[0] + y * matrix[1] + matrix[2]) / sz;
sy = (x * matrix[3] + y * matrix[4] + matrix[5]) / sz;
}
+ else {
+ sx = sy = 0;
+ }
/* anything outside these ranges is either a broken co-ordinate
or outside the source */
sx = (x * matrix[0] + y * matrix[1] + matrix[2]) / sz;
sy = (x * matrix[3] + y * matrix[4] + matrix[5]) / sz;
}
+ else {
+ sx = sy = 0;
+ }
/* anything outside these ranges is either a broken co-ordinate
or outside the source */
sx = (x * matrix[0] + y * matrix[1] + matrix[2]) / sz;
sy = (x * matrix[3] + y * matrix[4] + matrix[5]) / sz;
}
+ else {
+ sx = sy = 0;
+ }
/* anything outside these ranges is either a broken co-ordinate
or outside the source */
return result;
}
-i_img *i_matrix_transform(i_img *src, int xsize, int ysize, double *matrix) {
+i_img *i_matrix_transform(i_img *src, int xsize, int ysize, const double *matrix) {
return i_matrix_transform_bg(src, xsize, ysize, matrix, NULL, NULL);
}
-
-i_matrix_mult(double *dest, double *left, double *right) {
+static void
+i_matrix_mult(double *dest, const double *left, const double *right) {
int i, j, k;
double accum;
}
i_img *i_rotate_exact_bg(i_img *src, double amount,
- i_color *backp, i_fcolor *fbackp) {
+ const i_color *backp, const i_fcolor *fbackp) {
double xlate1[9] = { 0 };
double rotate[9];
double xlate2[9] = { 0 };