My Project
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
mcrt_dataio::ClientReceiverFb Class Reference

Classes

class  Impl
 

Public Types

enum  DenoiseEngine : int { OPTIX, OPEN_IMAGE_DENOISE }
 
enum  DenoiseMode : int {
  DISABLE, ENABLE, ENABLE_W_ALBEDO, ENABLE_W_NORMAL,
  ENABLE_W_ALBEDO_NORMAL
}
 
enum  BackendStat : int {
  IDLE, RENDER_PREP_RUN, RENDER_PREP_CANCEL, MCRT,
  UNKNOWN
}
 
enum  SenderMachineId : int { DISPATCH = -1, MERGE = -2, UNKNOWN = -3 }
 
using CallBackStartedCondition = std::function< void()>
 
using CallBackGenericComment = std::function< void(const std::string &comment)>
 
using CallBackSendMessage = std::function< bool(const arras4::api::MessageContentConstPtr msg)>
 
using Parser = scene_rdl2::grid_util::Parser
 

Public Member Functions

ClientReceiverFboperator= (const ClientReceiverFb &)=delete
 This class is Non-copyable.
 
 ClientReceiverFb (const ClientReceiverFb &)=delete
 
bool decodeProgressiveFrame (const mcrt::ProgressiveFrame &message, const bool doParallel, const CallBackStartedCondition &callBackFuncAtStartedCondition, const CallBackGenericComment &callBackForGenericComment=nullptr)
 decode ProgressiveFrame message and update internal fb data accordingly. More...
 
size_t getViewId () const
 Get View id of current image. More...
 
uint32_t getFrameId () const
 Get frame id of current image. More...
 
mcrt::BaseFrame::Status getStatus () const
 Get current image's status. More...
 
BackendStat getBackendStat () const
 
float getRenderPrepProgress () const
 Get current image's renderPrep stage progress fraction value. More...
 
float getProgress () const
 Get current image's progress fraction value. More...
 
bool isCoarsePass () const
 Make sure current image is coarse pass or not. More...
 
uint64_t getSnapshotStartTime () const
 Get time of snapshot was executed on MCRT computation. More...
 
float getElapsedSecFromStart ()
 Get elapsed time from snapshot was executed on MCRT computation to current. More...
 
uint64_t getRecvMsgSize () const
 Return last received ProgressiveFrame message size. More...
 
unsigned getWidth () const
 Get rezed viewport width. More...
 
unsigned getHeight () const
 Get rezed viewport height. More...
 
const scene_rdl2::math::Viewport & getRezedViewport () const
 Get rezed viewport. More...
 
bool getRoiViewportStatus () const
 Get ROI viewport condition. More...
 
const scene_rdl2::math::Viewport & getRoiViewport () const
 Get ROI viewport if it's set. If there is no ROI viewport, return useless info. More...
 
bool getPixelInfoStatus () const
 Get PixelInfo data condition. More...
 
const std::string & getPixelInfoName () const
 Get PixelInfo data AOV buffer name if image has PixelInfo data. More...
 
int getPixelInfoNumChan () const
 Get PixelInfo data's total channel number. More...
 
bool getHeatMapStatus () const
 Get HeatMap data condition. More...
 
const std::string & getHeatMapName () const
 Get HeatMap data AOV buffer name if image has HeatMap data. More...
 
int getHeatMapNumChan () const
 Get HeatMap data's total channel number. More...
 
bool getWeightBufferStatus () const
 Get Weight buffer data condition. More...
 
const std::string & getWeightBufferName () const
 Get Weight buffer data AOV buffer name if image has Weight buffer data. More...
 
int getWeightBufferNumChan () const
 Get Weight buffer data's total channel number. More...
 
bool getRenderBufferOddStatus () const
 Get RenderBufferOdd data condition. More...
 
int getRenderBufferOddNumChan () const
 Get RenderBufferOdd data's total channel number. More...
 
unsigned getTotalRenderOutput () const
 Get total number of RenderOutput (AOV) of this image. More...
 
const std::string & getRenderOutputName (const unsigned id) const
 Get AOV buffer name. More...
 
int getRenderOutputNumChan (const unsigned id) const
 Get AOV buffer's channel total. More...
 
int getRenderOutputNumChan (const std::string &aovName) const
 Get AOV buffer's channel total. More...
 
bool getRenderOutputClosestFilter (const unsigned id) const
 Get AOV buffer's closestFilter use status. More...
 
bool getRenderOutputClosestFilter (const std::string &aovName) const
 Get AOV buffer's closestFilter use status. More...
 
void setDenoiseEngine (DenoiseEngine engine)
 Setup denoise engine mode for denoise operation. More...
 
DenoiseEngine getDenoiseEngine () const
 Get current denoise engine mode for denoise operation. More...
 
void setBeautyDenoiseMode (DenoiseMode mode)
 Setup denoise mode for the beauty data. More...
 
DenoiseMode getBeautyDenoiseMode () const
 Get denoise mode for the beauty data. More...
 
const std::string & getErrorMsg () const
 Get error message. More...
 
bool getBeautyRgb888 (std::vector< unsigned char > &rgbFrame, const bool top2bottom=false, const bool isSrgb=false)
 Get current beauty buffer data as 8bit RGB 3 channels w/ gamma2.2 or sRGB conversion. More...
 
bool getPixelInfoRgb888 (std::vector< unsigned char > &rgbFrame, const bool top2bottom=false, const bool isSrgb=false)
 Get current PixelInfo buffer data as 8bit monochrome color RGB 3 channels. More...
 
bool getHeatMapRgb888 (std::vector< unsigned char > &rgbFrame, const bool top2bottom=false, const bool isSrgb=false)
 Get current HeatMap buffer data as 8bit RGB 3 channels. More...
 
bool getWeightBufferRgb888 (std::vector< unsigned char > &rgbFrame, const bool top2bottom=false, const bool isSrgb=false)
 Get current Weight buffer data as 8bit RGB 3 channels. More...
 
bool getBeautyAuxRgb888 (std::vector< unsigned char > &rgbFrame, const bool top2bottom=false, const bool isSrgb=false)
 Get current RenderBufferOdd (aka BeautyAux) data as 8bit RGB 3 channels. More...
 
bool getRenderOutputRgb888 (const unsigned id, std::vector< unsigned char > &rgbFrame, const bool top2bottom=false, const bool isSrgb=false, const bool closestFilterDepthOutput=false)
 Get current RenderOutput(=AOV) buffer data as 8bit RGB 3 channels. More...
 
bool getRenderOutputRgb888 (const std::string &aovName, std::vector< unsigned char > &rgbFrame, const bool top2bottom=false, const bool isSrgb=false, const bool closestFilterDepthOutput=false)
 Get current RenderOutput(=AOV) buffer data as 8bit RGB 3 channels. More...
 
bool getBeauty (std::vector< float > &rgba, const bool top2bottom=false)
 Get current beauty buffer data as float (=32bit single float) RGBA 4 channels. More...
 
bool getPixelInfo (std::vector< float > &data, const bool top2bottom=false)
 Get current PixelInfo buffer data as float (=32bit single float) 1 channel data. More...
 
bool getHeatMap (std::vector< float > &data, const bool top2bottom=false)
 Get current HeatMap buffer data as float (=32bit single float) 1 channel data. More...
 
