void RenderLayersBaseProg::executePixel(float output[4], float x, float y, PixelSampler sampler) { #if 0 const RenderData *rd = this->m_rd; int dx = 0, dy = 0; if (rd->mode & R_BORDER && rd->mode & R_CROP) { /* see comment in executeRegion describing coordinate mapping, * here it simply goes other way around */ int full_width = rd->xsch * rd->size / 100; int full_height = rd->ysch * rd->size / 100; dx = rd->border.xmin * full_width - (full_width - this->getWidth()) / 2.0f; dy = rd->border.ymin * full_height - (full_height - this->getHeight()) / 2.0f; } int ix = x - dx; int iy = y - dy; #else int ix = x; int iy = y; #endif if (this->m_inputBuffer == NULL || ix < 0 || iy < 0 || ix >= (int)this->getWidth() || iy >= (int)this->getHeight() ) { zero_v4(output); } else { doInterpolation(output, ix, iy, sampler); } }
/* ******** Render Layers AO Operation ******** */ void RenderLayersAOOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) { float *inputBuffer = this->getInputBuffer(); if (inputBuffer == NULL) { zero_v3(output); } else { doInterpolation(output, x, y, sampler); } output[3] = 1.0f; }
/* ******** Render Layers Alpha Operation ******** */ void RenderLayersAlphaProg::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) { float *inputBuffer = this->getInputBuffer(); if (inputBuffer == NULL) { output[0] = 0.0f; } else { float temp[4]; doInterpolation(temp, x, y, sampler); output[0] = temp[3]; } }
void RenderLayersProg::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) { #if 0 const RenderData *rd = this->m_rd; int dx = 0, dy = 0; if (rd->mode & R_BORDER && rd->mode & R_CROP) { /* see comment in executeRegion describing coordinate mapping, * here it simply goes other way around */ int full_width = rd->xsch * rd->size / 100; int full_height = rd->ysch * rd->size / 100; dx = rd->border.xmin * full_width - (full_width - this->getWidth()) / 2.0f; dy = rd->border.ymin * full_height - (full_height - this->getHeight()) / 2.0f; } int ix = x - dx; int iy = y - dy; #endif #ifndef NDEBUG { const DataType data_type = this->getOutputSocket()->getDataType(); int actual_element_size = this->m_elementsize; int expected_element_size; if (data_type == COM_DT_VALUE) { expected_element_size = 1; } else if (data_type == COM_DT_VECTOR) { expected_element_size = 3; } else if (data_type == COM_DT_COLOR) { expected_element_size = 4; } else { expected_element_size = 0; BLI_assert(!"Something horribly wrong just happened"); } BLI_assert(expected_element_size == actual_element_size); } #endif if (this->m_inputBuffer == NULL) { int elemsize = this->m_elementsize; if (elemsize == 1) { output[0] = 0.0f; } else if (elemsize == 3) { zero_v3(output); } else { BLI_assert(elemsize == 4); zero_v4(output); } } else { doInterpolation(output, x, y, sampler); } }