예제 #1
0
 /*! returns range of displays that are affected by the given
   region of pixels (ie, that together are guaranteed to cover
   that pixel region */
 box2i  WallConfig::affectedDisplays(const box2i &pixelRegion) const
 {
   vec2i lo
     = (pixelRegion.lower+bezelPixelsPerDisplay())
     / (pixelsPerDisplay+bezelPixelsPerDisplay());
   vec2i hi
     = (pixelRegion.upper + pixelsPerDisplay - vec2i(1)) 
     / (pixelsPerDisplay+bezelPixelsPerDisplay());
   // vec2i hi
   // = divRoundUp(pixelRegion.upper,pixelsPerDisplay+bezelPixelsPerDisplay());
   if (hi.x > numDisplays.x || hi.y > numDisplays.y) {
     PING; 
     PRINT(pixelRegion);
     PRINT(totalPixels());
     throw std::runtime_error("invalid region in 'affectedDispalys()')");
   }
   return box2i(lo,hi);
 }
예제 #2
0
void LocalFrameBuffer::clear(const uint32 fbChannelFlags)
{
    if (fbChannelFlags & OSP_FB_ACCUM) {
        // it is only necessary to reset the accumID,
        // LocalFrameBuffer_accumulateTile takes care of clearing the
        // accumulation buffers
        memset(tileAccumID, 0, tiles*sizeof(int32));

        // always also clear error buffer (if present)
        if (hasVarianceBuffer) {
            for (int i = 0; i < tiles; i++)
                tileErrorBuffer[i] = inf;

            errorRegion.clear();
            // initially create one region covering the complete image
            errorRegion.push_back(box2i(vec2i(0), vec2i(tilesx, divRoundUp(size.y, TILE_SIZE))));
        }
    }
}
예제 #3
0
 /*! return the pixel region in the global display wall space that
     display at given coordinates is covering */
 box2i  WallConfig::regionOfDisplay(const vec2i &displayID) const
 {
   const vec2i lo = displayID * (pixelsPerDisplay + bezelPixelsPerDisplay()); 
   return box2i(lo, lo + pixelsPerDisplay);
 }