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

Comparing CV/CV.xs (file contents):
Revision 1.23 by root, Tue Aug 16 23:50:39 2005 UTC vs.
Revision 1.25 by root, Fri Aug 19 00:34:54 2005 UTC

296foldcase (SV *pathsv) 296foldcase (SV *pathsv)
297 PROTOTYPE: $ 297 PROTOTYPE: $
298 CODE: 298 CODE:
299{ 299{
300 STRLEN plen; 300 STRLEN plen;
301 U8 *path = SvPVutf8 (pathsv, plen); 301 U8 *path = (U8 *)SvPVutf8 (pathsv, plen);
302 U8 *pend = path + plen; 302 U8 *pend = path + plen;
303 U8 dst [plen * 6 * 3], *dstp = dst; 303 U8 dst [plen * 6 * 3], *dstp = dst;
304 304
305 while (path < pend) 305 while (path < pend)
306 { 306 {
327 dstp += cl; 327 dstp += cl;
328 path += is_utf8_char (path); 328 path += is_utf8_char (path);
329 } 329 }
330 } 330 }
331 331
332 RETVAL = newSVpvn (dst, dstp - dst); 332 RETVAL = newSVpvn ((const char *)dst, dstp - dst);
333} 333}
334 OUTPUT: 334 OUTPUT:
335 RETVAL 335 RETVAL
336 336
337GdkPixbuf_noinc * 337GdkPixbuf_noinc *
338p7_to_pb (int w, int h, guchar *src) 338p7_to_pb (int w, int h, SV *src_sv)
339 PROTOTYPE: @ 339 PROTOTYPE: @
340 CODE: 340 CODE:
341{ 341{
342 int x, y; 342 int x, y;
343 guchar *dst, *d; 343 guchar *dst, *d;
344 int dstr; 344 int dstr;
345 guchar *src = (guchar *)SvPVbyte_nolen (src_sv);
345 346
346 RETVAL = gdk_pixbuf_new (GDK_COLORSPACE_RGB, 0, 8, w, h); 347 RETVAL = gdk_pixbuf_new (GDK_COLORSPACE_RGB, 0, 8, w, h);
347 dst = gdk_pixbuf_get_pixels (RETVAL); 348 dst = gdk_pixbuf_get_pixels (RETVAL);
348 dstr = gdk_pixbuf_get_rowstride (RETVAL); 349 dstr = gdk_pixbuf_get_rowstride (RETVAL);
349 350
376 377
377 RETVAL = newSV (w * h); 378 RETVAL = newSV (w * h);
378 SvPOK_only (RETVAL); 379 SvPOK_only (RETVAL);
379 SvCUR_set (RETVAL, w * h); 380 SvCUR_set (RETVAL, w * h);
380 381
381 dst = SvPVX (RETVAL); 382 dst = (guchar *)SvPVX (RETVAL);
382 383
383 memset (Er, 0, sizeof (int) * IW); 384 memset (Er, 0, sizeof (int) * IW);
384 memset (Eg, 0, sizeof (int) * IW); 385 memset (Eg, 0, sizeof (int) * IW);
385 memset (Eb, 0, sizeof (int) * IW); 386 memset (Eb, 0, sizeof (int) * IW);
386 387
480 481
481 RETVAL = newSV (6 * 8 * 12 / 8); 482 RETVAL = newSV (6 * 8 * 12 / 8);
482 SvPOK_only (RETVAL); 483 SvPOK_only (RETVAL);
483 SvCUR_set (RETVAL, 6 * 8 * 12 / 8); 484 SvCUR_set (RETVAL, 6 * 8 * 12 / 8);
484 485
485 dst = SvPVX (RETVAL); 486 dst = (guchar *)SvPVX (RETVAL);
486 487
487 /* some primitive error distribution + random dithering */ 488 /* some primitive error distribution + random dithering */
488 489
489 for (y = 0; y < h; y++) 490 for (y = 0; y < h; y++)
490 { 491 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines