Compare two textures pixelwise (for test purpose)

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Compare two textures pixelwise (for test purpose)

Martin
For my non regression tests, I want to compare the TextureData of an offscreen chart with TextureData loaded from a png file.

Long time ago I used BufferedImage.getRGB(x,y) but it is AWT dependent and I would prefer to rely on the genericity of JOGL. However I can't find an equivalent of getRGB or getRGBA on TextureData, neither on Texture.

What would you suggest to do so?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Compare two textures pixelwise (for test purpose)

gouessej
Administrator
Hi

You can use getBuffer() but such a comparison would work if and only if both instances of TextureData use the same color space, the same pixel format, etc.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Compare two textures pixelwise (for test purpose)

Martin

2015-10-16 15:34 GMT+02:00 gouessej [via jogamp] <[hidden email]>:
Hi

You can use getBuffer() but such a comparison would work if and only if both instances of TextureData use the same color space, the same pixel format, etc.


If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/Compare-two-textures-pixelwise-for-test-purpose-tp4035481p4035485.html
To unsubscribe from Compare two textures pixelwise (for test purpose), click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Compare two textures pixelwise (for test purpose)

gouessej
Administrator
You have to read the data in this buffer, sorry :s The RGB(A) components are stored into this buffer for sure.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Compare two textures pixelwise (for test purpose)

gouessej
Administrator
In reply to this post by Martin
I have a class with a method to get the RGBA value from the byte buffer, I plan to move it into Ardor3D. Are you still interested in this feature?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Compare two textures pixelwise (for test purpose)

Martin
Yes, this is an interesting thing to share, thank you Julien.
Reply | Threaded
Open this post in threaded view
|

Re: Compare two textures pixelwise (for test purpose)

gouessej
Administrator
It's currently called ImageHelper. It allowed me to drop AWT typically when I wanted to modify the image data of a texture before sending it anew to the GPU. I'll copy it into JogAmp's Ardor3D Continuation next week.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Compare two textures pixelwise (for test purpose)

gouessej
Administrator
In reply to this post by Martin
Done:
https://github.com/gouessej/Ardor3D/commit/9b8b30718a8b82221d1a75e4dce23dea8a19836c

In my humble opinion, those methods should be moved into JOGL itself, a texture data object should be able to tell which color is in each of its pixels.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Compare two textures pixelwise (for test purpose)

Martin
I agree with you.
Thank you for sharing.


2015-11-02 22:00 GMT+01:00 gouessej [via jogamp] <[hidden email]>:
Done:
https://github.com/gouessej/Ardor3D/commit/9b8b30718a8b82221d1a75e4dce23dea8a19836c

In my humble opinion, those methods should be moved into JOGL itself, a texture data object should be able to tell which color is in each of its pixels.


If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/Compare-two-textures-pixelwise-for-test-purpose-tp4035481p4035710.html
To unsubscribe from Compare two textures pixelwise (for test purpose), click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Compare two textures pixelwise (for test purpose)

gouessej
Administrator