Fixed rendering for mupdf/poppler backend

This commit is contained in:
Moritz Lipp 2011-04-19 16:24:19 +02:00
parent a77ca6fef5
commit 07cc456ae9
3 changed files with 5 additions and 5 deletions

View file

@ -230,7 +230,7 @@ pdf_page_render(zathura_page_t* page)
for (unsigned int y = 0; y < pixmap->h; y++) {
for (unsigned int x = 0; x < pixmap->w; x++) {
unsigned char *s = pixmap->samples + y * pixmap->w * 4 + x * 4;
guchar* p = image_buffer->data + y * image_buffer->width + x;
guchar* p = image_buffer->data + y * image_buffer->rowstride + x * 3;
p[0] = s[0];
p[1] = s[1];
p[2] = s[2];

View file

@ -269,7 +269,7 @@ pdf_page_render(zathura_page_t* page)
return NULL;
}
poppler_page_render_to_pixbuf(page->data, 0, 0, page_width, page_height,
poppler_page_render_to_pixbuf(page->data, 0, 0, page->width, page->height,
page->document->scale, 0, pixbuf);
/* create image buffer */
@ -288,7 +288,7 @@ pdf_page_render(zathura_page_t* page)
for (unsigned int y = 0; y < page_height; y++) {
for (unsigned int x = 0; x < page_width; x++) {
unsigned char *s = pixels + y * rowstride + x * n_channels;
guchar* p = image_buffer->data + y * image_buffer->width + x;
guchar* p = image_buffer->data + y * image_buffer->rowstride + x * 3;
p[0] = s[0];
p[1] = s[1];
p[2] = s[2];

View file

@ -162,9 +162,9 @@ render(zathura_t* zathura, zathura_page_t* page)
unsigned char* src = image_buffer->data + y * image_buffer->rowstride;
for (unsigned int x = 0; x < page_width; x++) {
dst[0] = src[0];
dst[0] = src[2];
dst[1] = src[1];
dst[2] = src[2];
dst[2] = src[0];
src += 3;
dst += 4;
}