ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/RpictSimulManager.h
(Generate patch)

Comparing ray/src/rt/RpictSimulManager.h (file contents):
Revision 2.2 by greg, Sun Aug 18 00:37:13 2024 UTC vs.
Revision 2.7 by greg, Fri Aug 23 02:08:28 2024 UTC

# Line 85 | Line 85 | class PixelAccess { (public)
85                                  refDepth = 1.;
86                                  Init(bp, ystride, dp);
87                          }
88 +                        PixelAccess(COLORV *rp, int ystride, short *dp) {
89 +                                refDepth = 1.;
90 +                                Init(rp, ystride, dp);
91 +                        }
92          void            Init() {
93                                  pbase.f = NULL; dbase.f = NULL;
94                                  rowStride = 0;
# Line 122 | Line 126 | class PixelAccess { (public)
126                                  }
127                                  if (dp) dtyp |= RDTdshort;
128                          }
129 +        void            Init(COLORV *rp, int ystride, short *dp) {
130 +                                pbase.f = rp; dbase.s = dp;
131 +                                rowStride = ystride;
132 +                                if (NCSAMP > 3) {
133 +                                        dtyp = RDTscolor; primp = NULL;
134 +                                } else {
135 +                                        dtyp = RDTrgb; primp = stdprims;
136 +                                }
137 +                                if (dp) dtyp |= RDTdshort;
138 +                        }
139                          /// Set color space after non-empty initialization
140          bool            SetColorSpace(RenderDataType cs, RGBPRIMP pr=NULL);
141                          /// Get color space
# Line 237 | Line 251 | class RpictSimulManager : protected RtraceSimulManager
251          COLORV *                barPix;                 // current render bar pixels
252          float *                 barDepth;               // current render bar depths
253          bool                    SetTile(const int ti[2]);
254 <        bool                    RenderRect();
254 >        bool                    RenderRect(const int x0 = 0, const int y0 = 0);
255          bool                    ComputePixel(int x, int y);
256 <        bool                    BelowSampThresh(int x, int y, const int noff[4][2]) const;
256 >        bool                    BelowSampThresh(const int x, const int y,
257 >                                                        const int noff[4][2]) const;
258          void                    FillSquare(const int x, const int y, const int noff[4][2]);
259          void                    NewBar(int ht = 0);
260 <        bool                    LowerBar(int v);
260 >        bool                    LowerBar(int v, int ytop);
261          bool                    RenderBelow(int ytop, const int vstep, FILE *pfp,
262                                                          const int dt, FILE *dfp=NULL);
263   public:
# Line 261 | Line 276 | class RpictSimulManager : protected RtraceSimulManager
276                                          frameNo = 0;
277                                  }
278                                  ~RpictSimulManager() {
279 <                                        NewBar();
279 >                                        delete [] barPix; delete [] barDepth;
280                                  }
281                                  /// Load octree and prepare renderer
282          bool                    LoadOctree(const char *octn) {
# Line 325 | Line 340 | class RpictSimulManager : protected RtraceSimulManager
340                                  /// Increments frameNo if >0
341          bool                    NewFrame(const VIEW &v, int xydim[2], double *ap=NULL,
342                                                  const int *tgrid=NULL);
343 +                                /// Get current view if set
344 +        const VIEW *            GetView() const {
345 +                                        if (!vw.type) return NULL;
346 +                                        return &vw;
347 +                                }
348 +                                /// Writeable previous view (for motion blur)
349 +        VIEW &                  PreView() {
350 +                                        return pvw;
351 +                                }
352                                  /// Get current picture width
353          int                     GetWidth() const {
354                                          return hvres[0];
# Line 353 | Line 377 | class RpictSimulManager : protected RtraceSimulManager
377                                  /// Same but also use 16-bit encoded depth buffer
378          bool                    RenderTile(COLRV *bp, int ystride, short *dp,
379                                                  const int *tile=NULL);
380 +                                /// Back to float color with 16-bit depth
381 +        bool                    RenderTile(COLORV *rp, int ystride, short *dp,
382 +                                                const int *tile=NULL);
383                                  /// Render and write a frame to the named file
384                                  /// Include any header lines set prior to call
385 <                                /// Picture file must not already exist
385 >                                /// Picture file must not exist
386                                  /// Write pixels to stdout if !pfname
387                                  /// Write depth to a command if dfname[0]=='!'
388          RenderDataType          RenderFrame(const char *pfname,
# Line 364 | Line 391 | class RpictSimulManager : protected RtraceSimulManager
391                                  /// Resume partially finished rendering
392                                  /// Picture file must exist with valid header
393          RenderDataType          ResumeFrame(const char *pfname,
394 +                                                const char *dfname=NULL);
395 +                                /// Prepare new picture (and depth) output
396 +                                /// Called by RenderFrame()
397 +        RenderDataType          NewOutput(FILE *pdfp[2], const char *pfname,
398 +                                                RenderDataType dt=RDTrgbe,
399 +                                                const char *dfname=NULL);
400 +                                /// Reopen existing picture (and depth) file
401 +                                /// Called by ResumeFrame()
402 +                                /// File pointers @ end of header (before res.)
403 +        RenderDataType          ReopenOutput(FILE *pdfp[2], const char *pfname,
404                                                  const char *dfname=NULL);
405                                  /// Close octree, free data, return status
406          int                     Cleanup(bool everything = false) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines