=cut
*/
-#ifdef _MSC_VER
+#ifdef WIN32
/* random() is non-ASCII, even if it is better than rand() */
#define random() rand()
#endif
int vx, vy, ch;
i_color val, wval;
- for(vx=0;vx<128;vx++) for(vy=0;vy<110;vy++) {
+ int mx = wmark->xsize;
+ int my = wmark->ysize;
+
+ for(vx=0;vx<mx;vx++) for(vy=0;vy<my;vy++) {
i_gpix(im, tx+vx, ty+vy,&val );
i_gpix(wmark, vx, vy, &wval);
i_img *out;
int outchans, diffchans;
int xsize, ysize;
- i_img temp;
i_clear_error();
if (im1->channels != im2->channels) {
for (y = 0; y < ysize; ++y) {
i_glin(im1, 0, xsize, y, line1);
i_glin(im2, 0, xsize, y, line2);
+ if (outchans != diffchans) {
+ /* give the output an alpha channel since it doesn't have one */
+ for (x = 0; x < xsize; ++x)
+ line2[x].channel[diffchans] = 255;
+ }
for (x = 0; x < xsize; ++x) {
int diff = 0;
for (ch = 0; ch < diffchans; ++ch) {
for (y = 0; y < ysize; ++y) {
i_glinf(im1, 0, xsize, y, line1);
i_glinf(im2, 0, xsize, y, line2);
+ if (outchans != diffchans) {
+ /* give the output an alpha channel since it doesn't have one */
+ for (x = 0; x < xsize; ++x)
+ line2[x].channel[diffchans] = 1.0;
+ }
for (x = 0; x < xsize; ++x) {
int diff = 0;
for (ch = 0; ch < diffchans; ++ch) {