ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CV/CV.xs
(Generate patch)

Comparing CV/CV.xs (file contents):
Revision 1.13 by root, Tue Feb 8 11:03:30 2005 UTC vs.
Revision 1.28 by root, Mon Aug 22 00:30:58 2005 UTC

1#include "EXTERN.h" 1#include "EXTERN.h"
2#include "perl.h" 2#include "perl.h"
3#include "XSUB.h" 3#include "XSUB.h"
4 4
5#include <string.h>
6#include <setjmp.h>
7
8#include <jpeglib.h>
9#include <glib.h>
10#include <gtk/gtk.h>
5#include <gdk-pixbuf/gdk-pixbuf.h> 11#include <gdk-pixbuf/gdk-pixbuf.h>
6 12
7#include <gperl.h> 13#include <gperl.h>
8#include <gtk2perl.h> 14#include <gtk2perl.h>
9 15
10#define IW 80 16#define IW 80 /* MUST match Schnauer.pm! */
17#define IH 60 /* MUST match Schnauer.pm! */
11 18
12#define RAND (seed = (seed + 7141) * 54773 % 134456) 19#define RAND (seed = (seed + 7141) * 54773 % 134456)
13 20
14#define LINELENGTH 240 21#define LINELENGTH 240
15 22
16#define ELLIPSIS "\xe2\x80\xa6" 23#define ELLIPSIS "\xe2\x80\xa6"
24
25struct jpg_err_mgr
26{
27 struct jpeg_error_mgr err;
28 jmp_buf setjmp_buffer;
29};
30
31static void
32cv_error_exit (j_common_ptr cinfo)
33{
34 longjmp (((struct jpg_err_mgr *)cinfo->err)->setjmp_buffer, 99);
35}
36
37static void
38cv_error_output (j_common_ptr cinfo)
39{
40 return;
41}
42
43static void
44rgb_to_hsv (unsigned int r, unsigned int g, unsigned int b,
45 unsigned int *h, unsigned int *s, unsigned int *v)
46{
47 unsigned int mx = r; if (g > mx) mx = g; if (b > mx) mx = b;
48 unsigned int mn = r; if (g < mn) mn = g; if (b < mn) mn = b;
49 unsigned int delta = mx - mn;
50
51 *v = mx;
52
53 *s = mx ? delta * 255 / mx : 0;
54
55 if (delta == 0)
56 *h = 0;
57 else
58 {
59 if (r == mx)
60 *h = ((int)g - (int)b) * 255 / (int)(delta * 3);
61 else if (g == mx)
62 *h = ((int)b - (int)r) * 255 / (int)(delta * 3) + 52;
63 else if (b == mx)
64 *h = ((int)r - (int)g) * 255 / (int)(delta * 3) + 103;
65
66 *h &= 255;
67 }
68}
17 69
18static guint32 a85_val; 70static guint32 a85_val;
19static guint a85_cnt; 71static guint a85_cnt;
20static guchar a85_buf[LINELENGTH], *a85_ptr; 72static guchar a85_buf[LINELENGTH], *a85_ptr;
21 73
68 *a85_ptr++ = '\n'; 120 *a85_ptr++ = '\n';
69 121
70 PerlIO_write (fp, a85_buf, a85_ptr - a85_buf); 122 PerlIO_write (fp, a85_buf, a85_ptr - a85_buf);
71} 123}
72 124
73static void
74rgb_to_hsv (unsigned int r, unsigned int g, unsigned int b,
75 unsigned int *h, unsigned int *s, unsigned int *v)
76{
77 unsigned int mx = r; if (g > mx) mx = g; if (b > mx) mx = b;
78 unsigned int mn = r; if (g < mn) mn = g; if (b < mn) mn = b;
79 unsigned int delta = mx - mn;
80
81 *v = mx;
82
83 *s = mx ? delta * 255 / mx : 0;
84
85 if (delta == 0)
86 *h = 0;
87 else
88 {
89 if (r == mx)
90 *h = ((int)g - (int)b) * 255 / (int)(delta * 3);
91 else if (g == mx)
92 *h = ((int)b - (int)r) * 255 / (int)(delta * 3) + 52;
93 else if (b == mx)
94 *h = ((int)r - (int)g) * 255 / (int)(delta * 3) + 103;
95
96 *h &= 255;
97 }
98}
99
100///////////////////////////////////////////////////////////////////////////// 125/////////////////////////////////////////////////////////////////////////////
101 126
102MODULE = Gtk2::CV PACKAGE = Gtk2::CV 127MODULE = Gtk2::CV PACKAGE = Gtk2::CV
103 128
104PROTOTYPES: ENABLE 129PROTOTYPES: ENABLE
105 130
131# missing in Gtk2 perl module
132
133gboolean
134gdk_net_wm_supports (GdkAtom property)
135 CODE:
136#if defined(GDK_WINDOWING_X11) && !defined(GDK_MULTIHEAD_SAFE)
137 RETVAL = gdk_net_wm_supports (property);
138#else
139 RETVAL = 0;
140#endif
141 OUTPUT:
142 RETVAL
143
106GdkPixbuf_noinc * 144GdkPixbuf_noinc *
107transpose (GdkPixbuf *pb) 145dealpha_expose (GdkPixbuf *pb)
108 CODE: 146 CODE:
109{ 147{
110 int w = gdk_pixbuf_get_width (pb); 148 int w = gdk_pixbuf_get_width (pb);
111 int h = gdk_pixbuf_get_height (pb); 149 int h = gdk_pixbuf_get_height (pb);
112 int bpp = gdk_pixbuf_get_n_channels (pb); 150 int bpp = gdk_pixbuf_get_n_channels (pb);
113 int x, y, i; 151 int x, y, i;
114 guchar *src = gdk_pixbuf_get_pixels (pb), *dst; 152 guchar *src = gdk_pixbuf_get_pixels (pb), *dst;
115 int sstr = gdk_pixbuf_get_rowstride (pb), dstr; 153 int sstr = gdk_pixbuf_get_rowstride (pb), dstr;
116 154
117 RETVAL = gdk_pixbuf_new (GDK_COLORSPACE_RGB, bpp == 4, 8, h, w); 155 RETVAL = gdk_pixbuf_new (GDK_COLORSPACE_RGB, 0, 8, w, h);
118 156
119 dst = gdk_pixbuf_get_pixels (RETVAL); 157 dst = gdk_pixbuf_get_pixels (RETVAL);
120 dstr = gdk_pixbuf_get_rowstride (RETVAL); 158 dstr = gdk_pixbuf_get_rowstride (RETVAL);
121 159
122 for (y = 0; y < h; y++)
123 for (x = 0; x < w; x++) 160 for (x = 0; x < w; x++)
161 for (y = 0; y < h; y++)
124 for (i = 0; i < bpp; i++) 162 for (i = 0; i < 3; i++)
125 dst[y * bpp + x * dstr + i] = src[x * bpp + y * sstr + i]; 163 dst[x * 3 + y * dstr + i] = src[x * bpp + y * sstr + i];
126} 164}
127 OUTPUT: 165 OUTPUT:
128 RETVAL 166 RETVAL
129 167
130GdkPixbuf_noinc * 168GdkPixbuf_noinc *
131flop (GdkPixbuf *pb) 169rotate (GdkPixbuf *pb, int angle)
132 CODE: 170 CODE:
133{ 171 RETVAL = gdk_pixbuf_rotate_simple (pb, angle == 0 ? GDK_PIXBUF_ROTATE_NONE
134 int w = gdk_pixbuf_get_width (pb); 172 : angle == 90 ? GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE
135 int h = gdk_pixbuf_get_height (pb); 173 : angle == 180 ? GDK_PIXBUF_ROTATE_UPSIDEDOWN
136 int bpp = gdk_pixbuf_get_n_channels (pb); 174 : angle == 270 ? GDK_PIXBUF_ROTATE_CLOCKWISE
137 int x, y, i; 175 : angle);
138 guchar *src = gdk_pixbuf_get_pixels (pb), *dst; 176 OUTPUT:
139 int sstr = gdk_pixbuf_get_rowstride (pb), dstr; 177 RETVAL
140 178
141 RETVAL = gdk_pixbuf_new (GDK_COLORSPACE_RGB, bpp == 4, 8, w, h); 179GdkPixbuf_noinc *
180load_jpeg (SV *path, int thumbnail=0)
181 CODE:
182{
183 struct jpeg_decompress_struct cinfo;
184 struct jpg_err_mgr jerr;
185 guchar *data;
186 int rs;
187 FILE *fp;
188 volatile GdkPixbuf *pb = 0;
189 gchar *filename;
142 190
191 RETVAL = 0;
192
193 filename = g_filename_from_utf8 (SvPVutf8_nolen (path), -1, 0, 0, 0);
194 fp = fopen (filename, "rb");
195 g_free (filename);
196
197 if (!fp)
198 XSRETURN_UNDEF;
199
200 cinfo.err = jpeg_std_error (&jerr.err);
201
202 jerr.err.error_exit = cv_error_exit;
203 jerr.err.output_message = cv_error_output;
204
205 if ((rs = setjmp (jerr.setjmp_buffer)))
206 {
207 fclose (fp);
208 jpeg_destroy_decompress (&cinfo);
209
210 if (pb)
211 g_object_unref ((gpointer)pb);
212
213 XSRETURN_UNDEF;
214 }
215
216 jpeg_create_decompress (&cinfo);
217
218 jpeg_stdio_src (&cinfo, fp);
219 jpeg_read_header (&cinfo, TRUE);
220
221 cinfo.dct_method = JDCT_DEFAULT;
222 cinfo.do_fancy_upsampling = FALSE; /* worse quality, but nobody compained so far, and gdk-pixbuf does the same */
223 cinfo.do_block_smoothing = FALSE;
224 cinfo.out_color_space = JCS_RGB;
225 cinfo.quantize_colors = FALSE;
226
227 cinfo.scale_num = 1;
228 cinfo.scale_denom = 1;
229
230 jpeg_calc_output_dimensions (&cinfo);
231
232 if (thumbnail)
233 {
234 cinfo.dct_method = JDCT_FASTEST;
235 cinfo.do_fancy_upsampling = FALSE;
236
237 while (cinfo.scale_denom < 8
238 && cinfo.output_width >= IW*4
239 && cinfo.output_height >= IH*4)
240 {
241 cinfo.scale_denom <<= 1;
242 jpeg_calc_output_dimensions (&cinfo);
243 }
244 }
245
246 pb = RETVAL = gdk_pixbuf_new (GDK_COLORSPACE_RGB, 0, 8, cinfo.output_width, cinfo.output_height);
247 if (!RETVAL)
248 longjmp (jerr.setjmp_buffer, 2);
249
143 dst = gdk_pixbuf_get_pixels (RETVAL); 250 data = gdk_pixbuf_get_pixels (RETVAL);
144 dstr = gdk_pixbuf_get_rowstride (RETVAL); 251 rs = gdk_pixbuf_get_rowstride (RETVAL);
145 252
146 for (y = 0; y < h; y++) 253 if (cinfo.output_components != 3)
147 for (x = 0; x < w; x++) 254 longjmp (jerr.setjmp_buffer, 3);
148 for (i = 0; i < bpp; i++) 255
149 dst[(w - 1 - x) * bpp + y * dstr + i] = src[x * bpp + y * sstr + i]; 256 jpeg_start_decompress (&cinfo);
257
258 while (cinfo.output_scanline < cinfo.output_height)
259 {
260 int remaining = cinfo.output_height - cinfo.output_scanline;
261 JSAMPROW rp[4];
262
263 rp [0] = data + cinfo.output_scanline * rs;
264 rp [1] = (guchar *)rp [0] + rs;
265 rp [2] = (guchar *)rp [1] + rs;
266 rp [3] = (guchar *)rp [2] + rs;
267
268 jpeg_read_scanlines (&cinfo, rp, remaining < 4 ? remaining : 4);
269 }
270
271 jpeg_finish_decompress (&cinfo);
272 fclose (fp);
273 jpeg_destroy_decompress (&cinfo);
150} 274}
151 OUTPUT: 275 OUTPUT:
152 RETVAL 276 RETVAL
153 277
154############################################################################# 278#############################################################################
155 279
156MODULE = Gtk2::CV PACKAGE = Gtk2::CV::Schnauzer 280MODULE = Gtk2::CV PACKAGE = Gtk2::CV::Schnauzer
157 281
282SV *
283foldcase (SV *pathsv)
284 PROTOTYPE: $
285 CODE:
286{
287 STRLEN plen;
288 U8 *path = (U8 *)SvPVutf8 (pathsv, plen);
289 U8 *pend = path + plen;
290 U8 dst [plen * 6 * 3], *dstp = dst;
291
292 while (path < pend)
293 {
294 U8 ch = *path;
295
296 if (ch >= 'a' && ch <= 'z')
297 *dstp++ = *path++;
298 else if (ch >= '0' && ch <= '9')
299 {
300 STRLEN el, nl = 0;
301 while (*path >= '0' && *path <= '9' && path < pend)
302 path++, nl++;
303
304 for (el = nl; el < 6; el++)
305 *dstp++ = '0';
306
307 memcpy (dstp, path - nl, nl);
308 dstp += nl;
309 }
310 else
311 {
312 STRLEN cl;
313 to_utf8_fold (path, dstp, &cl);
314 dstp += cl;
315 path += is_utf8_char (path);
316 }
317 }
318
319 RETVAL = newSVpvn ((const char *)dst, dstp - dst);
320}
321 OUTPUT:
322 RETVAL
323
158GdkPixbuf_noinc * 324GdkPixbuf_noinc *
159p7_to_pb (int w, int h, guchar *src) 325p7_to_pb (int w, int h, SV *src_sv)
326 PROTOTYPE: @
160 CODE: 327 CODE:
161{ 328{
162 int x, y; 329 int x, y;
163 guchar *dst, *d; 330 guchar *dst, *d;
164 int dstr; 331 int dstr;
332 guchar *src = (guchar *)SvPVbyte_nolen (src_sv);
165 333
166 RETVAL = gdk_pixbuf_new (GDK_COLORSPACE_RGB, 0, 8, w, h); 334 RETVAL = gdk_pixbuf_new (GDK_COLORSPACE_RGB, 0, 8, w, h);
167 dst = gdk_pixbuf_get_pixels (RETVAL); 335 dst = gdk_pixbuf_get_pixels (RETVAL);
168 dstr = gdk_pixbuf_get_rowstride (RETVAL); 336 dstr = gdk_pixbuf_get_rowstride (RETVAL);
169 337
178 } 346 }
179} 347}
180 OUTPUT: 348 OUTPUT:
181 RETVAL 349 RETVAL
182 350
351#############################################################################
352
353MODULE = Gtk2::CV PACKAGE = Gtk2::CV::PostScript
354
355void
356dump_ascii85 (PerlIO *fp, GdkPixbuf *pb)
357 CODE:
358{
359 int w = gdk_pixbuf_get_width (pb);
360 int h = gdk_pixbuf_get_height (pb);
361 int x, y, i;
362 guchar *dst;
363 int bpp = gdk_pixbuf_get_n_channels (pb);
364 guchar *src = gdk_pixbuf_get_pixels (pb);
365 int sstr = gdk_pixbuf_get_rowstride (pb);
366
367 a85_init ();
368
369 for (y = 0; y < h; y++)
370 for (x = 0; x < w; x++)
371 for (i = 0; i < (bpp < 3 ? 1 : 3); i++)
372 a85_push (fp, src [x * bpp + y * sstr + i]);
373
374 a85_finish (fp);
375}
376
377void
378dump_binary (PerlIO *fp, GdkPixbuf *pb)
379 CODE:
380{
381 int w = gdk_pixbuf_get_width (pb);
382 int h = gdk_pixbuf_get_height (pb);
383 int x, y, i;
384 guchar *dst;
385 int bpp = gdk_pixbuf_get_n_channels (pb);
386 guchar *src = gdk_pixbuf_get_pixels (pb);
387 int sstr = gdk_pixbuf_get_rowstride (pb);
388
389 for (y = 0; y < h; y++)
390 for (x = 0; x < w; x++)
391 for (i = 0; i < (bpp < 3 ? 1 : 3); i++)
392 PerlIO_putc (fp, src [x * bpp + y * sstr + i]);
393}
394
395#############################################################################
396
397MODULE = Gtk2::CV PACKAGE = Gtk2::CV
398
183SV * 399SV *
184pb_to_p7 (GdkPixbuf *pb) 400pb_to_hv84 (GdkPixbuf *pb)
185 CODE: 401 CODE:
186{ 402{
187 int w = gdk_pixbuf_get_width (pb); 403 int w = gdk_pixbuf_get_width (pb);
188 int h = gdk_pixbuf_get_height (pb); 404 int h = gdk_pixbuf_get_height (pb);
189 int x, y; 405 int x, y;
190 guchar *dst; 406 guchar *dst;
191 int bpp = gdk_pixbuf_get_n_channels (pb); 407 int bpp = gdk_pixbuf_get_n_channels (pb);
192 guchar *src = gdk_pixbuf_get_pixels (pb); 408 guchar *src = gdk_pixbuf_get_pixels (pb);
193 int sstr = gdk_pixbuf_get_rowstride (pb); 409 int sstr = gdk_pixbuf_get_rowstride (pb);
194 int Er[IW], Eg[IW], Eb[IW];
195 int seed = 77;
196
197 RETVAL = newSV (w * h);
198 SvPOK_only (RETVAL);
199 SvCUR_set (RETVAL, w * h);
200
201 dst = SvPVX (RETVAL);
202
203 memset (Er, 0, sizeof (int) * IW);
204 memset (Eg, 0, sizeof (int) * IW);
205 memset (Eb, 0, sizeof (int) * IW);
206
207 /* some primitive error distribution + random dithering */
208
209 for (y = 0; y < h; y++)
210 {
211 int er = 0, eg = 0, eb = 0;
212
213 for (x = 0; x < w; x++)
214 {
215 int r, g, b;
216 guchar *p = src + x * bpp + y * sstr;
217
218 r = ((p[0] + er + Er[x]) * 7 + 128) / 255;
219 g = ((p[1] + eg + Eg[x]) * 7 + 128) / 255;
220 b = ((p[2] + eb + Eb[x]) * 3 + 128) / 255;
221
222 r = r > 7 ? 7 : r < 0 ? 0 : r;
223 g = g > 7 ? 7 : g < 0 ? 0 : g;
224 b = b > 3 ? 3 : b < 0 ? 0 : b;
225
226 er += p[0] - (r * 255 + 4) / 7;
227 eg += p[1] - (g * 255 + 4) / 7;
228 eb += p[2] - (b * 255 + 2) / 3;
229
230 Er[x] = er / 2; er -= er / 2 + RAND % 7 - 3;
231 Eg[x] = eg / 2; eg -= eg / 2 + RAND % 7 - 3;
232 Eb[x] = eb / 2; eb -= eb / 2 + RAND % 7 - 3;
233
234 *dst++ = r << 5 | g << 2 | b;
235 }
236 }
237}
238 OUTPUT:
239 RETVAL
240
241SV *
242make_histogram (SV *ar)
243 CODE:
244{
245 int i;
246 AV *av, *result;
247
248 if (!SvROK (ar) || SvTYPE (SvRV (ar)) != SVt_PVAV)
249 croak ("Not an array ref as first argument to make_histogram");
250
251 av = (AV *) SvRV (ar);
252 result = newAV ();
253
254 for (i = 0; i <= av_len (av); ++i)
255 {
256 int bigst, j;
257 SV *sv = *av_fetch (av, i, 1);
258 STRLEN len;
259 char *buf = SvPVbyte (sv, len);
260
261 int tmphist[256];
262 char *hist;
263
264 SV *histsv = newSV (257);
265 SvPOK_on (histsv);
266 SvCUR_set (histsv, 256);
267 hist = SvPVX (histsv);
268
269 Zero (tmphist, 256, int);
270
271 while (len--)
272 ++tmphist[(unsigned char)*buf++];
273
274 bigst = 1;
275 for (j = 0; j < 256; ++j)
276 if (tmphist[j] > bigst)
277 bigst = tmphist[j];
278
279 for (j = 0; j < 256; ++j)
280 hist[j] = tmphist[j] * 255 / bigst;
281
282 av_push (result, histsv);
283 }
284
285 RETVAL = newRV_noinc ((SV *)result);
286}
287 OUTPUT:
288 RETVAL
289
290
291
292#############################################################################
293
294MODULE = Gtk2::CV PACKAGE = Gtk2::CV::PostScript
295
296void
297dump_ascii85 (PerlIO *fp, GdkPixbuf *pb)
298 CODE:
299{
300 int w = gdk_pixbuf_get_width (pb);
301 int h = gdk_pixbuf_get_height (pb);
302 int x, y, i;
303 guchar *dst;
304 int bpp = gdk_pixbuf_get_n_channels (pb);
305 guchar *src = gdk_pixbuf_get_pixels (pb);
306 int sstr = gdk_pixbuf_get_rowstride (pb);
307
308 a85_init ();
309
310 for (y = 0; y < h; y++)
311 for (x = 0; x < w; x++)
312 for (i = 0; i < (bpp < 3 ? 1 : 3); i++)
313 a85_push (fp, src [x * bpp + y * sstr + i]);
314
315 a85_finish (fp);
316}
317
318void
319dump_binary (PerlIO *fp, GdkPixbuf *pb)
320 CODE:
321{
322 int w = gdk_pixbuf_get_width (pb);
323 int h = gdk_pixbuf_get_height (pb);
324 int x, y, i;
325 guchar *dst;
326 int bpp = gdk_pixbuf_get_n_channels (pb);
327 guchar *src = gdk_pixbuf_get_pixels (pb);
328 int sstr = gdk_pixbuf_get_rowstride (pb);
329
330 for (y = 0; y < h; y++)
331 for (x = 0; x < w; x++)
332 for (i = 0; i < (bpp < 3 ? 1 : 3); i++)
333 PerlIO_putc (fp, src [x * bpp + y * sstr + i]);
334}
335
336#############################################################################
337
338MODULE = Gtk2::CV PACKAGE = Gtk2::CV
339
340SV *
341pb_to_hv84 (GdkPixbuf *pb)
342 CODE:
343{
344 int w = gdk_pixbuf_get_width (pb);
345 int h = gdk_pixbuf_get_height (pb);
346 int x, y;
347 guchar *dst;
348 int bpp = gdk_pixbuf_get_n_channels (pb);
349 guchar *src = gdk_pixbuf_get_pixels (pb);
350 int sstr = gdk_pixbuf_get_rowstride (pb);
351 410
352 RETVAL = newSV (6 * 8 * 12 / 8); 411 RETVAL = newSV (6 * 8 * 12 / 8);
353 SvPOK_only (RETVAL); 412 SvPOK_only (RETVAL);
354 SvCUR_set (RETVAL, 6 * 8 * 12 / 8); 413 SvCUR_set (RETVAL, 6 * 8 * 12 / 8);
355 414
356 dst = SvPVX (RETVAL); 415 dst = (guchar *)SvPVX (RETVAL);
357 416
358 /* some primitive error distribution + random dithering */ 417 /* some primitive error distribution + random dithering */
359 418
360 for (y = 0; y < h; y++) 419 for (y = 0; y < h; y++)
361 { 420 {
419 } 478 }
420} 479}
421 OUTPUT: 480 OUTPUT:
422 RETVAL 481 RETVAL
423 482
483#############################################################################
424 484
485MODULE = Gtk2::CV PACKAGE = Gtk2::CV::Plugin::RCluster
425 486
487SV *
488make_histograms (SV *ar)
489 CODE:
490{
491 int i;
492 AV *av, *result;
493
494 if (!SvROK (ar) || SvTYPE (SvRV (ar)) != SVt_PVAV)
495 croak ("Not an array ref as first argument to make_histogram");
496
497 av = (AV *) SvRV (ar);
498 result = newAV ();
499
500 for (i = 0; i <= av_len (av); ++i)
501 {
502 const int HISTSIZE = 64;
503
504 int j;
505 SV *sv = *av_fetch (av, i, 1);
506 STRLEN len;
507 char *buf = SvPVbyte (sv, len);
508
509 int tmphist[HISTSIZE];
510 float *hist;
511
512 SV *histsv = newSV (HISTSIZE * sizeof (float) + 1);
513 SvPOK_on (histsv);
514 SvCUR_set (histsv, HISTSIZE * sizeof (float));
515 hist = (float *)SvPVX (histsv);
516
517 Zero (tmphist, sizeof (tmphist), char);
518
519 for (j = len; j--; )
520 {
521 unsigned int idx
522 = ((*buf & 0xc0) >> 2)
523 | ((*buf & 0x18) >> 1)
524 | (*buf & 0x03);
525
526 ++tmphist[idx];
527 ++buf;
528 }
529
530 for (j = 0; j < HISTSIZE; ++j)
531 hist[j] = (float)tmphist[j] / (len + 1e-30);
532
533 av_push (result, histsv);
534 }
535
536 RETVAL = newRV_noinc ((SV *)result);
537}
538 OUTPUT:
539 RETVAL
540
541

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines