*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* Bitmap manipulation routines */
+#include <config.h>
#include <stdlib.h>
#include "mdvi.h"
* hopelessly slow.
*/
-BITMAP *bitmap_convert_lsb8(Uchar *bits, int w, int h)
+BITMAP *bitmap_convert_lsb8(Uchar *bits, int w, int h, int stride)
{
BITMAP *bm;
int i;
for(i = 0; i < h; i++) {
#ifdef WORD_LITTLE_ENDIAN
memcpy(unit, curr, bytes);
- curr += bytes;
+ curr += stride;
#else
int j;
for(j = 0; j < bytes; curr++, j++)
unit[j] = bit_swap[*curr];
+ cur += stride - bytes;
#endif
memzero(unit + bytes, bm->stride - bytes);
unit += bm->stride;
return bm;
}
-BITMAP *bitmap_convert_msb8(Uchar *data, int w, int h)
+BITMAP *bitmap_convert_msb8(Uchar *data, int w, int h, int stride)
{
BITMAP *bm;
Uchar *unit;
for(j = 0; j < bytes; curr++, j++)
unit[j] = bit_swap[*curr];
+ curr += stride - bytes;
#else
memcpy(unit, curr, bytes);
- curr += bytes;
+ curr += stride;
#endif
memzero(unit + bytes, bm->stride - bytes);
unit += bm->stride;