[osg-users] Image to Array

Robert Osfield robert.osfield at gmail.com
Wed May 13 06:31:09 PDT 2015


Hi Andreas,

There isn't an OSG function to convert an osg::Image into array, there
are however, various ways to access the data, and if you wanted to
write your own conversion tool you could.  Have a look at the template
helpers in include/osg/ImageUtils.

Robert.

On 13 May 2015 at 13:50, Andreas Schreiber <ayss at online.de> wrote:
> Hi,
>
> i am searching for the functionality to store an image (for example a *.jpg image) in an array so I can analyse an explicit part of the image.
>
> I did this once in java where I used an int[][][] to get to the position of an pixel and then get his color vec.
>
> But there I used and extra class for Images.
>
> Now I thought maybe there is also a function in osg to store an image to an array.
>
> I found that  if I create this "osg::Image test". test has the function "asArray" but the output of this is "00000"
>
>
> Hope someone can help me out.
> ...
>
> Thank you!
>
> Cheers,
> Andreas
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=63736#63736
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list