bool getWeightBuffer (std::vector< float > &data, const bool top2bottom=false)
 Get current weight buffer data as float (=32bit single float) 1 channel data. More...
 
bool getBeautyOdd (std::vector< float > &rgba, const bool top2bottom=false)
 Get current RenderBufferOdd data as float (=32bit single float) RGBA 4 channels. More...
 
int getRenderOutput (const unsigned id, std::vector< float > &data, const bool top2bottom=false, const bool closestFilterDepthOutput=false)
 Get current RenderOutput(=AOV) buffer data. More...
 
int getRenderOutput (const std::string &aovName, std::vector< float > &data, const bool top2bottom=false, const bool closestFilterDepthOutput=false)
 Get current RenderOutput(=AOV) buffer data. More...
 
scene_rdl2::math::Vec4f getPixBeauty (const int sx, const int sy) const
 Get pixel value of beauty buffer. More...
 
float getPixPixelInfo (const int sx, const int sy) const
 Get pixel value of pixelInfo (depth) buffer. More...
 
float getPixHeatMap (const int sx, const int sy) const
 Get pixel value of heatMap buffer. More...
 
float getPixWeightBuffer (const int sx, const int sy) const
 Get pixel value of weight buffer. More...
 
scene_rdl2::math::Vec4f getPixBeautyOdd (const int sx, const int sy) const
 Get pixel value of beauty odd buffer. More...
 
int getPixRenderOutput (const unsigned id, const int sx, const int sy, std::vector< float > &out) const
 Get pixel value of renderOutput (AOV) buffer. More...
 
int getPixRenderOutput (const std::string &aovName, const int sx, const int sy, std::vector< float > &out) const
 Get pixel value of renderOutput (AOV) buffer. More...
 
std::string showPix (const int sx, const int sy, const std::string &aovName) const
 Return pixel value detailed information by string. More...
 
const scene_rdl2::grid_util::LatencyLog & getLatencyLog () const
 Get current LatencyLog information. More...
 
const scene_rdl2::grid_util::LatencyLogUpstream & getLatencyLogUpstream () const
 Get current LatencyLogUpstream information. More...
 
void setInfoRecInterval (const float sec)
 Set infoRec info snapshot minimum interval. Snapshot is never executed less than this interval. More...
 
void setInfoRecDisplayInterval (const float sec)
 Set minimum interval of showing infoRec information. More...
 
void setInfoRecFileName (const std::string &fileName)
 Set filename of infoRec dump. More...
 
void updateStatsMsgInterval ()
 This API records message receive timing in order to get statistical information. More...
 
void updateStatsProgressiveFrame ()
 This API updates progressiveFrame related internal information. More...
 
bool getStats (const float intervalSec, std::string &outMsg)
 This API creates a string for displaying statistical information at client side. More...
 
float getRecvImageDataFps ()
 This API returns how frequently received and decoded image data (as progressiveFrame message). More...
 
unsigned getFbActivityCounter ()
 This API returns total update operation count regarding internal frame buffer. More...
 
void consoleAutoSetup (const CallBackSendMessage &sendMessage)
 This API enables ClientReceiverFb's debug console functionality by the environment variable. More...
 
void consoleEnable (const unsigned short port, const CallBackSendMessage &sendMessage)
 This API enables ClientReceiverFb's debug console functionality. More...
 
ClientReceiverConsoleDriverconsoleDriver ()
 Returns console driver. More...
 
Parser & getParser ()
 Returns Parser object reference. More...
 
void setTimingRecorderHydra (std::shared_ptr< TimingRecorderHydra > ptr)
 Set TimingRecorderHydra data point for performance analysis for hdMoonray. More...
 
int getReceivedImageSenderMachineId () const
 integer representation of machineId that originally sent last received image. More...
 
void setTelemetryOverlayReso (unsigned width, unsigned height)
 Set telemetry overlay information display resolution. More...
 
void setTelemetryOverlayActive (bool sw)
 Set telemetry overlay enable/disable condition. More...
 
bool getTelemetryOverlayActive () const
 Get telemetry overlay enable/disable condition. More...
 
void switchTelemetryLayoutNext ()
 switch telemetry overlay layout to the next More...
 

Static Public Member Functions

static std::string showDenoiseEngine (const DenoiseEngine &engine)
 String replasentation of DenoiseMode. More...
 
static std::string showDenoiseMode (const DenoiseMode &mode)
 String replasentation of DenoiseMode. More...
 
static std::string showBackendStat (const BackendStat &stat)
 String reprasentation of BackendStat. More...
 
static std::string showSenderMachineId (int machineId)
 string representation of sender's machineId More...
 

Protected Attributes

std::unique_ptr< ImplmImpl
 

Member Function Documentation

void mcrt_dataio::ClientReceiverFb::consoleAutoSetup ( const CallBackSendMessage &  sendMessage)

This API enables ClientReceiverFb's debug console functionality by the environment variable.

Parameters
sendMessageYou need to setup call back function for send message to the back-end engine

ClientReceiver's debug console is enabled when environment variable "CLIENTRECEIVER_CONSOLE <port>" is set up. <port> is used for port number in order to connect to the debug console by telnet-connection. A typical client to connect ClientReceiver's debug console is "telnet".

ClientReceiverConsoleDriver & mcrt_dataio::ClientReceiverFb::consoleDriver ( )

Returns console driver.

Returns
ClientReceiverConsoleDriver

Sometimes, you want to access ClientReceiverConsoleDriver directly. You need to access ClientReceiverConsoleDriver, if your client needs to add more parsing commands into them. arras_render is a good example.

void mcrt_dataio::ClientReceiverFb::consoleEnable ( const unsigned short  port,
const CallBackSendMessage &  sendMessage 
)

This API enables ClientReceiverFb's debug console functionality.

Parameters
portThe port is used for port number in order to connect to the debug console by telnet-connection.
sendMessageYou need to setup call back function for send message to the back-end engine

This API enables ClientReceiverFb's debug console functionality by setup all necessary information by its arguments. You should use this API if you want to set up all information by yourself instead of using environment variables by consoleAutoSetup().

bool mcrt_dataio::ClientReceiverFb::decodeProgressiveFrame ( const mcrt::ProgressiveFrame &  message,
const bool  doParallel,
const CallBackStartedCondition &  callBackFuncAtStartedCondition,
const CallBackGenericComment &  callBackForGenericComment = nullptr 
)

decode ProgressiveFrame message and update internal fb data accordingly.

Parameters
messagemessage which you would like to decode
doParalleldecode by multi-threads (=true) or single-thread (=false)
callbackFuncAtStartedConditioncallback function pointer which calls when received message has "STARTED" condition
Returns
decode succeeded (true) or error (false)

This function decodes input message and update internal framebuffer data accordingly. You have to call this function always you received ProgressiveFrame message by received order. If you don't decode some of the ProgressiveFrame message or wrong order of messages, internal framebuffer data is not updated properly and image might be broken. If you get this situation somehow, only solution to solve and back to normal condision is "re-rendering from scratch".

ClientReceiverFb::BackendStat mcrt_dataio::ClientReceiverFb::getBackendStat ( ) const
Returns
backend computation running status

Return backend computation's running status.

