Lines 125-131
Link Here
|
125 |
* hopelessly slow. |
125 |
* hopelessly slow. |
126 |
*/ |
126 |
*/ |
127 |
|
127 |
|
128 |
BITMAP *bitmap_convert_lsb8(Uchar *bits, int w, int h) |
128 |
BITMAP *bitmap_convert_lsb8(Uchar *bits, int w, int h, int stride) |
129 |
{ |
129 |
{ |
130 |
BITMAP *bm; |
130 |
BITMAP *bm; |
131 |
int i; |
131 |
int i; |
Lines 147-158
Link Here
|
147 |
for(i = 0; i < h; i++) { |
147 |
for(i = 0; i < h; i++) { |
148 |
#ifdef WORD_LITTLE_ENDIAN |
148 |
#ifdef WORD_LITTLE_ENDIAN |
149 |
memcpy(unit, curr, bytes); |
149 |
memcpy(unit, curr, bytes); |
150 |
curr += bytes; |
150 |
curr += stride; |
151 |
#else |
151 |
#else |
152 |
int j; |
152 |
int j; |
153 |
|
153 |
|
154 |
for(j = 0; j < bytes; curr++, j++) |
154 |
for(j = 0; j < bytes; curr++, j++) |
155 |
unit[j] = bit_swap[*curr]; |
155 |
unit[j] = bit_swap[*curr]; |
|
|
156 |
cur += stride - bytes; |
156 |
#endif |
157 |
#endif |
157 |
memzero(unit + bytes, bm->stride - bytes); |
158 |
memzero(unit + bytes, bm->stride - bytes); |
158 |
unit += bm->stride; |
159 |
unit += bm->stride; |
Lines 162-168
Link Here
|
162 |
return bm; |
163 |
return bm; |
163 |
} |
164 |
} |
164 |
|
165 |
|
165 |
BITMAP *bitmap_convert_msb8(Uchar *data, int w, int h) |
166 |
BITMAP *bitmap_convert_msb8(Uchar *data, int w, int h, int stride) |
166 |
{ |
167 |
{ |
167 |
BITMAP *bm; |
168 |
BITMAP *bm; |
168 |
Uchar *unit; |
169 |
Uchar *unit; |
Lines 180-188
Link Here
|
180 |
|
181 |
|
181 |
for(j = 0; j < bytes; curr++, j++) |
182 |
for(j = 0; j < bytes; curr++, j++) |
182 |
unit[j] = bit_swap[*curr]; |
183 |
unit[j] = bit_swap[*curr]; |
|
|
184 |
curr += stride - bytes; |
183 |
#else |
185 |
#else |
184 |
memcpy(unit, curr, bytes); |
186 |
memcpy(unit, curr, bytes); |
185 |
curr += bytes; |
187 |
curr += stride; |
186 |
#endif |
188 |
#endif |
187 |
memzero(unit + bytes, bm->stride - bytes); |
189 |
memzero(unit + bytes, bm->stride - bytes); |
188 |
unit += bm->stride; |
190 |
unit += bm->stride; |