~ubuntu-branches/ubuntu/oneiric/gimp/oneiric-security

« back to all changes in this revision

Viewing changes to plug-ins/common/compose.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2010-07-12 15:08:08 UTC
  • mfrom: (1.1.23) (0.4.6 sid)
  • Revision ID: package-import@ubuntu.com-20100712150808-db9xqgtxrvpyl3g2
Tags: 2.6.10-1ubuntu1
Resync on Debian, dropping changes which are in the new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1153
1153
  register const guchar *black_src   = src[3];
1154
1154
  register       guchar *rgb_dst     = dst;
1155
1155
  register       gint    count       = numpix;
1156
 
  gint cyan, magenta, yellow, black;
1157
 
  gint cyan_incr    = incr_src[0];
1158
 
  gint magenta_incr = incr_src[1];
1159
 
  gint yellow_incr  = incr_src[2];
1160
 
  gint black_incr   = incr_src[3];
 
1156
  gint    cyan_incr    = incr_src[0];
 
1157
  gint    magenta_incr = incr_src[1];
 
1158
  gint    yellow_incr  = incr_src[2];
 
1159
  gint    black_incr   = incr_src[3];
 
1160
  GimpRGB grgb;
 
1161
 
 
1162
  gimp_rgb_set (&grgb, 0, 0, 0);
1161
1163
 
1162
1164
  while (count-- > 0)
1163
1165
    {
1164
 
      black = (gint)*black_src;
1165
 
      if (black)
1166
 
        {
1167
 
          cyan    = (gint) *cyan_src;
1168
 
          magenta = (gint) *magenta_src;
1169
 
          yellow  = (gint) *yellow_src;
1170
 
 
1171
 
          cyan    += black; if (cyan > 255) cyan = 255;
1172
 
          magenta += black; if (magenta > 255) magenta = 255;
1173
 
          yellow  += black; if (yellow > 255) yellow = 255;
1174
 
 
1175
 
          *(rgb_dst++) = 255 - cyan;
1176
 
          *(rgb_dst++) = 255 - magenta;
1177
 
          *(rgb_dst++) = 255 - yellow;
1178
 
        }
1179
 
      else
1180
 
        {
1181
 
          *(rgb_dst++) = 255 - *cyan_src;
1182
 
          *(rgb_dst++) = 255 - *magenta_src;
1183
 
          *(rgb_dst++) = 255 - *yellow_src;
1184
 
        }
1185
 
      cyan_src += cyan_incr;
 
1166
      GimpCMYK gcmyk;
 
1167
      guchar   r, g, b;
 
1168
 
 
1169
      gimp_cmyk_set_uchar (&gcmyk,
 
1170
                           *cyan_src, *magenta_src, *yellow_src, *black_src);
 
1171
      gimp_cmyk_to_rgb (&gcmyk, &grgb);
 
1172
      gimp_rgb_get_uchar (&grgb, &r, &g, &b);
 
1173
 
 
1174
      *rgb_dst++ = r;
 
1175
      *rgb_dst++ = g;
 
1176
      *rgb_dst++ = b;
 
1177
 
 
1178
      cyan_src    += cyan_incr;
1186
1179
      magenta_src += magenta_incr;
1187
 
      yellow_src += yellow_incr;
1188
 
      black_src += black_incr;
 
1180
      yellow_src  += yellow_incr;
 
1181
      black_src   += black_incr;
1189
1182
 
1190
1183
      if (dst_has_alpha)
1191
1184
        rgb_dst++;