returned status description
BackendStat::IDLE idling and ready to process the next message
BackendStat::RENDER_PREP_RUN backend computation is executing renderPrep stage
BackendStat::RENDER_PREP_CANCEL backend computation is middle of canceling renderPrep stage
BackendStat::MCRT backend computation is executing MCRT stage
bool mcrt_dataio::ClientReceiverFb::getBeauty ( std::vector< float > &  rgba,
const bool  top2bottom = false 
)

Get current beauty buffer data as float (=32bit single float) RGBA 4 channels.

Parameters
rgbareturned current beauty buffer as original data.
top2bottomspecify output data Y direction order.
Returns
Return true if properly get beauty information. Return false if an error happened inside the denoise operation but try to return data by falling back to non-denoise mode.

This API is designed for display logic of frontend client.
rgba is automatically adjusted by image size and total size of rgba is getWidth() * getHeight() * 4 * sizeof(float) byte
Internally this API does not do rgba.clear() but do rgba.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output rgba is properly extrapolated.
rgba's data format is R G B A R G B A ... from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, return rgba is flipped Y direction.

bool mcrt_dataio::ClientReceiverFb::getBeautyAuxRgb888 ( std::vector< unsigned char > &  rgbFrame,
const bool  top2bottom = false,
const bool  isSrgb = false 
)

Get current RenderBufferOdd (aka BeautyAux) data as 8bit RGB 3 channels.

Parameters
rgbFramereturned current RenderBufferOdd buffer which is gamma corrected.
top2bottomspecify output data Y direction order.
isSrgbspecify sRGB 8bit quantize mode.

This API is designed for display logic of frontend client.
rgbFrame is automatically adjusted by image size and total size of rgbFrame is getWidth() * getHeight() * 3 byte
Internally this API does not do rgbFrame.clear() but do rgbFrame.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output rgbFrame is properly extrapolated.
rgbFrame's data format is R G B R G B ... from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, output rgbFrame is flipped Y direction. If you set isSrgb = false (this is default), 8bit quantized logic is using gamma 2.2 conversion. If you set isSrgb argument as true, 8bit quantized logic changed from gamma 2.2 to sRGB mode.

ClientReceiverFb::DenoiseMode mcrt_dataio::ClientReceiverFb::getBeautyDenoiseMode ( ) const

Get denoise mode for the beauty data.

Returns
current denoise mode for beauty data
bool mcrt_dataio::ClientReceiverFb::getBeautyOdd ( std::vector< float > &  rgba,
const bool  top2bottom = false 
)

Get current RenderBufferOdd data as float (=32bit single float) RGBA 4 channels.

Parameters
rgbareturned current RenderBufferOdd data buffer.
top2bottomspecify output data Y direction order.
Returns
return true if image has RenderBufferOdd data. false if image does not.

This API is designed for display logic of frontend client.
rgba is automatically adjusted by image size and total size of data is getWidth() * getHeight() * sizeof(float) * 4 byte
internally this API does not do data.clear() but do data.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output data is properly extrapolated.
data's format is lined up from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, return data is flipped Y direction.

bool mcrt_dataio::ClientReceiverFb::getBeautyRgb888 ( std::vector< unsigned char > &  rgbFrame,
const bool  top2bottom = false,
const bool  isSrgb = false 
)

Get current beauty buffer data as 8bit RGB 3 channels w/ gamma2.2 or sRGB conversion.

Parameters
rgbFramereturned current beauty buffer which is gamma2.2 or sRGB conversion.
top2bottomspecify output data Y direction order.
isSrgbspecify sRGB 8bit quantize mode.
Returns
Return true if properly get beauty information. Return false if an error happened inside the denoise operation but try to return data by falling back to non-denoise mode.

This API is designed for display logic of frontend client.
rgbFrame is automatically adjusted by image size and total size of rgbFrame is getWidth() * getHeight() * 3 byte
Internally this API does not do rgbFrame.clear() but do rgbFrame.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output rgbFrame is properly extrapolated.
rgbFrame's data format is R G B R G B ... from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, output rgbFrame is flipped Y direction. If you set isSrgb = false (this is default), 8bit quantized logic is using gamma 2.2 conversion. If you set isSrgb argument as true, 8bit quantized logic changed from gamma 2.2 to sRGB mode.

ClientReceiverFb::DenoiseEngine mcrt_dataio::ClientReceiverFb::getDenoiseEngine ( ) const

Get current denoise engine mode for denoise operation.

Returns
current denoise engine mode
float mcrt_dataio::ClientReceiverFb::getElapsedSecFromStart ( )

Get elapsed time from snapshot was executed on MCRT computation to current.

Returns
Second This API and decodeProgressiveFrame() should be called from same thread.
const std::string & mcrt_dataio::ClientReceiverFb::getErrorMsg ( ) const

Get error message.

The get related APIs might leave error messages internally when they return an error status. For example, getBeauty() API returns false if the internal denoise operation failed and leaves the error messages. This function gets these error messages for the caller. The error message will clear at the next get* API call.

unsigned mcrt_dataio::ClientReceiverFb::getFbActivityCounter ( )

This API returns total update operation count regarding internal frame buffer.

Returns
Return total update operation count from beginning of process.

ClientReceiverFb is tracking the total number of internal frame buffer update operations. And this counter value is returned by this API. This counter is never reset even if the new frame is started. This counter is equivalent to indicate internal frame buffer activity. If this counter is changed, this means the internal frame buffer was updated. If this counter is not changed, this means the internal frame buffer is guaranteed to be stable and never updated. Initial condition of this counter is 0.

uint32_t mcrt_dataio::ClientReceiverFb::getFrameId ( ) const

Get frame id of current image.

Returns
Frame id (= Unique ID per session) of current image

This API returns frame id (a.k.a sync id) of current image.
However current implementation is still experimental. Just use for debugging so far.

bool mcrt_dataio::ClientReceiverFb::getHeatMap ( std::vector< float > &  data,
const bool  top2bottom = false 
)

Get current HeatMap buffer data as float (=32bit single float) 1 channel data.

Parameters
datareturned current HeatMap buffer.
top2bottomspecify output data Y direction order.
Returns
return true if image has HeatMap buffer. false if image does not.

This API is designed for display logic of frontend client.
data is automatically adjusted by image size and total size of data is getWidth() * getHeight() * sizeof(float) byte
Internally this API does not do data.clear() but do data.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output data is properly extrapolated.
Returned data is each pixel's computational cost and unit is second.
data's data format is lined up from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, return data is flipped Y direction.

const std::string & mcrt_dataio::ClientReceiverFb::getHeatMapName ( ) const

Get HeatMap data AOV buffer name if image has HeatMap data.

Returns
HeatMap data's AOV buffer name if image has HeatMap data. If image does not have HeatMap data, just return useless info.
int mcrt_dataio::ClientReceiverFb::getHeatMapNumChan ( ) const

Get HeatMap data's total channel number.

Returns
PixelInfo data's total channel number.
bool mcrt_dataio::ClientReceiverFb::getHeatMapRgb888 ( std::vector< unsigned char > &  rgbFrame,
const bool  top2bottom = false,
const bool  isSrgb = false 
)

Get current HeatMap buffer data as 8bit RGB 3 channels.

Parameters
rgbFramereturned current HeatMap buffer which properly converted to color image.
top2bottomspecify output data Y direction order.
Returns
return true if image has HeatMap buffer. false if image does not.

