OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

ReaderWriterRGB


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission
View previous topic :: View next topic  
Author Message
Andreas Ekstrand
Guest





PostPosted: Fri Nov 10, 2017 4:31 pm    Post subject:
ReaderWriterRGB
Reply with quote

Hi,

Attached is a fix in ReaderWriterRGB, based on latest from Git, that encapsulates the true raw image data in a separate struct.

After the change from 2016 that made rawImageRec extend osg::Referenced and implement a constructor/destructor, it wasn't really 'raw' and didn't work when writing .rgb files - unwanted header data was written.

Regards,
Andreas

------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11910

PostPosted: Sat Nov 11, 2017 11:30 am    Post subject:
ReaderWriterRGB
Reply with quote

Hi Andreas,

I did a review of your changes and feel that the changes make the code
a bit awkward to read so having learned what is wrong with the
original code from you submission have refactored rawImageRec so it's
back to it's original simple unref counted status without any virtual
functions, and moved the ref counting into a separate refImageRec
class that subclasses from rawImageRec and Referenced. I also
introduced use of a & reference rather than use of C* pointer so that
the various refImageRec access codes can use . instead of ->, this
helps with the readability of the code. The changes are in the
commit:

https://github.com/openscenegraph/OpenSceneGraph/commit/ee118c872f1d4fa0ad2ab7a0b96bf2279bc3d925

To test of the write .rgb bug in the original code I created the
attached small test program, this confirm that the original write code
was buggy and when your or my new changes are applied the .rgb is now
output correctly. I attach my test program for completeness.

Cheers,
Robert.

On 10 November 2017 at 16:30, Andreas Ekstrand
<> wrote:
Quote:
Hi,

Attached is a fix in ReaderWriterRGB, based on latest from Git, that
encapsulates the true raw image data in a separate struct.

After the change from 2016 that made rawImageRec extend osg::Referenced and
implement a constructor/destructor, it wasn't really 'raw' and didn't work
when writing .rgb files - unwanted header data was written.

Regards,
Andreas







------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Andreas Ekstrand
Guest





PostPosted: Sun Nov 12, 2017 12:20 pm    Post subject:
ReaderWriterRGB
Reply with quote

Hi Robert,

Thanks, I appreciate the alternative implementation and agree that my solution was a bit more awkward. I tested your version with my test code as well and it works fine!

Regards,
Andreas



On 2017-11-11 12:29, Robert Osfield wrote:

Quote:
Quote:
Hi Andreas,

I did a review of your changes and feel that the changes make the code
a bit awkward to read so having learned what is wrong with the
original code from you submission have refactored rawImageRec so it's
back to it's original simple unref counted status without any virtual
functions, and moved the ref counting into a separate refImageRec
class that subclasses from rawImageRec and Referenced. I also
introduced use of a & reference rather than use of C* pointer so that
the various refImageRec access codes can use . instead of ->, this
helps with the readability of the code. The changes are in the
commit:

https://github.com/openscenegraph/OpenSceneGraph/commit/ee118c872f1d4fa0ad2ab7a0b96bf2279bc3d925

To test of the write .rgb bug in the original code I created the
attached small test program, this confirm that the original write code
was buggy and when your or my new changes are applied the .rgb is now
output correctly. I attach my test program for completeness.

Cheers,
Robert.

On 10 November 2017 at 16:30, Andreas Ekstrand
<> (
Only registered users can see emails on this board!
Get registred or enter the forums!
) wrote:
Quote:
Hi,

Attached is a fix in ReaderWriterRGB, based on latest from Git, that
encapsulates the true raw image data in a separate struct.

After the change from 2016 that made rawImageRec extend osg::Referenced and
implement a constructor/destructor, it wasn't really 'raw' and didn't work
when writing .rgb files - unwanted header data was written.

Regards,
Andreas


_______________________________________________
osg-submissions mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org



Quote:
_______________________________________________
osg-submissions mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11910

PostPosted: Sun Nov 12, 2017 1:06 pm    Post subject:
ReaderWriterRGB
Reply with quote

Great, thanks for the testing.

On 12 November 2017 at 12:19, Andreas Ekstrand
<> wrote:
Quote:
Hi Robert,

Thanks, I appreciate the alternative implementation and agree that my
solution was a bit more awkward. I tested your version with my test code as
well and it works fine!

Regards,
Andreas



On 2017-11-11 12:29, Robert Osfield wrote:

Hi Andreas,

I did a review of your changes and feel that the changes make the code
a bit awkward to read so having learned what is wrong with the
original code from you submission have refactored rawImageRec so it's
back to it's original simple unref counted status without any virtual
functions, and moved the ref counting into a separate refImageRec
class that subclasses from rawImageRec and Referenced. I also
introduced use of a & reference rather than use of C* pointer so that
the various refImageRec access codes can use . instead of ->, this
helps with the readability of the code. The changes are in the
commit:


https://github.com/openscenegraph/OpenSceneGraph/commit/ee118c872f1d4fa0ad2ab7a0b96bf2279bc3d925

To test of the write .rgb bug in the original code I created the
attached small test program, this confirm that the original write code
was buggy and when your or my new changes are applied the .rgb is now
output correctly. I attach my test program for completeness.

Cheers,
Robert.

On 10 November 2017 at 16:30, Andreas Ekstrand
<> wrote:

Hi,

Attached is a fix in ReaderWriterRGB, based on latest from Git, that
encapsulates the true raw image data in a separate struct.

After the change from 2016 that made rawImageRec extend osg::Referenced and
implement a constructor/destructor, it wasn't really 'raw' and didn't work
when writing .rgb files - unwanted header data was written.

Regards,
Andreas














------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts osgPlugins ReaderWriterRGB miluit01 Plugins [osgPlugins] 3 Tue Jun 14, 2016 7:38 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP