… | |
… | |
140 | #endif |
140 | #endif |
141 | OUTPUT: |
141 | OUTPUT: |
142 | RETVAL |
142 | RETVAL |
143 | |
143 | |
144 | GdkPixbuf_noinc * |
144 | GdkPixbuf_noinc * |
|
|
145 | dealpha_expose (GdkPixbuf *pb) |
|
|
146 | CODE: |
|
|
147 | { |
|
|
148 | int w = gdk_pixbuf_get_width (pb); |
|
|
149 | int h = gdk_pixbuf_get_height (pb); |
|
|
150 | fprintf (stderr, "new %d %d\n", w, h); |
|
|
151 | int bpp = gdk_pixbuf_get_n_channels (pb); |
|
|
152 | int x, y, i; |
|
|
153 | guchar *src = gdk_pixbuf_get_pixels (pb), *dst; |
|
|
154 | int sstr = gdk_pixbuf_get_rowstride (pb), dstr; |
|
|
155 | |
|
|
156 | RETVAL = gdk_pixbuf_new (GDK_COLORSPACE_RGB, 0, 8, w, h); |
|
|
157 | |
|
|
158 | dst = gdk_pixbuf_get_pixels (RETVAL); |
|
|
159 | dstr = gdk_pixbuf_get_rowstride (RETVAL); |
|
|
160 | |
|
|
161 | for (x = 0; x < w; x++) |
|
|
162 | for (y = 0; y < h; y++) |
|
|
163 | for (i = 0; i < 3; i++) |
|
|
164 | dst[x * 3 + y * dstr + i] = src[x * bpp + y * sstr + i]; |
|
|
165 | } |
|
|
166 | OUTPUT: |
|
|
167 | RETVAL |
|
|
168 | |
|
|
169 | GdkPixbuf_noinc * |
145 | transpose (GdkPixbuf *pb) |
170 | transpose (GdkPixbuf *pb) |
146 | CODE: |
171 | CODE: |
147 | { |
172 | { |
148 | int w = gdk_pixbuf_get_width (pb); |
173 | int w = gdk_pixbuf_get_width (pb); |
149 | int h = gdk_pixbuf_get_height (pb); |
174 | int h = gdk_pixbuf_get_height (pb); |