Change to the linux kernel coding style
[wmaker-crm.git] / plugins / libwmfun / bilinear.c
index 3d9632d..148d7a1 100644 (file)
 
 #include "generic.h"
 
-RImage *bilinear (int argc, char **argv, int width, int height,
-       int relief) {
+RImage *bilinear(int argc, char **argv, int width, int height, int relief)
+{
 
        int color[4][3];
        RImage *image;
        unsigned char *cptr;
        int i, j, k;
 
-       argc--; argv++;
+       argc--;
+       argv++;
 
-       if (!start_image ("bilinear", argc, 4, 5, width, height, &image)) {
-               return (RImage *)0;
+       if (!start_image("bilinear", argc, 4, 5, width, height, &image)) {
+               return (RImage *) 0;
        }
 
-       for (i=0; i<4; i++) {
-               if (!parse_color (argv[i], color[i])) {
-                       error ("can't parse color: \"%s\"\n", argv[i]);
+       for (i = 0; i < 4; i++) {
+               if (!parse_color(argv[i], color[i])) {
+                       error("can't parse color: \"%s\"\n", argv[i]);
                        return 0;
                }
        }
 
        cptr = image->data;
-    for (i=0; i<height; i++) {
+       for (i = 0; i < height; i++) {
                int b = 0xff * i / height;
                int t = 0xff - b;
 
-               for (j=0; j<width; j++) {
+               for (j = 0; j < width; j++) {
                        int r = 0xff * j / width;
                        int l = 0xff - r;
                        int f[4];
 
-                       f[0] = (l*t) >> 8;
-                       f[1] = (r*t) >> 8;
-                       f[2] = (l*b) >> 8;
-                       f[3] = (r*b) >> 8;
+                       f[0] = (l * t) >> 8;
+                       f[1] = (r * t) >> 8;
+                       f[2] = (l * b) >> 8;
+                       f[3] = (r * b) >> 8;
 
-                       for (k=0; k<3; k++) {
+                       for (k = 0; k < 3; k++) {
                                *cptr++ =
-                                       ( f[0] * color[0][k] +
-                                         f[1] * color[1][k] +
-                                         f[2] * color[2][k] +
-                                         f[3] * color[3][k] ) >> 8;
+                                   (f[0] * color[0][k] +
+                                    f[1] * color[1][k] + f[2] * color[2][k] + f[3] * color[3][k]) >> 8;
                        }
 
-                       if (RRGBAFormat==image->format)
+                       if (RRGBAFormat == image->format)
                                cptr++;
                }
        }
        return image;
 }
-