On 09/10/2014 at 12:19, xxxxxxxx wrote:
This is the code I wrote to test it. And it works in both the render region and the IRR.
Although the IRR needs to be set at 100% accuracy or else it offsets the drawn shape.
I don't know why. *Shrug*
//This code turns the renderer off and draws a white square when rendering
//The IRR also works...But it's quality slider needs to be set to 100% for the square's position to be accurate
RENDERRESULT MyPostData::Execute(BaseVideoPost *node, VideoPostStruct *vps)
{
if(vps->error == nullptr || *vps->error != RENDERRESULT_OK || vps->thread->TestBreak())
{
//After skipping the render process vps->error is set, so we end up here and return
return RENDERRESULT_OK;
}
if(vps->vp == VIDEOPOSTCALL_INNER && vps->open)
{
VPBuffer *pVpBuffer = vps->render->GetBuffer(VPBUFFER_RGBA, 0);
MultipassBitmap *mbmp = (MultipassBitmap* )pVpBuffer;
//Set the size and position of the white square that gets drawn when rendering
//NOTE: The quality setting changes the position of the drawn square(Crank it up to be most accurate)
LONG width = 100;
LONG height = 100;
LONG xPos = 300;
LONG yPos = 300;
SReal *buffer = NULL;
buffer = GeAllocType(SReal, 512*3);
//The pixel brightness
for(LONG i=0; i<512*3; i++)
buffer[i] = 1.0; //100%
//Cast the SReal buffer into UCHAR; inc parameter is 3*4bytes (3*32bit) because of floating point image format
for(LONG y=0; y<height; y++)
if (!mbmp->SetPixelCnt(xPos, y+yPos, width, (UCHAR* )buffer, 12, COLORMODE_RGBf, PIXELCNT_0)) return RENDERRESULT::RENDERRESULT_USERBREAK;
return RENDERRESULT::RENDERRESULT_USERBREAK;
}
return RENDERRESULT_OK;
}
-ScottA