Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Questions/proposal for readImageFile() - Detect unloaded images
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sukender  
View profile  
 More options Oct 31 2012, 11:31 am
From: Sukender <suky0...@free.fr>
Date: Wed, 31 Oct 2012 16:31:19 +0100 (CET)
Local: Wed, Oct 31 2012 11:31 am
Subject: [osg-users] Questions/proposal for readImageFile() - Detect unloaded images
Hi all,

Here is a problem to solve : how can you highlight surfaces where textures didn't load properly (missing file, read error...)?
My first answer was to create a ReadFileCallback, and make readImage() encapsulate "default" call. If call fails, then I return a "dummy" image (1x1 pixel, flashy color, such as magenta).

However this doesn't work, as readers may call readImageFile() multiple times. Ex:
  image = readImageFile(path1);
  if (!image) readImageFile(path2);
  if (!image) etc...
In my case, readImageFile(path1) returns either the normal image, or the dummy one (path2 is never tested).

I propose to add some stuff to allow a ReadFileCallback to know a bit more about where the caller is. I'd like to know if you have any idea... Here are mine :
  1. In all readers, call readImageFile("") in the last case (or another method such as "Registry::readImageFileFailed()"), so that ReadFileCallback knows all other calls failed. Just ugly, I think.
  2. In all readers, add something in the osgDB::Options structure in their last call, for the same purpose. Ugly too.
  3. Change readImageFile() / ReadFileCallback to pass an additional parameter. Very ulgy!
  4. In all readers, add a ValueObject (or something else) to record the fact loading failed. This would allow post-load code to detect this info.
As you can see, I got no "clean" idea. Please help !

Cheers,

Sukender
_______________________________________________
osg-users mailing list
osg-us...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Questions/proposal for readImageFile() - Detectunloaded images" by Thrall, Bryan
Thrall, Bryan  
View profile  
 More options Oct 31 2012, 11:57 am
From: "Thrall, Bryan" <bryan.thr...@flightsafety.com>
Date: Wed, 31 Oct 2012 10:57:09 -0500
Local: Wed, Oct 31 2012 11:57 am
Subject: Re: [osg-users] Questions/proposal for readImageFile() - Detectunloaded images
Sukender wrote on 2012-10-31:

It seems better to just write your own visitor to traverse the
scenegraph after loading to find the images that didn't load.

Hope this helps,
--
Bryan Thrall
Principal Software Engineer
FlightSafety International
bryan.thr...@flightsafety.com

_______________________________________________
osg-users mailing list
osg-us...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »