[MBS] PictureMBS platform byte-order differences

2014-06-27 Thread Michael Diehr
Hi Christian,

If you run the following code on Cocoa vs. Win32 (with GDI+ enabled), the final 
picture result is different, it appears as if the pixels are mis-ordered:

Pushbutton1.Action
  ' testing PictureMBS byte order
  dim w,h as integer
  w=32
  h=32
  dim p as new picture(w,h)
  dim r as RGBSurface = p.RGBSurface
  for y as integer = 0 to h-1
for x as integer = 0 to w-1
  r.Pixel(x,y) = cFF80bb99
next
  next
  
  dim pSrc as new PictureMBS(p,p.HasAlphaChannel)
  dim data as new MemoryBlock(w*h*4)
  dim pDest as new PictureMBS(data,w,h,PictureMBS.ImageFormatBGRA,w*4)
  
  call pDest.copyPixels(pSrc)
  
  dim p2 as picture = pDest.CopyPicture
  break // look at p2 in the debugger.  On Mac it's purpleish, on windows it's 
greenish

Is this a bug in PictureMBS?

___
Mbsplugins_monkeybreadsoftware.info mailing list
mbsplugins@monkeybreadsoftware.info
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info


Re: [MBS] PictureMBS platform byte-order differences

2014-06-27 Thread Michael Diehr
It seems that a workaround is to add this:

  #if TargetWin32
data.EndianU32_LtoBMBS(0,data.size/4)
  #endif


On Jun 27, 2014, at 9:03 AM, Michael Diehr m...@xochi.com wrote:

 Hi Christian,
 
 If you run the following code on Cocoa vs. Win32 (with GDI+ enabled), the 
 final picture result is different, it appears as if the pixels are 
 mis-ordered:
 
 Pushbutton1.Action
  ' testing PictureMBS byte order
  dim w,h as integer
  w=32
  h=32
  dim p as new picture(w,h)
  dim r as RGBSurface = p.RGBSurface
  for y as integer = 0 to h-1
for x as integer = 0 to w-1
  r.Pixel(x,y) = cFF80bb99
next
  next
 
  dim pSrc as new PictureMBS(p,p.HasAlphaChannel)
  dim data as new MemoryBlock(w*h*4)
  dim pDest as new PictureMBS(data,w,h,PictureMBS.ImageFormatBGRA,w*4)
 
  call pDest.copyPixels(pSrc)
 
  dim p2 as picture = pDest.CopyPicture
  break // look at p2 in the debugger.  On Mac it's purpleish, on windows it's 
 greenish
 
 Is this a bug in PictureMBS?
 
 ___
 Mbsplugins_monkeybreadsoftware.info mailing list
 mbsplugins@monkeybreadsoftware.info
 https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

___
Mbsplugins_monkeybreadsoftware.info mailing list
mbsplugins@monkeybreadsoftware.info
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info


Re: [MBS] PictureMBS platform byte-order differences

2014-06-27 Thread Christian Schmitz

Am 27.06.2014 um 18:03 schrieb Michael Diehr m...@xochi.com:

 Hi Christian,
 
 If you run the following code on Cocoa vs. Win32 (with GDI+ enabled), the 
 final picture result is different, it appears as if the pixels are 
 mis-ordered:

fixed for next version.

Also for future I make the Offset properties writable, so you can correct it 
yourself.

Sincerely
Christian

-- 
Read our blog about news on our plugins:

http://www.mbsplugins.de/

___
Mbsplugins_monkeybreadsoftware.info mailing list
mbsplugins@monkeybreadsoftware.info
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info