Changeset 3545
 Timestamp:
 Jul 9, 2009, 1:38:32 AM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

libpipi/trunk/pipi/combine/merge.c
r3411 r3545 29 29 pipi_pixels_t *img1p, *img2p, *dstp; 30 30 float *img1data, *img2data, *dstdata; 31 double t2;32 31 int x, y, w, h; 33 32 … … 39 38 else if(t > 1.0) 40 39 t = 1.0; 41 t2 = 1.0  t;42 40 43 41 w = img1>w; … … 58 56 { 59 57 float p, q; 58 double t1 = t * img2data[4 * (y * w + x) + 3]; 59 double t2 = 1.0  t1; 60 60 61 61 p = img1data[4 * (y * w + x)]; 62 62 q = img2data[4 * (y * w + x)]; 63 dstdata[4 * (y * w + x)] = t * p + t2* q;63 dstdata[4 * (y * w + x)] = t2 * p + t1 * q; 64 64 65 65 p = img1data[4 * (y * w + x) + 1]; 66 66 q = img2data[4 * (y * w + x) + 1]; 67 dstdata[4 * (y * w + x) + 1] = t * p + t2* q;67 dstdata[4 * (y * w + x) + 1] = t2 * p + t1 * q; 68 68 69 69 p = img1data[4 * (y * w + x) + 2]; 70 70 q = img2data[4 * (y * w + x) + 2]; 71 dstdata[4 * (y * w + x) + 2] = t * p + t2* q;71 dstdata[4 * (y * w + x) + 2] = t2 * p + t1 * q; 72 72 73 73 p = img1data[4 * (y * w + x) + 3]; 74 74 q = img2data[4 * (y * w + x) + 3]; 75 dstdata[4 * (y * w + x) + 3] = t * p + t2* q;75 dstdata[4 * (y * w + x) + 3] = t2 * p + t1 * q; 76 76 } 77 77 }
Note: See TracChangeset
for help on using the changeset viewer.