diff options
author | Kent Mein <mein@cs.umn.edu> | 2005-01-10 19:22:40 +0300 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2005-01-10 19:22:40 +0300 |
commit | 3c592ec3ad40cd3809890f3532875a609c635fb3 (patch) | |
tree | aef5e4a5a9779eda429b0ca4c3d21dc402ead55c /source/blender/imbuf/intern/ham.c | |
parent | d1d8950eac2e0cbdbbf97e5b893f72a4fdca3b12 (diff) |
This is for bug # 2068
I standarized the returns on a failed opening of the output file for
the above image formats.
I also cleaned up a couple of warnings.
Kent
Diffstat (limited to 'source/blender/imbuf/intern/ham.c')
-rw-r--r-- | source/blender/imbuf/intern/ham.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/imbuf/intern/ham.c b/source/blender/imbuf/intern/ham.c index 383c79334bc..de1d504980e 100644 --- a/source/blender/imbuf/intern/ham.c +++ b/source/blender/imbuf/intern/ham.c @@ -92,7 +92,7 @@ static void addhamdither(short x, unsigned char *dit, static void convhamscanl(short x, short y, unsigned char *rgbbase, - unsigned char coltab[][4], + unsigned char *coltab, short *deltab, short bits) { @@ -114,9 +114,9 @@ static void convhamscanl(short x, short y, if ((hambase = (unsigned short *) malloc((x+4) * sizeof(unsigned short)))==0) return; - lb = coltab[0][1]; - lg = coltab[0][2]; - lr = coltab[0][3]; + lb = coltab[1]; + lg = coltab[2]; + lr = coltab[3]; type = col = 0; ham = hambase; @@ -190,9 +190,9 @@ static void convhamscanl(short x, short y, lb = b; break; default: - lb = coltab[col][1]; - lg = coltab[col][2]; - lr = coltab[col][3]; + lb = coltab[col*4 + 1]; + lg = coltab[col*4 + 2]; + lr = coltab[col*4 + 3]; } *ham = type + col; } else *ham = HAMG + HAMFREE + g; @@ -267,10 +267,10 @@ short imb_converttoham(struct ImBuf *ibuf) IMB_dit2(ibuf, 2, 4); IMB_dit2(ibuf, 1, 4); IMB_dit2(ibuf, 0, 4); - imb_convhamx(ibuf, coltab, deltab); + imb_convhamx(ibuf, (uchar *)coltab, deltab); } else { for(;y > 0; y--){ - convhamscanl(x, y, (uchar *)rect, coltab, deltab, ibuf->cbits); + convhamscanl(x, y, (uchar *)rect, (uchar *)coltab, deltab, ibuf->cbits); rect += x; } } |