[MacRuby-devel] [MacRuby] #818: NSBitmapImageRep#bitmapData returns empty String

Emil Tin emil at tin.dk
Wed Aug 4 07:39:11 PDT 2010


ok. is this an bug with bridgesupport, or just the way things are designed?

i was writing a small fractal app, and wanted to try to write directly to a bitmap, to see if it was faster than using setPixel() repeatedly. but i gues ruby doesn't allow writing to memory directly without some class (like String or Pointer) range-checking every write?



-emil



On 03/08/2010, at 04.25, MacRuby wrote:

> #818: NSBitmapImageRep#bitmapData returns empty String
> -------------------------+--------------------------------------------------
> Reporter:  emil@…       |       Owner:  lsansonetti@…                                           
>     Type:  defect       |      Status:  new                                                     
> Priority:  major        |   Milestone:                                                          
> Component:  MacRuby      |    Keywords:  bitmap,NSBitmapImageRep, @nsBitmapImageRepObj.bitmapData
> -------------------------+--------------------------------------------------
> 
> Comment(by lsansonetti@…):
> 
> Unfortunately there is little we can do here. -bitmapData returns a
> "unsigned char *" type and MacRuby assumes this is a string. However,
> since the first byte is null, the resulted string object is empty.
> 
> There are other ways of getting the data. -getPixel:atX:y: for example
> might work better.
> 
> I am leaving this bug open in the idea that we might find a solution for
> the -bitmapData problem.
> 
> -- 
> Ticket URL: <http://www.macruby.org/trac/ticket/818#comment:2>
> MacRuby <http://macruby.org/>
> 
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1920 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20100804/c4fcf9b2/attachment.bin>


More information about the MacRuby-devel mailing list