(Fwd) Re: Volumizer

New Message Reply Date view Thread view Subject view Author view

Robert Grzeszczuk (rg)
Thu, 1 Jul 1999 09:31:20 -0700 (PDT)


Folks,

I just occured to me that some the I/O problems that were recently reported on
info-volumizer may be related to a fix that was applied a couple of months ago
(which would explain why I can't reproduce it). Let me know if this was in any
way related.

This fix is a part of patch3696. So you may want to hold of another week or
so.

-rg

--- Forwarded mail from "Robert Grzeszczuk" <rg>

Date: Mon, 17 May 1999 14:09:37 -0700 (PDT)
From: rg (Robert Grzeszczuk)

...

I tracked it down as an error in my demo code that does zero-padding for
incomplete bricks. Fortunately, it can be easily fixed. Simply move the
memset() call before the for(;;) loops in both myReadBrickIfl() (starting at
around line 173 of myBrickIO.cxx) and myReadBrickRaw() (around line 417):

...
  fprintf (stderr, "/\b");

  // KLUDGE does not set all the borders
  for (int j0 = 0; j0 < zPartBrickSize; j0++)
    for (int j1 = 0; j1 < yPartBrickSize; j1++)
      {
        memcpy (
                 (unsigned char *) data + j0 * xBrickSize * yBrickSize + j1 *
xBrickSize,
        buffer + j0 * xPartBrickSize * yPartBrickSize + j1 * xPartBrickSize,
                 xPartBrickSize);
        memset (
                 buffer + j0 * xPartBrickSize * yPartBrickSize + j1 * xPartBri
ckSize + xPartBrickSize,
                 0, xBrickSize - xPartBrickSize);
      }

  delete[]buffer;

  fprintf (stderr, "-\b");
  ...

with:

        fprintf(stderr, "/\b");

        memset((unsigned char *) data,0,xBrickSize*yBrickSize*zBrickSize*bpp);

        for (int j0 = 0; j0 < zPartBrickSize; j0++)
            for (int j1 = 0; j1 < yPartBrickSize; j1++) {
                memcpy(
                 (unsigned char *)data+j0*xBrickSize*yBrickSize+j1*xBrickSize,
                 buffer+j0*xPartBrickSize*yPartBrickSize+j1*xPartBrickSize,
                 xPartBrickSize);
            }

        delete[]buffer;

        fprintf(stderr, "-\b");

Incidently, there is still another minor error that was reported eralier on
info-volumizer: the brick sizes in the x direction should be 64 and 4, and not
64 and 8. But this should not effect the correctness of the display, just
dwonload time (and not necessarily negatively). I'm working on a patch that
will fix that a few other bugs that were reported on info_volumizer.

-rg

...

---End of forwarded mail from "Robert Grzeszczuk" <rg>


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Nov 01 1999 - 14:11:13 PST