X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=backend%2Fdvi%2Fmdvi-lib%2Fbitmap.c;h=53f21207613f11a8b88515a10b0cc098113b7f63;hb=df0507d95502ee017b49ae3e19f75cfe64f2b04b;hp=9014dba6000d821cf7e3f4ca42061fa76c19cdcf;hpb=13a06349251874bd35d2f03c3fc93217cee749a2;p=evince.git diff --git a/backend/dvi/mdvi-lib/bitmap.c b/backend/dvi/mdvi-lib/bitmap.c index 9014dba6..53f21207 100644 --- a/backend/dvi/mdvi-lib/bitmap.c +++ b/backend/dvi/mdvi-lib/bitmap.c @@ -13,11 +13,12 @@ * * 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 #include #include "mdvi.h" @@ -124,7 +125,7 @@ static Uchar bit_swap[] = { * 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; @@ -146,12 +147,13 @@ BITMAP *bitmap_convert_lsb8(Uchar *bits, int w, int h) 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; @@ -161,7 +163,7 @@ BITMAP *bitmap_convert_lsb8(Uchar *bits, int w, int h) 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; @@ -179,9 +181,10 @@ BITMAP *bitmap_convert_msb8(Uchar *data, int w, int h) 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;