~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/imbuf/intern/ham.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 * ***** END GPL/BL DUAL LICENSE BLOCK *****
30
30
 * ham.c
31
31
 *
32
 
 * $Id: ham.c,v 1.5 2003/12/04 18:18:05 sirdude Exp $
 
32
 * $Id: ham.c,v 1.7 2005/01/10 16:22:40 sirdude Exp $
33
33
 */
34
34
 
35
35
#include "BLI_blenlib.h"
42
42
#include "IMB_hamx.h"
43
43
#include "IMB_ham.h"
44
44
 
45
 
#ifdef HAVE_CONFIG_H
46
 
#include <config.h>
47
 
#endif
48
 
 
49
45
extern short alpha_col0;
50
46
 
51
47
#define HAMB    0x0100
96
92
 
97
93
static void convhamscanl(short x, short y,
98
94
                                  unsigned char *rgbbase,
99
 
                                  unsigned char coltab[][4],
 
95
                                  unsigned char *coltab,
100
96
                                  short *deltab,
101
97
                                  short bits)
102
98
{
118
114
 
119
115
        if ((hambase = (unsigned short *) malloc((x+4) * sizeof(unsigned short)))==0) return;
120
116
 
121
 
        lb = coltab[0][1];
122
 
        lg = coltab[0][2];
123
 
        lr = coltab[0][3];
 
117
        lb = coltab[1];
 
118
        lg = coltab[2];
 
119
        lr = coltab[3];
124
120
        type = col = 0;
125
121
 
126
122
        ham = hambase;
194
190
                                lb = b;
195
191
                                break;
196
192
                        default:
197
 
                                lb = coltab[col][1];
198
 
                                lg = coltab[col][2];
199
 
                                lr = coltab[col][3];
 
193
                                lb = coltab[col*4 + 1];
 
194
                                lg = coltab[col*4 + 2];
 
195
                                lr = coltab[col*4 + 3];
200
196
                        }
201
197
                        *ham = type + col;
202
198
                } else *ham = HAMG + HAMFREE + g;
271
267
                IMB_dit2(ibuf, 2, 4);
272
268
                IMB_dit2(ibuf, 1, 4);
273
269
                IMB_dit2(ibuf, 0, 4);
274
 
                imb_convhamx(ibuf, coltab, deltab);
 
270
                imb_convhamx(ibuf, (uchar *)coltab, deltab);
275
271
        } else {
276
272
                for(;y > 0; y--){
277
 
                        convhamscanl(x, y, (uchar *)rect, coltab, deltab, ibuf->cbits);
 
273
                        convhamscanl(x, y, (uchar *)rect, (uchar *)coltab, deltab, ibuf->cbits);
278
274
                        rect += x;
279
275
                }
280
276
        }