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

Comparing OpenCL/OpenCL.pm (file contents):
Revision 1.83 by root, Sat May 5 15:11:19 2012 UTC vs.
Revision 1.84 by root, Sat May 5 16:44:02 2012 UTC

1620it. You are not necessarily meant to do it this way, this example just 1620it. You are not necessarily meant to do it this way, this example just
1621shows you the accessors to use :) 1621shows you the accessors to use :)
1622 1622
1623 my $mapped = $queue->map_image ($image, 1, OpenCL::MAP_WRITE); 1623 my $mapped = $queue->map_image ($image, 1, OpenCL::MAP_WRITE);
1624 1624
1625 $mapped->set ($_ * $mapped->row_pitch, pack "C", 5) 1625 $mapped->write ($_ * $mapped->row_pitch, pack "C", 5)
1626 for 0..$image->height; 1626 for 0 .. $mapped->height - 1;
1627 1627
1628 $mapped->unmap;. 1628 $mapped->unmap;.
1629 $mapped->wait; # only needed for out of order queues normally 1629 $mapped->wait; # only needed for out of order queues normally
1630 1630
1631=item $ev = $queue->unmap ($mapped, $wait_events...) 1631=item $ev = $queue->unmap ($mapped, $wait_events...)
2343 2343
2344This is a subclass of OpenCL::Mapped, representing mapped images. 2344This is a subclass of OpenCL::Mapped, representing mapped images.
2345 2345
2346=over 4 2346=over 4
2347 2347
2348=item $pixels = $mapped->width
2349
2350=item $pixels = $mapped->height
2351
2352=item $pixels = $mapped->depth
2353
2354Return the width/height/depth of the mapped image region, in pixels.
2355
2348=item $bytes = $mapped->row_pitch 2356=item $bytes = $mapped->row_pitch
2349 2357
2350=item $bytes = $mapped->slice_pitch 2358=item $bytes = $mapped->slice_pitch
2351 2359
2352Return the row or slice pitch of the image that has been mapped. 2360Return the row or slice pitch of the image that has been mapped.
2353 2361
2362=item $bytes = $mapped->element_size
2363
2364Return the size of a single pixel.
2365
2366=item $data = $mapped->get_row ($count, $x=0, $y=0, $z=0)
2367
2368Return C<$count> pixels from the given coordinates. The pixel data must
2369be completely contained within a single row.
2370
2371If C<$count> is C<undef>, then all the remaining pixels in that row are
2372returned.
2373
2374=item $mapped->set_row ($data, $x=0, $y=0, $z=0)
2375
2376Write the given pixel data at the given coordinate. The pixel data must
2377be completely contained within a single row.
2378
2354=back 2379=back
2355
2356 2380
2357=cut 2381=cut
2358 2382
23591; 23831;
2360 2384

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines