Perl 6 - the future is here, just unevenly distributed

IRC log for #pdl, 2012-09-20

| Channels | #pdl index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
01:44 FROGGS_ joined #pdl
03:15 zpmorgan FROGGS_, howdies!
03:16 zpmorgan rpic does load images upside down for some reason;
03:16 zpmorgan you can compensate with $img = $img->slice("-1:0") I think.
03:18 zpmorgan If you're using a piddle's raw data, a slice doesn't change that though, and I'm also surprised that it works
06:22 FROGGS_ zpmorgen: and so you know the pixelformat?
06:22 FROGGS_ I'll read the log when I come back
06:25 zpmorgan not necessarily of the raw data. I think it's type-dependent anyways;
06:26 zpmorgan by using slice, list, & pack, and maybe append for alpha, you can finagle it into whatever format you like
06:28 zpmorgan If I recall, rpic has the first dimension represent color, so the vertical flipping would be $img->slice(":,-1:0")
06:28 zpmorgan (I was wrong before)
06:31 zpmorgan to pack a piddle into an rgb scalar, it's something like $foo = pack("C*",$img_piddle->list)
06:33 zpmorgan If you first want to add an alpha channel to dimension 0, it's something like $img = $img->append(0,ones($img->slice(0)))
06:34 zpmorgan er, glue instead of append
08:08 FROGGS joined #pdl
08:10 FROGGS zpmorgan: thanks, I'll try that today
08:12 zpmorgan sure thing, FROGGS
08:15 zpmorgan FROGGS, er, if y is the 3rd dimension, flipping vertically is $img->slice(":,:,-1:0")...
08:17 zpmorgan are you using get_pixels_ptr in sdl?
08:19 FROGGS no, Surface->new_from( $pointer, ... )
08:19 zpmorgan ah.
08:20 FROGGS if I would know where R, G and B is after flipping, I could set the pixelformat and blit these pixel as they are
08:20 FROGGS if a pixel in this stream is not bigger than 4 bytes
08:21 zpmorgan if you're willing to experiment, I'd suggest casting the piddle to bytes after flipping vertically.
08:22 zpmorgan If I had to guess, I'd guess that it will be a format you could work with.
08:23 zpmorgan the 1st dimension is rgb
08:27 zpmorgan although I'm not sure if pdl can convert to unsigned bytes
14:14 FROGGS joined #pdl
15:40 estrabd joined #pdl
15:40 liddle_piddle_bot Welcome back, estrabd
15:41 estrabd joined #pdl
15:41 liddle_piddle_bot Welcome back, estrabd
18:01 FROGGS joined #pdl
19:52 sivoais joined #pdl
21:10 sivoais joined #pdl
23:21 ilbot2 joined #pdl
23:21 Topic for #pdl is now Install PDL: http://pdl.perl.org/?page=install  | Book: http://pdl.perl.org/content/pdl-book-toc.html | Mailing list: http://pdl.perl.org/?page=mailing-lists | Pasting: http://scsys.co.uk:8001/pdl | Channel is logged by ilbot2: http://irclog.perlgeek.de/pdl/

| Channels | #pdl index | Today | | Search | Google Search | Plain-Text | summary