This API is designed for display logic of frontend client.
rgbFrame is automatically adjusted by image size and total size of rgbFrame is getWidth() * getHeight() * 3 byte
Internally this API does not do rgbFrame.clear() but do rgbFrame.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output rgbFrame is properly extrapolated.
HeatMap data (= each pixels computational cost data) is converted to color value. Most lightest computational cost pixel goes to blue(0,0,1) and heavyest cost pixel goes to red(1,0,0). And cost between lightest and heavyest is converted to somewhere between blue and red.
rgbFrame's data format is R G B R G B ... from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, output rgbFrame is flipped Y direction.

bool mcrt_dataio::ClientReceiverFb::getHeatMapStatus ( ) const

Get HeatMap data condition.

Returns
If image includes HeatMap data, return true. Otherwise false.
unsigned mcrt_dataio::ClientReceiverFb::getHeight ( ) const

Get rezed viewport height.

Returns
Height pixel size
const scene_rdl2::grid_util::LatencyLog & mcrt_dataio::ClientReceiverFb::getLatencyLog ( ) const

Get current LatencyLog information.

Returns
return reference to current LatencyLog

If upstream computation sends LatencyLog data to the client, this API provides to access these information.
If upstream computation does not send LatencyLog data, returned LatencyLog is default value and not updated.
LatencyLog is MCRT computation's internal timing log information.

There are 2 possible situations.

situation description
Single MCRT LatencyLog is a timing log information of MCRT computation
Multi MCRT LatencyLog is a timing log information of MCRT Merger computation

Typical information dump APIs for LatencyLog itself is grid_util::LatencyLog::show().
(See scene_rdl2/lib/common/grid_util/LatencyLog.h for more detail)

const scene_rdl2::grid_util::LatencyLogUpstream & mcrt_dataio::ClientReceiverFb::getLatencyLogUpstream ( ) const

Get current LatencyLogUpstream information.

Returns
return reference to current LatencyLogUpstream

If multi MCRT configured situation and also upstream Merger computation sends LatencyLogUpstream information, this API provides to access these information.
If upstream computation is not MCRT merge and not send proper LatencyLogUpstream information, returned LatencyLogUpstream information is default value.
This LatencyLogUpstream containes all MCRT computation's LatencyLog info which received by MCRT Merger computation which contributed to create current image.
Typical information dump APIs for LatencyLog itself is grid_util::LatencyLogUpstream::show().
(See scene_rdl2/lib/common/grid_util/LatencyLog.h for more detail)

ClientReceiverFb::Parser & mcrt_dataio::ClientReceiverFb::getParser ( )

Returns Parser object reference.

Returns
Parser

Sometimes, you might want to access Parser object to execute command-line action to this object.

scene_rdl2::math::Vec4f mcrt_dataio::ClientReceiverFb::getPixBeauty ( const int  sx,
const int  sy 
) const

Get pixel value of beauty buffer.

Parameters
sxpixel screen position x
sypixel screen position y
Returns
return pixel value of beauty buffer as scene_rdl2::math::Vec4f

This API returns pixel value of internal Beauty buffer and mainly is using for debugging purpose.

scene_rdl2::math::Vec4f mcrt_dataio::ClientReceiverFb::getPixBeautyOdd ( const int  sx,
const int  sy 
) const

Get pixel value of beauty odd buffer.

Parameters
sxpixel screen position x
sypixel screen position y
Returns
return pixel value of beauty odd buffer as scene_rdl2::math::Vec4f

This API returns pixel value of internal Beauty odd buffer and mainly is using for debugging purpose.

bool mcrt_dataio::ClientReceiverFb::getPixelInfo ( std::vector< float > &  data,
const bool  top2bottom = false 
)

Get current PixelInfo buffer data as float (=32bit single float) 1 channel data.

Parameters
datareturned current PixelInfo buffer.
top2bottomspecify output data Y direction order.
Returns
return true if image has PixelInfo buffer. false if image does not.

This API is designed for display logic of frontend client.
data is automatically adjusted by image size and total size of data is getWidth() * getHeight() * sizeof(float) byte
Internally this API does not do data.clear() but do data.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output data is properly extrapolated.
PixelInfo data is just copied into data without any conversion and data might includes +infinity value.
data's format is lined up from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, return data is flipped Y direction.

const std::string & mcrt_dataio::ClientReceiverFb::getPixelInfoName ( ) const

Get PixelInfo data AOV buffer name if image has PixelInfo data.

Returns
PixelInfo data's AOV buffer name if image has PixelInfo data. If image does not have PixelInfo data, just return useless info.
int mcrt_dataio::ClientReceiverFb::getPixelInfoNumChan ( ) const

Get PixelInfo data's total channel number.

Returns
PixelInfo data's total channel number.
bool mcrt_dataio::ClientReceiverFb::getPixelInfoRgb888 ( std::vector< unsigned char > &  rgbFrame,
const bool  top2bottom = false,
const bool  isSrgb = false 
)

Get current PixelInfo buffer data as 8bit monochrome color RGB 3 channels.

Parameters
rgbFramereturned current PixelInfo buffer which properly converted depth info to monochrome image.
top2bottomspecify output data Y direction order.
Returns
return true if image has PixelInfo buffer. false if image does not.

This API is designed for display logic of frontend client.
rgbFrame is automatically adjusted by image size and total size of rgbFrame is getWidth() * getHeight() * 3 byte
Internally this API does not do rgbFrame.clear() but do rgbFrame.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output rgbFrame is properly extrapolated.
PixelInfo data (i.e. pixel center depth data) is converted to monochrome color value. Most closest depth value inside entire image goes to while (1,1,1) and max depth value goes to black (0,0,0). And depth value between min and max is converted to somewhere inbetween white and black.
rgbFrame's data format is R G B R G B ... from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, output rgbFrame is flipped Y direction.

bool mcrt_dataio::ClientReceiverFb::getPixelInfoStatus ( ) const

Get PixelInfo data condition.

Returns
If image includes PixelInfo data, return true. Otherwise false.
float mcrt_dataio::ClientReceiverFb::getPixHeatMap ( const int  sx,
const int  sy 
) const

Get pixel value of heatMap buffer.

Parameters
sxpixel screen position x
sypixel screen position y
Returns
return pixel value of heatMap info buffer as float

This API returns pixel value of internal heatMap buffer and mainly is using for debugging purpose.

float mcrt_dataio::ClientReceiverFb::getPixPixelInfo ( const int  sx,
const int  sy 
) const

Get pixel value of pixelInfo (depth) buffer.

Parameters
sxpixel screen position x
sypixel screen position y
Returns
return pixel value of pixel info buffer as float

This API returns pixel value of internal pixel info buffer and mainly is using for debugging purpose.

int mcrt_dataio::ClientReceiverFb::getPixRenderOutput ( const unsigned  id,
const int  sx,
const int  sy,
std::vector< float > &  out 
) const

Get pixel value of renderOutput (AOV) buffer.

Parameters
idspecify renderOutput id
sxpixel screen position x
sypixel screen position y
outreturn pixel value
Returns
return AOV's number of channels. return 0 if there is no expected data

This API uses renderOutput-id to identify the data instead of aovName. This API returns pixel value of internal renderOutput buffer and mainly is using for debugging purpose. The return value is std::vector<float> and properly resized and set value by this function based on the internal definition.

