updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / gnome-scan / gegl-0.1.0.patch
blobb49489efde308e50472bab6a95fa9433cca24938
1 From 72bdbb12db5ca5284767d3011b1144bf142758e0 Mon Sep 17 00:00:00 2001
2 From: Manuel Osdoba <manuel.osdoba@tu-ilmenau.de>
3 Date: Sun, 21 Mar 2010 11:00:22 +0000
4 Subject: Support Babl 0.1.0 as well
6 ---
7 diff --git a/modules/gsane/gsane-processor.c b/modules/gsane/gsane-processor.c
8 index cb3526c..c129d18 100644
9 --- a/modules/gsane/gsane-processor.c
10 +++ b/modules/gsane/gsane-processor.c
11 @@ -22,6 +22,7 @@
12 #include "gsane-processor.h"
13 #include <string.h>
14 #include <math.h>
15 +#include <config.h>
17 typedef void (*GSaneProcessorFunc) (GSaneProcessor *self, guchar *buf, guint buf_len);
19 @@ -118,7 +119,7 @@ gsane_processor_process_nbit(GSaneProcessor *self, guchar *buf, guint buf_len)
20 operation */
21 guint src_pos;
22 guint offset;
23 - guchar *src, *dest, *buf8 = g_new0(guchar, self->priv->pixels_in_buf * self->priv->format->format.bytes_per_pixel);
24 + guchar *src, *dest, *buf8 = g_new0(guchar, self->priv->pixels_in_buf * babl_format_get_bytes_per_pixel(self->priv->format));
25 guint samples_in_buf = self->priv->pixels_in_buf * self->priv->sample_count;
26 for (i = 0 ; i < samples_in_buf ; i++) {
27 /* compute the address of the first byte container sample value */
28 @@ -180,7 +185,7 @@ gsane_processor_process_three_pass_8bit(GSaneProcessor *self, guchar *buf, guint
29 /* pos of pixel i in buf */
30 src_pos = i * self->priv->bytes_per_pixel;
31 /* pos of pixel i in buf3 */
32 - dest_pos = i * self->priv->format->format.bytes_per_pixel + self->priv->sample_offset;
33 + dest_pos = i * babl_format_get_bytes_per_pixel(self->priv->format) + self->priv->sample_offset;
34 /* save */
35 memcpy(buf3+dest_pos, buf+src_pos, self->priv->bytes_per_pixel);
37 @@ -368,7 +377,7 @@ gsane_processor_prepare_image(GSaneProcessor *self, SANE_Parameters* params, gui
38 self->priv->format = gsane_processor_get_babl_format(self);
39 g_return_val_if_fail(self->priv->format, NULL);
41 - self->priv->sample_stride = self->priv->format->format.bytes_per_pixel / MAX(self->priv->sample_count, self->priv->frame_count);
42 + self->priv->sample_stride = babl_format_get_bytes_per_pixel(self->priv->format) / MAX(self->priv->sample_count, self->priv->frame_count);
43 self->priv->max_target_sample_value= (0xFFFFFFFF) >> (32 - self->priv->sample_stride * 8);
45 self->priv->buffer = gegl_buffer_new(&extent, self->priv->format);
47 cgit v0.8.3.1