ROPO
Loading...
Searching...
No Matches
fmi_image_arith.c
1
22#include "fmi_image.h"
23
24void image_average_horz(FmiImage *source,FmiImage *vert){
25 register int i,j;
26 int sum;
27
28 /* risky? */
29 if ((vert->width!=1)||(vert->height!=source->height))
30 initialize_vert_stripe(vert,source->height);
31
32 /* for (k=0;k<source->;k++){ */
33 for (j=0;j<source->height;j++){
34 sum=0;
35 for (i=0;i<source->width;i++)
36 sum+=get_pixel(source,i,j,0);
37 put_pixel_direct(vert,j,sum/source->width);
38 /* put_pixel(vert,0,j,0,sum/source->width); */
39 /*
40 put_pixel(source,sum/255,j,0,255);
41 put_pixel(source,sum/255+1,j,0,0);
42 put_pixel(source,sum/255-1,j,0,0);
43 */
44 }
45
46}
47
48void image_average_vert(FmiImage *source,FmiImage *vert){
49 register int i,j;
50 int sum;
51
52 /* risky? */
53 if ((vert->width!=1)||(vert->height!=source->height))
54 initialize_vert_stripe(vert,source->height);
55
56 /* for (k=0;k<source->;k++){ */
57 for (j=0;j<source->height;j++){
58 sum=0;
59 for (i=0;i<source->width;i++)
60 sum+=get_pixel(source,i,j,0);
61 put_pixel_direct(vert,j,sum/source->width);
62 }
63}
64