int mcrt_dataio::ClientReceiverFb::getPixRenderOutput ( const std::string &  aovName,
const int  sx,
const int  sy,
std::vector< float > &  out 
) const

Get pixel value of renderOutput (AOV) buffer.

Parameters
aovNamespecify renderOutput AOV name
sxpixel screen position x
sypixel screen position y
outreturn pixel value
Returns
return AOV's number of channels. return 0 if there is no expected data

This API uses aovName to identify the data instead of renderOutput-id. This API returns pixel value of internal renderOutput buffer and mainly is using for debugging purpose. The return value is std::vector<float> and properly resized and set value by this function based on the internal definition.

float mcrt_dataio::ClientReceiverFb::getPixWeightBuffer ( const int  sx,
const int  sy 
) const

Get pixel value of weight buffer.

Parameters
sxpixel screen position x
sypixel screen position y
Returns
return pixel value of weight buffer as float

This API returns pixel value of internal weight buffer and mainly is using for debugging purpose.

float mcrt_dataio::ClientReceiverFb::getProgress ( ) const

Get current image's progress fraction value.

Returns
Frame progress fraction as 0.0 ~ 1.0. 0.0 is just start render now and 1.0 is image completed.
int mcrt_dataio::ClientReceiverFb::getReceivedImageSenderMachineId ( ) const

integer representation of machineId that originally sent last received image.

Returns
integer representation of machineId

returns machineId that originally sent last received image.

value description
0 or positive mcrt machineId
SenderMachineId::DISPATCH dispatch computation (reserved. not used at this moment)
SenderMachineId::MERGE merge computation
SenderMacineId::UNKNOWN Data is not received yet
float mcrt_dataio::ClientReceiverFb::getRecvImageDataFps ( )

This API returns how frequently received and decoded image data (as progressiveFrame message).

Returns
Return fps value of receive and decode progressiveFrame message.

ClientReceiverFb is tracking frequency of receiving and decoding progressiveFrame internally. This API returns these frequency statistical results.

uint64_t mcrt_dataio::ClientReceiverFb::getRecvMsgSize ( ) const

Return last received ProgressiveFrame message size.

Returns
Byte
int mcrt_dataio::ClientReceiverFb::getRenderBufferOddNumChan ( ) const

Get RenderBufferOdd data's total channel number.

Returns
RenderBufferOdd data's total channel number
bool mcrt_dataio::ClientReceiverFb::getRenderBufferOddStatus ( ) const

Get RenderBufferOdd data condition.

Returns
If image includes RenderBufferOdd data, return true. Otherwise false.
int mcrt_dataio::ClientReceiverFb::getRenderOutput ( const unsigned  id,
std::vector< float > &  data,
const bool  top2bottom = false,
const bool  closestFilterDepthOutput = false 
)

Get current RenderOutput(=AOV) buffer data.

Parameters
idspecify AOV id (0 <= id < getTotalRenderOutput())
datareturned current RenderOutput buffer which pointed by id.
top2bottomspecify output data Y direction order.
closestFilterDepthOutputconvert depth info when thie AOV is using closestFilter instead data itself
Returns
return channel total number. 0 implies no data. -1 is error and you can get error message by getErrorMsg().

This API is designed for display logic of frontend client.
data is automatically adjusted by image size with channel number and total size of data is getWidth() * getHeight() * sizeof(float) * number-of-channels byte
Internally this API does not do data.clear() but do data.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output rgbFrame is properly extrapolated.
number-of-channels are changed based on AOV buffer type. We have 4 possibilities of AOV buffer configuration now. 1 float to 4 float buffers. In any case, AOV buffer channel total number is returned as return value of this API.
If this API implies no data. This means there is no apropriate data which associated to id, AOV data itself is simply just copies 0x0 into data without any conversion as 32bit single float. data's formats are as follows.

channel configuration description
1 float data's format is V ...
from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, return data is flipped Y direction.
2 floats data's format is Vx Vy Vx Vy ...
from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, return data is flipped Y direction. If this aov uses closestFilter, last component (i.e. Vy) is closestFilter's depth value.
3 floats data's format is Vx Vy Vz Vx Vy Vz ...
from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, return data is flipped Y direction. If this aov uses closestFilter, last component (i.e. Vz) is closestFilter's depth value.
4 floats data's format is Vx Vy Vz Vw Vx Vy Vz Vw ...
from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, return data is flipped Y direction.
Currently all of the float4 data AOV is related closestFilter and. this is original_3_float_data + closestFilter_depth.

If you set top2bottom as true, output rgbFrame is flipped Y direction. If this AOV is using closestFilter and closestFilterDepthOutput is true, this function convert closestFilter's depth instead data itself. In this case, output data only has single float numChan. If this AOV is not using closestFilter with closestFilterDepthOutput set to true, we don't have closestFilter depth info. So closestFilterDepthOutput is automatically set false.

int mcrt_dataio::ClientReceiverFb::getRenderOutput ( const std::string &  aovName,
std::vector< float > &  data,
const bool  top2bottom = false,
const bool  closestFilterDepthOutput = false 
)

Get current RenderOutput(=AOV) buffer data.

Parameters
aovNamespecify AOV's buffer name.
datareturned current RenderOutput buffer which pointed by id.
top2bottomspecify output data Y direction order.
closestFilterDepthOutputconvert depth info when thie AOV is using closestFilter instead data itself
Returns
return channel total number. 0 implies no data. -1 is error and you can get error message by getErrorMsg().

This API is designed for display logic of frontend client.
data is automatically adjusted by image size with channel number and total size of data is getWidth() * getHeight() * sizeof(float) * number-of-channels byte
Internally this API does not do data.clear() but do data.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output rgbFrame is properly extrapolated.
number-of-channels are changed based on AOV buffer type. We have 4 possibilities of AOV buffer configuration now. 1 float to 4 float buffers. In any case, AOV buffer channel total number is returned as return value of this API.
If this API implies no data. This means there is no apropriate data which associated to aovName. AOV data itself is simply just copies 0x0 into data without any conversion as 32bit single float. data's formats are same as previous getRenderOutput() function. (See comments of previous getRenderOutput() function for more detail). If you set top2bottom as true, output rgbFrame is flipped Y direction. If this AOV is using closestFilter and closestFilterDepthOutput is true, this function convert closestFilter's depth instead data itself. In this case, output data only has single float numChan. If this AOV is not using closestFilter with closestFilterDepthOutput set to true, we don't have closestFilter depth info. So closestFilterDepthOutput is automatically set false.

bool mcrt_dataio::ClientReceiverFb::getRenderOutputClosestFilter ( const unsigned  id) const

Get AOV buffer's closestFilter use status.

Parameters
idAOV index (< total number of RenderOutput).
Returns
AOV buffer's closestFilter use status
bool mcrt_dataio::ClientReceiverFb::getRenderOutputClosestFilter ( const std::string &  aovName) const

Get AOV buffer's closestFilter use status.

Parameters
aovNameAOV buffer name
Returns
AOV buffer's closestFilter use status
const std::string & mcrt_dataio::ClientReceiverFb::getRenderOutputName ( const unsigned  id) const

Get AOV buffer name.

