Re: [osg-users] osg, macosx-x86_64 imageio plugin color byte swap problem
Hi Guys Sorry to raise this again, but I'm currently having the same issue. Basically I am opening files, doing some bits and bobs to them and reexporting. Just for completeness I do alter the texture stateattributes, but not in a way I would think would matter. Here's what I'm doing Code: if(_localiseImagePaths){ std::string fileName = osgDB::getSimpleFileName(texture-getImage(0)-getFileName()); std::string localPath = images/+fileName; texture-getImage(0)-setFileName(localPath); } //disable resize of textures texture-setResizeNonPowerOfTwoHint(false); //clamp to edge required for IPhone NPOT support texture-setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE); texture-setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE); Then when done I export with the following options to make sure the files are written as external files for whatever format I'm using. Code: osg::ref_ptrosgDB::Options opts = new osgDB::Options(); opts-setOptionString(OutputTextureFiles noTexturesInIVEFile WriteImageHint=WriteOut); But when I look at the exported images, or load the exported model file the image red and blue components seem to be flipped. I've had a little dig and did start to think it was because some of my images don't have alpha channels, but I've tested images with alpha channels with no luck. I've attached a model that will produce the problem when loaded and reexported with the above options (on my end at least) I'm using osg version 3.1.3 and running on OSX 10.7.4, with OSX sdk 10.8, XCode 4.5. I've also tried both 32 and 64 bit builds with no luck. Any help would be greatly appreciated. Cheers Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50326#50326 Attachments: http://forum.openscenegraph.org//files/boxmanmodel_190.zip ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg, macosx-x86_64 imageio plugin color byte swap problem
Oops Sorry, the last attached file had a bad png that the plugin can't load. I copied over it with a backup after the colors got swapped and forgot to run it through gimp which seems to sort it. Also I just tested embedding the image into the osgb file, which worked fine. Thanks Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50327#50327 Attachments: http://forum.openscenegraph.org//files/boxmanmodel2_102.zip ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg, macosx-x86_64 imageio plugin color byte swap problem
Hi Again So I've done some more digging and seems I'm hitting a case they may be known to not work. So in the function CreateCGImageFromOSGData under the case for GL_BGRA I am entering the else of the if statement. if(GL_UNSIGNED_INT_8_8_8_8_REV == osg_image.getDataType()). In there is this with the following code and comment // FIXME: Don't know how to handle this case bitmap_info = kCGImageAlphaPremultipliedLast; What's weird is all my images seem to take this path even if I think they are pure rgb images. I've found this function vImagePermuteChannels_ARGB, which I think can help me out, I just need to decide when to do it, to not break everyone else's functionality. Cheers Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50333#50333 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg, macosx-x86_64 imageio plugin color byte swap problem
Hi Chris, I tested the imageio-plugin on os x 10.7 with an older 32bit build (from Nov 2011) and it works for me. I tested only png and jpg files. HTH, Stephan Am 21.02.12 19:51, schrieb Chris Hanson: I had a user contact me for some assistance on this issue. I'm not an OSX/imageio guy, so I don't know the ramifications of this, and I thought I'd throw it out for the wider community to comment on before proposing a patch. From the user: We have found some image color ordering issue on MacOS Snow Leopard 10.6. We do x86_64 build, with imageio plugin. We set CMAKE flag: OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio For some reason, for all tested images, color channels Red and Blue were swapped. For instance in RGBA case, we have BGRA image. Now, I'm not familiar with the imageio plugin, but it seems like if it was horribly broken and returning the wrong channel order, someone would have noticed by now. Has anyone had problems with this on OSX 32-bit or 64-bit? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg, macosx-x86_64 imageio plugin color byte swap problem
Hi Chris, On 22/02/12 20:29 , Stephan Maximilian Huber wrote: I tested the imageio-plugin on os x 10.7 with an older 32bit build (from Nov 2011) and it works for me. I tested only png and jpg files. I've also tested imageio on 10.7 with a current 64-bit build (trunk) and it works okay (png, jpg, gif). /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg, macosx-x86_64 imageio plugin color byte swap problem
On Wed, Feb 22, 2012 at 2:55 AM, Ulrich Hertlein u.hertl...@sandbox.dewrote: Hi Chris, On 22/02/12 20:29 , Stephan Maximilian Huber wrote: I tested the imageio-plugin on os x 10.7 with an older 32bit build (from Nov 2011) and it works for me. I tested only png and jpg files. I've also tested imageio on 10.7 with a current 64-bit build (trunk) and it works okay (png, jpg, gif). Thanks for the feedback. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osg, macosx-x86_64 imageio plugin color byte swap problem
I had a user contact me for some assistance on this issue. I'm not an OSX/imageio guy, so I don't know the ramifications of this, and I thought I'd throw it out for the wider community to comment on before proposing a patch. From the user: We have found some image color ordering issue on MacOS Snow Leopard 10.6. We do x86_64 build, with imageio plugin. We set CMAKE flag: OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio For some reason, for all tested images, color channels Red and Blue were swapped. For instance in RGBA case, we have BGRA image. Now, I'm not familiar with the imageio plugin, but it seems like if it was horribly broken and returning the wrong channel order, someone would have noticed by now. Has anyone had problems with this on OSX 32-bit or 64-bit? -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org