|
From: doug s. <hig...@ho...> - 2013-05-18 14:08:04
|
>>>> - Currently the snapshot only seems to work with PNG which has a file is >>>> not suitable for comparison with for instance a previous master version. >>> . >>> Because of compression? Is there a way to turn off compression? If so then it switch on a global testing mode parameter. Or is there more saved, such as the date and timestamp in the .png, causing a generic binary file compare to fail? >>> (win32 saves .bmp which has no compression -great for testing- but it's a pain then emailing a screenshot because I have to use another tool to convert it to .png for cross-platform consumption) >>> Q. instead of saving to any standard file format, don't we first get a binary blob from opengl somehow, and could we just save the blob and use it for comparison? Perhaps store widthxheight in another file (playback file?) in case someone wants to visually check a failed comparison? Or would we always know the widthxheight by setting the opengl window to a standard size for testing? >> The PNG file format writes a timestamp in the end of the file. That's >> why I was thinking of a GIF. >> As for width x height that could be setup as a default convention, e.g. >> the default window size or the -big layout. >>> . . I'm looking at the Snapshot.c code now. It's a bit different for each platform. In C we switch on #define values Main desktop platforms: - OSX, AQUA - Apple desktop - WIN32, _MSC_VER - Microsoft Windows - (default) - Linux Mobile platforms: - _ANDROID - Google Android - IPHONE - Apple iPhone - QNX - Blackberry BB10, Playbook When I look in Snapshot.c the main ones are AQUA, _MSC_VER and (default linux). The linux section seems to write a simple .rgb format, then call a utility to convert it to .png /* convert -size 450x300 -depth 8 -flip /tmp/snappedfile.rgb out.png works. */ ... snprintf(sysline,sizeof(sysline),"%s -size %dx%d -depth 8 -flip %s %s", IMAGECONVERT,gglobal()->display.screenWidth, gglobal()->display.screenHeight,thisRawFile,thisGoodFile); . Lets assume for now that with a bit more C coding we'll be able to write out generic, uncompressed screen shots to named files on each main desktop platform, suitable for comparing between Recording and Playback. |