Parameters
idAOV index (< total number of RenderOutput).
Returns
AOV buffer name
int mcrt_dataio::ClientReceiverFb::getRenderOutputNumChan ( const unsigned  id) const

Get AOV buffer's channel total.

Parameters
idAOV index (< total number of RenderOutput).
Returns
AOV buffer's channel total
int mcrt_dataio::ClientReceiverFb::getRenderOutputNumChan ( const std::string &  aovName) const

Get AOV buffer's channel total.

Parameters
aovNameAOV buffer name
Returns
AOV buffer's channel total
bool mcrt_dataio::ClientReceiverFb::getRenderOutputRgb888 ( const unsigned  id,
std::vector< unsigned char > &  rgbFrame,
const bool  top2bottom = false,
const bool  isSrgb = false,
const bool  closestFilterDepthOutput = false 
)

Get current RenderOutput(=AOV) buffer data as 8bit RGB 3 channels.

Parameters
idspeficy AOV id (0 <= id < getTotalRenderOutput())
rgbFramereturned current RenderOutput buffer which pointed by id.
top2bottomspecify output data Y direction order.
isSrgbspecify sRGB 8bit quantize mode.
closestFilterDepthOutputconvert depth info when thie AOV is using closestFilter instead data itself
Returns
return true is image has apropriate buffer. false if image does not.

This API is designed for display logic of frontend client.
rgbFrame is automatically adjusted by image size and total size of rgbFrame is getWidth() * getHeight() * 3 byte
Internally this API does not do rgbFrame.clear() but do rgbFrame.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output rgbFrame is properly extrapolated.
We have 7 different types of AOV buffer to 8bit conversion logic (might have more depend the versions). Conversion logic is automatically selected based on the type of data. Following list is how convert data to 8bit for display purpose.

num of chan buffer type description
1 Non-depth, non-heatmap and non-weight buffer
(i.e. standard single float buffer, alpha, alphaAUX)
Remap 0.0~1.0 to 0~255 with gamma 2.2 or sRGB correction depend on the isSrgb argument and finally converted to the monochrome color.
More than 1.0 goes to 255 and negative value goes to 0.
1 Depth related buffer
Depth related AOV buffer is assumed when AOV name includes "depth" word.
Mi10nimum depth inside entire image goes to whie(1,1,1) and maximum depth goes to black(0,0,0).
FL10T_MAX pixel value converted to black(0,0,0).
Between min and max depth is converted somewhere inbetween white and black.
So data converted monochrome color finally.
1 heatmap buffer Remap heatmap min~max to blue(0,0,255)~red(255,0,0).
heatmap min value means computationally most lightest pixel and max value means most expensive pixel
1 weight buffer Remap weight min~max to 0~255 with gamma 2.2 or sRGB correction depend on the isSrgb argument and converted to the monochrome color
2 double float buffer Each component values convert from 0.0~1.0 to 0~255 with gamma 2.2 or sRGB correction which defined by isSrgb argument.
Negative value goes to 0 and more than 1.0 value goes to 255.
1st component goes to R. 2nd component goes to G. B is always 0
3 Non position related triple float buffer Each 3 component values convert from 0.0~1.0 to 0~255 with gamma 2.2 or sRGB correction which defined by isSrgb argument.
Negative value converted to 0 and more than 1.0 value converted to 255.
1st component value goes to R, 2nd value goes to G, 3rd value goes to B.
3 Position related buffer
Position related AOV buffer is assumed when AOV name includes "position" word.
Compute bbox of whole pixels first and remap all pixel value (x,y,z) from black(0,0,0) to white(1,1,1).
min bbox position goes to black and max bbox position goes to white
Inf value are ignored to compute bbox
Using gamma 2.2 or sRGB correction for 8bit quantization which defined by isSrgb argument.
1st component value goes to R, 2nd value goes to G, 3rd value goes to B.

rgbFrame's data format is R G B R G B ... from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, output rgbFrame is flipped Y direction. If you set isSrgb = false (this is default), 8bit quantized logic is using gamma 2.2 conversion. If you set isSrgb argument as true, 8bit quantized logic changed from gamma 2.2 to sRGB mode. If this AOV is using closestFilter and closestFilterDepthOutput is true, this function convert closestFilter's depth instead data itself. Depth value mapped from minDepth~maxDepth to 0~255. If this AOV is not using closestFilter with closestFilterDepthOutput set to true, we don't have closestFilter depth info. So closestFilterDepthOutput is automatically set false.

bool mcrt_dataio::ClientReceiverFb::getRenderOutputRgb888 ( const std::string &  aovName,
std::vector< unsigned char > &  rgbFrame,
const bool  top2bottom = false,
const bool  isSrgb = false,
const bool  closestFilterDepthOutput = false 
)

Get current RenderOutput(=AOV) buffer data as 8bit RGB 3 channels.

Parameters
aovNamespecify AOV's buffer name.
rgbFramereturned current RenderOutput buffer which pointed by aovName.
top2bottomspecify output data Y direction order.
isSrgbspecify sRGB 8bit quantize mode.
closestFilterDepthOutputconvert depth info when thie AOV is using closestFilter instead data itself
Returns
return true is image has apropriate buffer. false if image does not.

