/[xforms]/xforms/image/image_combine.c
ViewVC logotype

Diff of /xforms/image/image_combine.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by leeming, Thu Apr 24 09:35:34 2003 UTC revision 1.4 by leeming, Tue Sep 9 00:28:25 2003 UTC
# Line 31  Line 31 
31   *   *
32   *   *
33   * combine two images in the following way   * combine two images in the following way
34   *   IM = IM1 * alpha + IM2 * (1-alpha)   *   IM = IM1 * alpha + IM2 * (1-alpha)
35   *   *
36   */   */
37    
38    
39  /*** UNFINISHED and UNTESTED */  /*** UNFINISHED and UNTESTED */
40  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
# Line 64  FL_IMAGE* flimage_combine(FL_IMAGE *im1, Line 64  FL_IMAGE* flimage_combine(FL_IMAGE *im1,
64      ret->type = FLIMAGE_RGB;      ret->type = FLIMAGE_RGB;
65    
66      flimage_get_linearlut(ret);      flimage_get_linearlut(ret);
67      
68      /* convert to RGB */      /* convert to RGB */
69      flimage_convert(im1, FLIMAGE_RGB, 0);      flimage_convert(im1, FLIMAGE_RGB, 0);
70      flimage_convert(im2, FLIMAGE_RGB, 0);      flimage_convert(im2, FLIMAGE_RGB, 0);
# Line 82  FL_IMAGE* flimage_combine(FL_IMAGE *im1, Line 82  FL_IMAGE* flimage_combine(FL_IMAGE *im1,
82      {      {
83           for ( x = 0; x < w; x++)           for ( x = 0; x < w; x++)
84           {           {
85               ret->red[y][x] = ret->llut[0][im1->red[y][x]] +               ret->red[y][x] = ret->llut[0][im1->red[y][x]] +
86                                ret->llut[1][im2->red[y][x]];                                ret->llut[1][im2->red[y][x]];
87               ret->green[y][x] = ret->llut[0][im1->green[y][x]] +               ret->green[y][x] = ret->llut[0][im1->green[y][x]] +
88                                  ret->llut[1][im2->green[y][x]];                                  ret->llut[1][im2->green[y][x]];
89               ret->blue[y][x] = ret->llut[0][im1->blue[y][x]] +               ret->blue[y][x] = ret->llut[0][im1->blue[y][x]] +
90                                 ret->llut[1][im2->blue[y][x]];                                 ret->llut[1][im2->blue[y][x]];
91           }           }
92    
# Line 106  FL_IMAGE* flimage_combine(FL_IMAGE *im1, Line 106  FL_IMAGE* flimage_combine(FL_IMAGE *im1,
106              ret->green[y][x] = im1->green[y][x];              ret->green[y][x] = im1->green[y][x];
107              ret->blue[y][x] = im1->blue[y][x];              ret->blue[y][x] = im1->blue[y][x];
108           }           }
109        }        }
110    
111       return ret;       return ret;
112  }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26