Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
Get pixel array of float images in XSI...

Get pixel array of float images in XSI...

2005-01-25       - By Aloys Baillet

 Back
Reply:     1     2  

Hi all,

I'm currently trying to read the color of a floating point image clip in XSI.
Unfortunately the only information I could find to retrieve the color
value of each pixel was "The data is formatted as an array of pixel
color values, row by row." from the SDK doc.
Then I tried to read the data in that way:

<code>
  // ---[ Get Image properties and pixels
]-- ---- ---- ---- ---- ---- ---- ---- ---- ----
  const void * pixels = image.GetPixelArray();
  long i_max = image.GetResX();
  long j_max = image.GetResY();
  long nb_chan = image.GetChannelSize();
  long pix_size = image.GetChannelSize();
  long max_size = image.GetPixelArraySize();
 
  float r, g, b;
  long buf_idx = 0;

  if (pix_size == sizeof(float)){
    for (long i=0; i<i_max; i++){
      for (long j=0; j<j_max; j++){
        buf_idx = (i + j*i_max)*nb_chan;
        memcpy(&r, (float*)pixels + buf_idx, pix_size);
        buf_idx += pix_size;
        memcpy(&g, (float*)pixels + buf_idx, pix_size);
        buf_idx +=pix_size;
        memcpy(&b, (float*)pixels + buf_idx, pix_size);
        k++;
      }
    }
  }

</code>

But I didn't get the expected values...
So has anyone allready tried to read float pixels in C++ in XSI?
Or maybe somebody at Soft could help on this one?
Thank you!

--
Aloys Baillet - TD / R&D @ La Maison - www.alamaison.fr
---
Unsubscribe? Mail Majordomo@(protected) with the following text in body:
unsubscribe xsi