This API is designed for display logic of frontend client.
rgbFrame is automatically adjusted by image size and total size of rgbFrame is getWidth() * getHeight() * 3 byte
Internally this API does not do rgbFrame.clear() but do rgbFrame.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output rgbFrame is properly extrapolated.
We have 7 different types of AOV buffer to 8bit conversion logic (might have more depend the versions). Conversion logic is automatically selected based on the type of data. (see previous getRenderOutputRgb888() function's comments for more detail). rgbFrame's data format is R G B R G B ... from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, output rgbFrame is flipped Y direction. If you set isSrgb = false (this is default), 8bit quantized logic is using gamma 2.2 conversion. If you set isSrgb argument as true, 8bit quantized logic changed from gamma 2.2 to sRGB mode. If this AOV is using closestFilter and closestFilterDepthOutput is true, this function convert closestFilter's depth instead data itself. Depth value mapped from minDepth~maxDepth to 0~255. If this AOV is not using closestFilter with closestFilterDepthOutput set to true, we don't have closestFilter depth info. So closestFilterDepthOutput is automatically set false.

float mcrt_dataio::ClientReceiverFb::getRenderPrepProgress ( ) const

Get current image's renderPrep stage progress fraction value.

Returns
RenderPrep stage progress fraction as 0.0 ~ 1.0.

Return renderPrep stage progress fraction value as 0.0 ~ 1.0. 0.0 is renderPrep is just starting now and 1.0 indicates completed. Progress fraction is computed based on the renderPrep internal task steps and fraction value is not reflected actual execution timing. Basically, progress fraction value is simply increased. However, in some specific conditions, the progress fraction might decrease in the middle. But finally will reach 1.0. Under multi-machine configuration, MCRT stage might be able to start before renderPrep progress fraction reached to 1.0. And, you might be able to see the rendering images even renderPrep progress value is less than 1.0. This is not a bug due to the charactaristics of a multi-machine environment. We are not syncing all the back-end engines and might be happend some mcrt computation send back images earlier than others. In this case, another back-end engine is still in the renderPrep stage and overall renderPrep progress fraction might not be reached to 1.0 yet.

const scene_rdl2::math::Viewport & mcrt_dataio::ClientReceiverFb::getRezedViewport ( ) const

Get rezed viewport.

Returns
Rezed viewport as closed viewport
const scene_rdl2::math::Viewport & mcrt_dataio::ClientReceiverFb::getRoiViewport ( ) const

Get ROI viewport if it's set. If there is no ROI viewport, return useless info.

Returns
ROI viewport as closed viewport if ROI viewport is setup.
bool mcrt_dataio::ClientReceiverFb::getRoiViewportStatus ( ) const

Get ROI viewport condition.

Returns
Ture when ROI viewport is set otherwise false
uint64_t mcrt_dataio::ClientReceiverFb::getSnapshotStartTime ( ) const

Get time of snapshot was executed on MCRT computation.

Returns
Microseconds since the Epoch time (1970-01-01 00:00:00 +0000 (UTC))
bool mcrt_dataio::ClientReceiverFb::getStats ( const float  intervalSec,
std::string &  outMsg 
)

This API creates a string for displaying statistical information at client side.

Parameters
intervalSecYou can set a message display interval.
outMsgoutput message string for display statistical information
Returns
return true properly create output message and interval between previous display and current is more than intervalSec. return false if your call is short duration from previous display message timing. In this case, you don't need to display messages.

This API is used to create message strings for displaying statistical information at client applications. You call this function multiple times. If the return value is true, you get a proper output message string and are ready to display. If the return value is false, the output message is not ready yet. Probably your action is too short from last display message timing. This function does not return true if this function is called less than intervalSec duration. In this case you should try again later.

mcrt::BaseFrame::Status mcrt_dataio::ClientReceiverFb::getStatus ( ) const

Get current image's status.

Returns
image status

This API returns current image status as following condition.

returned status description
mcrt::BaseFrame::STARTED The first frame of a progressive render
mcrt::BaseFrame::RENDERING On going status of a progressive refining frame
mcrt::BaseFrame::FINISHED The last frame of a progressive render
mcrt::BaseFrame::CANCELLED Render was cancelled. Image may be incomplete
mcrt::BaseFrame::ERROR Some error condition
bool mcrt_dataio::ClientReceiverFb::getTelemetryOverlayActive ( ) const

Get telemetry overlay enable/disable condition.

Returns
return telemetry overlay condition. enable(=true) or disable(=false)

You can get the current telemetry overlay display condition by this API.

unsigned mcrt_dataio::ClientReceiverFb::getTotalRenderOutput ( ) const

Get total number of RenderOutput (AOV) of this image.

Returns
Total number of RenderOutput (AOV) buffer of this image.
size_t mcrt_dataio::ClientReceiverFb::getViewId ( ) const

Get View id of current image.

Returns
View id (= ID of the view, for supporting multiple views) of current image

progmcrt computation does not support View id yet. Always returns 0.

bool mcrt_dataio::ClientReceiverFb::getWeightBuffer ( std::vector< float > &  data,
const bool  top2bottom = false 
)

Get current weight buffer data as float (=32bit single float) 1 channel data.

Parameters
datareturned current weight buffer.
top2bottomspecify output data Y direction order.
Returns
return true if image has Weight buffer data. false if image does not.

This API is designed for display logic of frontend client.
data is automatically adjusted by image size and total size of data is getWidth() * getHeight() * sizeof(float) byte
Internally this API does not do data.clear() but do data.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output data is properly extrapolated.
data's format is lined up from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, return data is flipped Y direction.

const std::string & mcrt_dataio::ClientReceiverFb::getWeightBufferName ( ) const

Get Weight buffer data AOV buffer name if image has Weight buffer data.

Returns
Weight buffer data's AOV buffer name if image has Weight buffer data. If image does not have Weight buffer data, just return useless info.
int mcrt_dataio::ClientReceiverFb::getWeightBufferNumChan ( ) const

Get Weight buffer data's total channel number.

Returns
Weight buffer data's total channel number.
bool mcrt_dataio::ClientReceiverFb::getWeightBufferRgb888 ( std::vector< unsigned char > &  rgbFrame,
const bool  top2bottom = false,
const bool  isSrgb = false 
)

Get current Weight buffer data as 8bit RGB 3 channels.

Parameters
rgbFramereturned current Weight buffer which properly converted to color image.
top2bottomspecify output data Y direction order.
isSrgbspecify sRGB 8bit quantize mode.
Returns
return true if image has Weight buffer. false if image does not.

This API is designed for display logic of frontend client.
rgbFrame is automatically adjusted by image size and total size of rgbFrame is getWidth() * getHeight() * 3 byte
Internally this API does not do rgbFrame.clear() but do rgbFrame.resize() by proper image size everytime you call this API.
If current image condition is coarse pass, output rgbFrame is properly extrapolated.
Weight buffer data is converted to color value. Weight ZERO goes to black(0,0,0) and highest number of Weight goes to white(1,1,1). output rgbFrame is gamma 2.2 collected. If you set isSrgb as flase
If you set isSrgb argument as true, 8bit quantized logic changed from gamma 2.2 to sRGB mode. rgbFrame's data format is R G B R G B ... from bottom scanline to top scanline and left pixel to right pixel for each scanline when you set top2bottom as false.
If you set top2bottom as true, output rgbFrame is flipped Y direction.

bool mcrt_dataio::ClientReceiverFb::getWeightBufferStatus ( ) const

Get Weight buffer data condition.

Returns
If image includes Weight buffer data, return true. Otherwise false.
unsigned mcrt_dataio::ClientReceiverFb::getWidth ( ) const

Get rezed viewport width.

Returns
Width pixel size
bool mcrt_dataio::ClientReceiverFb::isCoarsePass ( ) const

Make sure current image is coarse pass or not.

Returns
True is image is coarse pass. False is not.
void mcrt_dataio::ClientReceiverFb::setBeautyDenoiseMode ( DenoiseMode  mode)

Setup denoise mode for the beauty data.

Parameters
modeDenoise mode

Setup denoise mode for the beauty data. This denoiseMode effects to getBeautyRgb888() and getBeauty(). Also affects to getRenderOutputRgb888() and getRenderOutput() if specified AOV target (id or aovName) is BEAUTY buffer. There are 5 different DenoiseMode so far. DenoiseMode::DISABLE :

  • disable the denoise operation (this is the default) DenoiseMode::ENABLE :
  • enable the denoise operation without any additional guided input DenoiseMode::ENABLE_W_ALBEDO :
  • enable denoise operation with ALBEDO_INPUT if it is available.
  • If your scene's RenderOutput definition does not have ALBEDO_INPUT, this mode is the same as DenoiseMode::ENABLE DenoiseMode::ENABLE_W_NORMAL :
  • enable denoise operation with NORMAL_INPUT if it is available.
  • If your scene's RenderOutput definition does not have NORMAL_INPUT, this mode is the same as DenoiseMode::ENABLE DenoiseMode::ENABLE_W_ALBEDO_NORMAL :
  • enable denoise operation with ALBEDO_INPUT and NORMAL_INPUT if they are available.
  • if only available ALBEDO_INPUT, it is the same as DenoiseMode::ENABLE_W_ALBEDO.
  • if only available NORMAL_INPUT, it is the same as DenoiseMode::ENABLE_W_NORMAL.
  • if both ALBEDO and NORMAL are not available, this is the same as DenoiseMode::ENABLE. Please check scene_rdl2's RenderOutput denoiser_input command for how to specify ALBEDO_INPUT and NORMAL_INPUT inside rdla RenderOutput.
void mcrt_dataio::ClientReceiverFb::setDenoiseEngine ( DenoiseEngine  engine)

Setup denoise engine mode for denoise operation.

Parameters
engineDenoise engine mode
void mcrt_dataio::ClientReceiverFb::setInfoRecDisplayInterval ( const float  sec)

Set minimum interval of showing infoRec information.

Parameters
secspecify interval of infoRec information dump to the std::cerr

Current infoRec information is shown to the std::cerr by user defined interval. This information dump to std::cerr is useful to understand all system statistical information by some interval at client side. This sec value is only used for controlling minimum interval duration between previous information display and current display and not guaranteed the exact interval timing of information display action.

void mcrt_dataio::ClientReceiverFb::setInfoRecFileName ( const std::string &  fileName)

Set filename of infoRec dump.

Parameters
fileNameSpecify infoRec dump filename.

InfoRec logic creates files which include all the statistical information from beginning to that moment by every 60sec. Timestamp strings and one of extensions (iRec-A, iRec-C or iRec-D) are added to the created filename. So It is easily understood when the file was created. Usually long client session creates lots of files. Later files include all previous information. Basically we only need the very last files. Why we creates multiple files is because we still get useful information from remained files even if we got unexpected client crash InfoRec creates the following files for example. In this case, used setInfoRecFileName("./run_")

  • run_2021May12Wed_1746_35_548.iRec-A
  • run_2021May12Wed_1747_36_249.iRec-A
  • run_2021May12Wed_1747_50_205.iRec-C
  • run_2021May12Wed_1747_50_593.iRec-F

In this case we have 4 files and the last file run_2021May12Wed_1747_50_593.iRec-F includes all of the previous file's information.

  • iRec-A files are information from begginning to the rendering completion.
  • iRec-C file is information at rendering complete timing.
  • iRec-F file is information at finish rendering timing.

Usually render complete timing and render finish timing is different under multi-machine environments. Because, merge computation decides "render complete" timing and send stop request to the mcrt computation. All mcrt computations stop slightly late timing and this is render finish timing. If your session is finished in normal condition you have multiple iRec-A files and single iRec-C and single iRec-F files in the output directory.

void mcrt_dataio::ClientReceiverFb::setInfoRecInterval ( const float  sec)

Set infoRec info snapshot minimum interval. Snapshot is never executed less than this interval.

Parameters
secspecify infoRec snapshot interval by sec. All infoRec logic is disable when you set 0.0f

InfoRec is an information recording logic which is designed for debug and performance analyzing purposes. ClientReceiverFb saves all internal statistical information in the separate memory at run time. Then every 60sec this information is dumped to the disk. This API set up an infoRec information snapshot event interval by second and adds current information to the last of the infoRec data array. InfoRec information snapshot is executed by the internal of ClientReceiverFb::decodeProgressiveFrame() function and this snapshot action is only executed if duration between previous snapshot and current snapshot is more than user defined second. This sec value is only used for controlling minimum interval duration between previous infoRec snapshot and current snapshot and not guaranteed the exact interval timing of snapshot action. If you set an extremely short interval or execute an extremely long session, the internal infoRec data array size gets bigger and might be a problem.

void mcrt_dataio::ClientReceiverFb::setTelemetryOverlayActive ( bool  sw)

Set telemetry overlay enable/disable condition.

Parameters
swdisplay enable(=true)/disable(=false) condition

You can enable/disable telemetry overlay by this API anytime during sessions. Default is false.

void mcrt_dataio::ClientReceiverFb::setTelemetryOverlayReso ( unsigned  width,
unsigned  height 
)

Set telemetry overlay information display resolution.

Parameters
widthoverlay information display width
heightoverlay information display height

We need to set telemetry overlay information display resolution by this API because ClientReceiverFb needs to produce telemetry overlay before receiving the first image. We don't know the image resolution at the beginning yet. You can change telemetry overlay resolution anytime during sessions.

void mcrt_dataio::ClientReceiverFb::setTimingRecorderHydra ( std::shared_ptr< TimingRecorderHydra ptr)

Set TimingRecorderHydra data point for performance analysis for hdMoonray.

Parameters
sharedpointer of TimingRecorderHydra object

This TimingRecorderHydra data pointer is used to breakdown detailed timing analysis, especially for 1st returned pixel data from backend computations. You can access all timing analysis information via debug console command. Setting TimingRecorderHydra data pointer is optional. If this data pointer is not set up, internally all timing analysis logic is turned off. How to properly set up TimingRecorderHydra itself is totally up to the client's (i.e. hdMoonray) response.

std::string mcrt_dataio::ClientReceiverFb::showBackendStat ( const BackendStat &  stat)
static

String reprasentation of BackendStat.

Returns
String

Return string representation of BackendStat and this might be useful for message output

std::string mcrt_dataio::ClientReceiverFb::showDenoiseEngine ( const DenoiseEngine &  engine)
static

String replasentation of DenoiseMode.

Returns
String

Return string representation of DenoiseEngine and this might be useful for message output

std::string mcrt_dataio::ClientReceiverFb::showDenoiseMode ( const DenoiseMode &  mode)
static

String replasentation of DenoiseMode.

Returns
String

Return string representation of DenoiseMode and this might be useful for message output

std::string mcrt_dataio::ClientReceiverFb::showPix ( const int  sx,
const int  sy,
const std::string &  aovName 
) const

Return pixel value detailed information by string.

Parameters
sxpixel screen position x
sypixel screen position y
aovNamespecify renderOutput AOV name or pre-defined internal buffer name
Returns
return pixel detailed information as string

Return pixel value detailed information by string. This API returns details information about specified pixel as string. We have special aovName for special internal frame buffers besides regular AOV buffers as follows.

aovName description
*Beauty beauty buffer, RGBA 4 floats
*HeatMap heatMap data, single float
*Weight weight data, single float
*BeautyOdd beauty odd buffer, RGBA 4 floats

If you specify another name of above as aovName, that aovName is used as a regular AOV buffer name.

std::string mcrt_dataio::ClientReceiverFb::showSenderMachineId ( int  machineId)
static

string representation of sender's machineId

Parameters
machineIdinteger representation
Returns
String

ClientReceiverFb is tracking received image's sender machineId. This machineId is int or enum SenderMachineId. This API simply converts int representation of machineId to the easily understandable string message.

void mcrt_dataio::ClientReceiverFb::switchTelemetryLayoutNext ( )

switch telemetry overlay layout to the next

ClientReceiverFb has multiple different versions of the telemetry overlay layout and this API switches the current overlay layout to the next one.

void mcrt_dataio::ClientReceiverFb::updateStatsMsgInterval ( )

This API records message receive timing in order to get statistical information.

Inside the client application, this API should be called when the client receives any messages from the back-end. This information is used to analyze frequency of receiving messages internally.

void mcrt_dataio::ClientReceiverFb::updateStatsProgressiveFrame ( )

This API updates progressiveFrame related internal information.

Inside the client application, this API should be called when the client receives progressiveFrame messages from the back-end. Inside this API, progressiveFrame related statistical information is updated.


The documentation for this class was generated from the following files: