Cleanup: Renamed compositor executePixel functions and their 'read' wrappers in SocketReader.

Distinguish the 3 different methods for acquiring pixel color values (executePixel, executePixelSampled, executePixelFiltered).
This makes it easier to keep track of the different sampling methods (and works nicer with IDEs that do code parsing).

Differential Revision: http://developer.blender.org/D7
This commit is contained in:
Lukas Tönne
2013-11-19 11:06:16 +01:00
parent 3c662efee3
commit c566e408e4
147 changed files with 552 additions and 552 deletions

View File

@@ -63,7 +63,7 @@ protected:
* @param y the y-coordinate of the pixel to calculate in image space
* @param inputBuffers chunks that can be read by their ReadBufferOperation.
*/
virtual void executePixel(float output[4], float x, float y, PixelSampler sampler) {}
virtual void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) {}
/**
* @brief calculate a single pixel
@@ -75,7 +75,7 @@ protected:
* @param chunkData chunk specific data a during execution time.
*/
virtual void executePixel(float output[4], int x, int y, void *chunkData) {
executePixel(output, x, y, COM_PS_NEAREST);
executePixelSampled(output, x, y, COM_PS_NEAREST);
}
/**
@@ -88,17 +88,17 @@ protected:
* @param dy
* @param inputBuffers chunks that can be read by their ReadBufferOperation.
*/
virtual void executePixel(float output[4], float x, float y, float dx, float dy, PixelSampler sampler) {}
virtual void executePixelFiltered(float output[4], float x, float y, float dx, float dy, PixelSampler sampler) {}
public:
inline void read(float result[4], float x, float y, PixelSampler sampler) {
executePixel(result, x, y, sampler);
inline void readSampled(float result[4], float x, float y, PixelSampler sampler) {
executePixelSampled(result, x, y, sampler);
}
inline void read(float result[4], int x, int y, void *chunkData) {
executePixel(result, x, y, chunkData);
}
inline void read(float result[4], float x, float y, float dx, float dy, PixelSampler sampler) {
executePixel(result, x, y, dx, dy, sampler);
inline void readFiltered(float result[4], float x, float y, float dx, float dy, PixelSampler sampler) {
executePixelFiltered(result, x, y, dx, dy, sampler);
}
virtual void *initializeTileData(rcti *rect) { return 0; }

View File

@@ -27,15 +27,15 @@ AlphaOverKeyOperation::AlphaOverKeyOperation() : MixBaseOperation()
/* pass */
}
void AlphaOverKeyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void AlphaOverKeyOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputOverColor[4];
float value[4];
this->m_inputValueOperation->read(value, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputOverColor, x, y, sampler);
this->m_inputValueOperation->readSampled(value, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputOverColor, x, y, sampler);
if (inputOverColor[3] <= 0.0f) {
copy_v4_v4(output, inputColor1);

View File

@@ -39,6 +39,6 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif

View File

@@ -27,15 +27,15 @@ AlphaOverMixedOperation::AlphaOverMixedOperation() : MixBaseOperation()
this->m_x = 0.0f;
}
void AlphaOverMixedOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void AlphaOverMixedOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputOverColor[4];
float value[4];
this->m_inputValueOperation->read(value, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputOverColor, x, y, sampler);
this->m_inputValueOperation->readSampled(value, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputOverColor, x, y, sampler);
if (inputOverColor[3] <= 0.0f) {
copy_v4_v4(output, inputColor1);

View File

@@ -41,7 +41,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void setX(float x) { this->m_x = x; }
};

View File

@@ -27,15 +27,15 @@ AlphaOverPremultiplyOperation::AlphaOverPremultiplyOperation() : MixBaseOperatio
/* pass */
}
void AlphaOverPremultiplyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void AlphaOverPremultiplyOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputOverColor[4];
float value[4];
this->m_inputValueOperation->read(value, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputOverColor, x, y, sampler);
this->m_inputValueOperation->readSampled(value, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputOverColor, x, y, sampler);
/* Zero alpha values should still permit an add of RGB data */
if (inputOverColor[3] < 0.0f) {

View File

@@ -39,7 +39,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif

View File

@@ -152,7 +152,7 @@ void BlurBaseOperation::updateSize()
{
if (!this->m_sizeavailable) {
float result[4];
this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST);
this->getInputSocketReader(1)->readSampled(result, 0, 0, COM_PS_NEAREST);
this->m_size = result[0];
this->m_sizeavailable = true;
}

View File

@@ -80,7 +80,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
float tempBoundingBox[4];
float bokeh[4];
this->m_inputBoundingBoxReader->read(tempBoundingBox, x, y, COM_PS_NEAREST);
this->m_inputBoundingBoxReader->readSampled(tempBoundingBox, x, y, COM_PS_NEAREST);
if (tempBoundingBox[0] > 0.0f) {
float multiplier_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
MemoryBuffer *inputBuffer = (MemoryBuffer *)data;
@@ -93,7 +93,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
zero_v4(color_accum);
if (pixelSize < 2) {
this->m_inputProgram->read(color_accum, x, y, COM_PS_NEAREST);
this->m_inputProgram->readSampled(color_accum, x, y, COM_PS_NEAREST);
multiplier_accum[0] = 1.0f;
multiplier_accum[1] = 1.0f;
multiplier_accum[2] = 1.0f;
@@ -118,7 +118,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
for (int nx = minx; nx < maxx; nx += step) {
float u = this->m_bokehMidX - (nx - x) * m;
float v = this->m_bokehMidY - (ny - y) * m;
this->m_inputBokehProgram->read(bokeh, u, v, COM_PS_NEAREST);
this->m_inputBokehProgram->readSampled(bokeh, u, v, COM_PS_NEAREST);
madd_v4_v4v4(color_accum, bokeh, &buffer[bufferindex]);
add_v4_v4(multiplier_accum, bokeh);
bufferindex += offsetadd;
@@ -130,7 +130,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
output[3] = color_accum[3] * (1.0f / multiplier_accum[3]);
}
else {
this->m_inputProgram->read(output, x, y, COM_PS_NEAREST);
this->m_inputProgram->readSampled(output, x, y, COM_PS_NEAREST);
}
}
@@ -220,7 +220,7 @@ void BokehBlurOperation::updateSize()
{
if (!this->m_sizeavailable) {
float result[4];
this->getInputSocketReader(3)->read(result, 0, 0, COM_PS_NEAREST);
this->getInputSocketReader(3)->readSampled(result, 0, 0, COM_PS_NEAREST);
this->m_size = result[0];
CLAMP(this->m_size, 0.0f, 10.0f);
this->m_sizeavailable = true;

View File

@@ -85,7 +85,7 @@ float BokehImageOperation::isInsideBokeh(float distance, float x, float y)
}
return insideBokeh;
}
void BokehImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void BokehImageOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float shift = this->m_data->lensshift;
float shift2 = shift / 2.0f;

View File

@@ -111,7 +111,7 @@ public:
/**
* @brief the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* @brief Initialize the execution

View File

@@ -44,7 +44,7 @@ void BoxMaskOperation::initExecution()
this->m_aspectRatio = ((float)this->getWidth()) / this->getHeight();
}
void BoxMaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void BoxMaskOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputMask[4];
float inputValue[4];
@@ -57,8 +57,8 @@ void BoxMaskOperation::executePixel(float output[4], float x, float y, PixelSamp
rx = this->m_data->x + (this->m_cosine * dx + this->m_sine * dy);
ry = this->m_data->y + (-this->m_sine * dx + this->m_cosine * dy);
this->m_inputMask->read(inputMask, x, y, sampler);
this->m_inputValue->read(inputValue, x, y, sampler);
this->m_inputMask->readSampled(inputMask, x, y, sampler);
this->m_inputValue->readSampled(inputValue, x, y, sampler);
float halfHeight = this->m_data->height / 2.0f;
float halfWidth = this->m_data->width / 2.0f;

View File

@@ -45,7 +45,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -37,15 +37,15 @@ void BrightnessOperation::initExecution()
this->m_inputContrastProgram = this->getInputSocketReader(2);
}
void BrightnessOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void BrightnessOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue[4];
float a, b;
float inputBrightness[4];
float inputContrast[4];
this->m_inputProgram->read(inputValue, x, y, sampler);
this->m_inputBrightnessProgram->read(inputBrightness, x, y, sampler);
this->m_inputContrastProgram->read(inputContrast, x, y, sampler);
this->m_inputProgram->readSampled(inputValue, x, y, sampler);
this->m_inputBrightnessProgram->readSampled(inputBrightness, x, y, sampler);
this->m_inputContrastProgram->readSampled(inputContrast, x, y, sampler);
float brightness = inputBrightness[0];
float contrast = inputContrast[0];
brightness /= 100.0f;

View File

@@ -40,7 +40,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -39,11 +39,11 @@ void ChangeHSVOperation::deinitExecution()
this->m_inputOperation = NULL;
}
void ChangeHSVOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ChangeHSVOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
this->m_inputOperation->read(inputColor1, x, y, sampler);
this->m_inputOperation->readSampled(inputColor1, x, y, sampler);
output[0] = inputColor1[0] + (this->m_hue - 0.5f);
if (output[0] > 1.0f) output[0] -= 1.0f;

View File

@@ -49,7 +49,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void setHue(float hue) { this->m_hue = hue; }
void setSaturation(float saturation) { this->m_saturation = saturation; }

View File

@@ -88,7 +88,7 @@ void ChannelMatteOperation::deinitExecution()
this->m_inputImageProgram = NULL;
}
void ChannelMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ChannelMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inColor[4];
float alpha;
@@ -97,7 +97,7 @@ void ChannelMatteOperation::executePixel(float output[4], float x, float y, Pixe
const float limit_min = this->m_limit_min;
const float limit_range = this->m_limit_range;
this->m_inputImageProgram->read(inColor, x, y, sampler);
this->m_inputImageProgram->readSampled(inColor, x, y, sampler);
/* matte operation */
alpha = inColor[this->m_ids[0]] - max(inColor[this->m_ids[1]], inColor[this->m_ids[2]]);

View File

@@ -59,7 +59,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -44,7 +44,7 @@ void ChromaMatteOperation::deinitExecution()
this->m_inputKeyProgram = NULL;
}
void ChromaMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ChromaMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inKey[4];
float inImage[4];
@@ -57,8 +57,8 @@ void ChromaMatteOperation::executePixel(float output[4], float x, float y, Pixel
float theta, beta;
float kfg;
this->m_inputKeyProgram->read(inKey, x, y, sampler);
this->m_inputImageProgram->read(inImage, x, y, sampler);
this->m_inputKeyProgram->readSampled(inKey, x, y, sampler);
this->m_inputImageProgram->readSampled(inImage, x, y, sampler);
/* store matte(alpha) value in [0] to go with
* COM_SetAlphaOperation and the Value output

View File

@@ -42,7 +42,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -49,13 +49,13 @@ void ColorBalanceASCCDLOperation::initExecution()
this->m_inputColorOperation = this->getInputSocketReader(1);
}
void ColorBalanceASCCDLOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ColorBalanceASCCDLOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor[4];
float value[4];
this->m_inputValueOperation->read(value, x, y, sampler);
this->m_inputColorOperation->read(inputColor, x, y, sampler);
this->m_inputValueOperation->readSampled(value, x, y, sampler);
this->m_inputColorOperation->readSampled(inputColor, x, y, sampler);
float fac = value[0];
fac = min(1.0f, fac);

View File

@@ -49,7 +49,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -54,13 +54,13 @@ void ColorBalanceLGGOperation::initExecution()
this->m_inputColorOperation = this->getInputSocketReader(1);
}
void ColorBalanceLGGOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ColorBalanceLGGOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor[4];
float value[4];
this->m_inputValueOperation->read(value, x, y, sampler);
this->m_inputColorOperation->read(inputColor, x, y, sampler);
this->m_inputValueOperation->readSampled(value, x, y, sampler);
this->m_inputColorOperation->readSampled(inputColor, x, y, sampler);
float fac = value[0];
fac = min(1.0f, fac);

View File

@@ -50,7 +50,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -40,12 +40,12 @@ void ColorCorrectionOperation::initExecution()
this->m_inputMask = this->getInputSocketReader(1);
}
void ColorCorrectionOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ColorCorrectionOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputImageColor[4];
float inputMask[4];
this->m_inputImage->read(inputImageColor, x, y, sampler);
this->m_inputMask->read(inputMask, x, y, sampler);
this->m_inputImage->readSampled(inputImageColor, x, y, sampler);
this->m_inputMask->readSampled(inputMask, x, y, sampler);
float level = (inputImageColor[0] + inputImageColor[1] + inputImageColor[2]) / 3.0f;
float contrast = this->m_data->master.contrast;

View File

@@ -44,7 +44,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -58,7 +58,7 @@ void ColorCurveOperation::initExecution()
}
void ColorCurveOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ColorCurveOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
CurveMapping *cumap = this->m_curveMapping;
@@ -70,15 +70,15 @@ void ColorCurveOperation::executePixel(float output[4], float x, float y, PixelS
float white[4];
float bwmul[3];
this->m_inputBlackProgram->read(black, x, y, sampler);
this->m_inputWhiteProgram->read(white, x, y, sampler);
this->m_inputBlackProgram->readSampled(black, x, y, sampler);
this->m_inputWhiteProgram->readSampled(white, x, y, sampler);
/* get our own local bwmul value,
* since we can't be threadsafe and use cumap->bwmul & friends */
curvemapping_set_black_white_ex(black, white, bwmul);
this->m_inputFacProgram->read(fac, x, y, sampler);
this->m_inputImageProgram->read(image, x, y, sampler);
this->m_inputFacProgram->readSampled(fac, x, y, sampler);
this->m_inputImageProgram->readSampled(image, x, y, sampler);
if (*fac >= 1.0f) {
curvemapping_evaluate_premulRGBF_ex(cumap, output, image,
@@ -130,13 +130,13 @@ void ConstantLevelColorCurveOperation::initExecution()
curvemapping_set_black_white(this->m_curveMapping, this->m_black, this->m_white);
}
void ConstantLevelColorCurveOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConstantLevelColorCurveOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float fac[4];
float image[4];
this->m_inputFacProgram->read(fac, x, y, sampler);
this->m_inputImageProgram->read(image, x, y, sampler);
this->m_inputFacProgram->readSampled(fac, x, y, sampler);
this->m_inputImageProgram->readSampled(image, x, y, sampler);
if (*fac >= 1.0f) {
curvemapping_evaluate_premulRGBF(this->m_curveMapping, output, image);

View File

@@ -41,7 +41,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution
@@ -70,7 +70,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -44,7 +44,7 @@ void ColorMatteOperation::deinitExecution()
this->m_inputKeyProgram = NULL;
}
void ColorMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ColorMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inColor[4];
float inKey[4];
@@ -55,8 +55,8 @@ void ColorMatteOperation::executePixel(float output[4], float x, float y, PixelS
float h_wrap;
this->m_inputImageProgram->read(inColor, x, y, sampler);
this->m_inputKeyProgram->read(inKey, x, y, sampler);
this->m_inputImageProgram->readSampled(inColor, x, y, sampler);
this->m_inputKeyProgram->readSampled(inKey, x, y, sampler);
/* store matte(alpha) value in [0] to go with

View File

@@ -42,7 +42,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -43,11 +43,11 @@ void ColorRampOperation::initExecution()
this->m_inputProgram = this->getInputSocketReader(0);
}
void ColorRampOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ColorRampOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float values[4];
this->m_inputProgram->read(values, x, y, sampler);
this->m_inputProgram->readSampled(values, x, y, sampler);
do_colorband(this->m_colorBand, values[0], output);
}

View File

@@ -38,7 +38,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -84,12 +84,12 @@ void ColorSpillOperation::deinitExecution()
this->m_inputFacReader = NULL;
}
void ColorSpillOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ColorSpillOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float fac[4];
float input[4];
this->m_inputFacReader->read(fac, x, y, sampler);
this->m_inputImageReader->read(input, x, y, sampler);
this->m_inputFacReader->readSampled(fac, x, y, sampler);
this->m_inputImageReader->readSampled(input, x, y, sampler);
float rfac = min(1.0f, fac[0]);
float map = calculateMapValue(rfac, input);
if (map > 0.0f) {

View File

@@ -46,7 +46,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -188,20 +188,20 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int tileNumber)
for (x = x1; x < x2 && (!breaked); x++) {
int input_x = x + dx, input_y = y + dy;
this->m_imageInput->read(color, input_x, input_y, COM_PS_NEAREST);
this->m_imageInput->readSampled(color, input_x, input_y, COM_PS_NEAREST);
if (this->m_ignoreAlpha) {
color[3] = 1.0f;
}
else {
if (this->m_alphaInput != NULL) {
this->m_alphaInput->read(&(color[3]), input_x, input_y, COM_PS_NEAREST);
this->m_alphaInput->readSampled(&(color[3]), input_x, input_y, COM_PS_NEAREST);
}
}
copy_v4_v4(buffer + offset4, color);
if (this->m_depthInput != NULL) {
this->m_depthInput->read(color, input_x, input_y, COM_PS_NEAREST);
this->m_depthInput->readSampled(color, input_x, input_y, COM_PS_NEAREST);
zbuffer[offset] = color[0];
}
offset4 += COM_NUMBER_OF_CHANNELS;

View File

@@ -38,10 +38,10 @@ void ConvertColorProfileOperation::initExecution()
this->m_inputOperation = this->getInputSocketReader(0);
}
void ConvertColorProfileOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertColorProfileOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float color[4];
this->m_inputOperation->read(color, x, y, sampler);
this->m_inputOperation->readSampled(color, x, y, sampler);
IMB_buffer_float_from_float(output, color, 4, this->m_toProfile, this->m_fromProfile, this->m_predivided, 1, 1, 0, 0);
}

View File

@@ -59,7 +59,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -72,12 +72,12 @@ void ConvertDepthToRadiusOperation::initExecution()
}
}
void ConvertDepthToRadiusOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertDepthToRadiusOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue[4];
float z;
float radius;
this->m_inputOperation->read(inputValue, x, y, sampler);
this->m_inputOperation->readSampled(inputValue, x, y, sampler);
z = inputValue[0];
if (z != 0.f) {
float iZ = (1.f / z);

View File

@@ -54,7 +54,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -47,10 +47,10 @@ ConvertValueToColorOperation::ConvertValueToColorOperation() : ConvertBaseOperat
this->addOutputSocket(COM_DT_COLOR);
}
void ConvertValueToColorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertValueToColorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue[4];
this->m_inputOperation->read(inputValue, x, y, sampler);
this->m_inputOperation->readSampled(inputValue, x, y, sampler);
output[0] = output[1] = output[2] = inputValue[0];
output[3] = 1.0f;
}
@@ -64,10 +64,10 @@ ConvertColorToValueOperation::ConvertColorToValueOperation() : ConvertBaseOperat
this->addOutputSocket(COM_DT_VALUE);
}
void ConvertColorToValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertColorToValueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor[4];
this->m_inputOperation->read(inputColor, x, y, sampler);
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
output[0] = (inputColor[0] + inputColor[1] + inputColor[2]) / 3.0f;
}
@@ -80,10 +80,10 @@ ConvertColorToBWOperation::ConvertColorToBWOperation() : ConvertBaseOperation()
this->addOutputSocket(COM_DT_VALUE);
}
void ConvertColorToBWOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertColorToBWOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor[4];
this->m_inputOperation->read(inputColor, x, y, sampler);
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
output[0] = rgb_to_bw(inputColor);
}
@@ -96,9 +96,9 @@ ConvertColorToVectorOperation::ConvertColorToVectorOperation() : ConvertBaseOper
this->addOutputSocket(COM_DT_VECTOR);
}
void ConvertColorToVectorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertColorToVectorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
this->m_inputOperation->read(output, x, y, sampler);
this->m_inputOperation->readSampled(output, x, y, sampler);
}
@@ -110,10 +110,10 @@ ConvertValueToVectorOperation::ConvertValueToVectorOperation() : ConvertBaseOper
this->addOutputSocket(COM_DT_VECTOR);
}
void ConvertValueToVectorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertValueToVectorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float input[4];
this->m_inputOperation->read(input, x, y, sampler);
this->m_inputOperation->readSampled(input, x, y, sampler);
output[0] = input[0];
output[1] = input[0];
output[2] = input[0];
@@ -129,9 +129,9 @@ ConvertVectorToColorOperation::ConvertVectorToColorOperation() : ConvertBaseOper
this->addOutputSocket(COM_DT_COLOR);
}
void ConvertVectorToColorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertVectorToColorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
this->m_inputOperation->read(output, x, y, sampler);
this->m_inputOperation->readSampled(output, x, y, sampler);
output[3] = 1.0f;
}
@@ -144,10 +144,10 @@ ConvertVectorToValueOperation::ConvertVectorToValueOperation() : ConvertBaseOper
this->addOutputSocket(COM_DT_VALUE);
}
void ConvertVectorToValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertVectorToValueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float input[4];
this->m_inputOperation->read(input, x, y, sampler);
this->m_inputOperation->readSampled(input, x, y, sampler);
output[0] = (input[0] + input[1] + input[2]) / 3.0f;
}
@@ -176,12 +176,12 @@ void ConvertRGBToYCCOperation::setMode(int mode)
}
}
void ConvertRGBToYCCOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertRGBToYCCOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor[4];
float color[3];
this->m_inputOperation->read(inputColor, x, y, sampler);
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
rgb_to_ycc(inputColor[0], inputColor[1], inputColor[2], &color[0], &color[1], &color[2], this->m_mode);
/* divided by 255 to normalize for viewing in */
@@ -214,10 +214,10 @@ void ConvertYCCToRGBOperation::setMode(int mode)
}
}
void ConvertYCCToRGBOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertYCCToRGBOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor[4];
this->m_inputOperation->read(inputColor, x, y, sampler);
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
/* need to un-normalize the data */
/* R,G,B --> Y,Cb,Cr */
@@ -236,10 +236,10 @@ ConvertRGBToYUVOperation::ConvertRGBToYUVOperation() : ConvertBaseOperation()
this->addOutputSocket(COM_DT_COLOR);
}
void ConvertRGBToYUVOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertRGBToYUVOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor[4];
this->m_inputOperation->read(inputColor, x, y, sampler);
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
rgb_to_yuv(inputColor[0], inputColor[1], inputColor[2], &output[0], &output[1], &output[2]);
output[3] = inputColor[3];
}
@@ -253,10 +253,10 @@ ConvertYUVToRGBOperation::ConvertYUVToRGBOperation() : ConvertBaseOperation()
this->addOutputSocket(COM_DT_COLOR);
}
void ConvertYUVToRGBOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertYUVToRGBOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor[4];
this->m_inputOperation->read(inputColor, x, y, sampler);
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
yuv_to_rgb(inputColor[0], inputColor[1], inputColor[2], &output[0], &output[1], &output[2]);
output[3] = inputColor[3];
}
@@ -270,10 +270,10 @@ ConvertRGBToHSVOperation::ConvertRGBToHSVOperation() : ConvertBaseOperation()
this->addOutputSocket(COM_DT_COLOR);
}
void ConvertRGBToHSVOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertRGBToHSVOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor[4];
this->m_inputOperation->read(inputColor, x, y, sampler);
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
rgb_to_hsv_v(inputColor, output);
output[3] = inputColor[3];
}
@@ -287,10 +287,10 @@ ConvertHSVToRGBOperation::ConvertHSVToRGBOperation() : ConvertBaseOperation()
this->addOutputSocket(COM_DT_COLOR);
}
void ConvertHSVToRGBOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertHSVToRGBOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor[4];
this->m_inputOperation->read(inputColor, x, y, sampler);
this->m_inputOperation->readSampled(inputColor, x, y, sampler);
hsv_to_rgb_v(inputColor, output);
output[3] = inputColor[3];
}
@@ -304,12 +304,12 @@ ConvertPremulToStraightOperation::ConvertPremulToStraightOperation() : ConvertBa
this->addOutputSocket(COM_DT_COLOR);
}
void ConvertPremulToStraightOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertPremulToStraightOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue[4];
float alpha;
this->m_inputOperation->read(inputValue, x, y, sampler);
this->m_inputOperation->readSampled(inputValue, x, y, sampler);
alpha = inputValue[3];
if (fabsf(alpha) < 1e-5f) {
@@ -332,12 +332,12 @@ ConvertStraightToPremulOperation::ConvertStraightToPremulOperation() : ConvertBa
this->addOutputSocket(COM_DT_COLOR);
}
void ConvertStraightToPremulOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ConvertStraightToPremulOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue[4];
float alpha;
this->m_inputOperation->read(inputValue, x, y, sampler);
this->m_inputOperation->readSampled(inputValue, x, y, sampler);
alpha = inputValue[3];
mul_v3_v3fl(output, inputValue, alpha);
@@ -366,10 +366,10 @@ void SeparateChannelOperation::deinitExecution()
}
void SeparateChannelOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void SeparateChannelOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float input[4];
this->m_inputOperation->read(input, x, y, sampler);
this->m_inputOperation->readSampled(input, x, y, sampler);
output[0] = input[this->m_channel];
}
@@ -407,23 +407,23 @@ void CombineChannelsOperation::deinitExecution()
}
void CombineChannelsOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void CombineChannelsOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float input[4];
if (this->m_inputChannel1Operation) {
this->m_inputChannel1Operation->read(input, x, y, sampler);
this->m_inputChannel1Operation->readSampled(input, x, y, sampler);
output[0] = input[0];
}
if (this->m_inputChannel2Operation) {
this->m_inputChannel2Operation->read(input, x, y, sampler);
this->m_inputChannel2Operation->readSampled(input, x, y, sampler);
output[1] = input[0];
}
if (this->m_inputChannel3Operation) {
this->m_inputChannel3Operation->read(input, x, y, sampler);
this->m_inputChannel3Operation->readSampled(input, x, y, sampler);
output[2] = input[0];
}
if (this->m_inputChannel4Operation) {
this->m_inputChannel4Operation->read(input, x, y, sampler);
this->m_inputChannel4Operation->readSampled(input, x, y, sampler);
output[3] = input[0];
}
}

View File

@@ -42,7 +42,7 @@ class ConvertValueToColorOperation : public ConvertBaseOperation {
public:
ConvertValueToColorOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
@@ -50,7 +50,7 @@ class ConvertColorToValueOperation : public ConvertBaseOperation {
public:
ConvertColorToValueOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
@@ -58,7 +58,7 @@ class ConvertColorToBWOperation : public ConvertBaseOperation {
public:
ConvertColorToBWOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
@@ -66,7 +66,7 @@ class ConvertColorToVectorOperation : public ConvertBaseOperation {
public:
ConvertColorToVectorOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
@@ -74,7 +74,7 @@ class ConvertValueToVectorOperation : public ConvertBaseOperation {
public:
ConvertValueToVectorOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
@@ -82,7 +82,7 @@ class ConvertVectorToColorOperation : public ConvertBaseOperation {
public:
ConvertVectorToColorOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
@@ -90,7 +90,7 @@ class ConvertVectorToValueOperation : public ConvertBaseOperation {
public:
ConvertVectorToValueOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
@@ -101,7 +101,7 @@ private:
public:
ConvertRGBToYCCOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/** Set the YCC mode */
void setMode(int mode);
@@ -115,7 +115,7 @@ private:
public:
ConvertYCCToRGBOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/** Set the YCC mode */
void setMode(int mode);
@@ -126,7 +126,7 @@ class ConvertRGBToYUVOperation : public ConvertBaseOperation {
public:
ConvertRGBToYUVOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
@@ -134,7 +134,7 @@ class ConvertYUVToRGBOperation : public ConvertBaseOperation {
public:
ConvertYUVToRGBOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
@@ -142,7 +142,7 @@ class ConvertRGBToHSVOperation : public ConvertBaseOperation {
public:
ConvertRGBToHSVOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
@@ -150,7 +150,7 @@ class ConvertHSVToRGBOperation : public ConvertBaseOperation {
public:
ConvertHSVToRGBOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
@@ -158,7 +158,7 @@ class ConvertPremulToStraightOperation : public ConvertBaseOperation {
public:
ConvertPremulToStraightOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
@@ -166,7 +166,7 @@ class ConvertStraightToPremulOperation : public ConvertBaseOperation {
public:
ConvertStraightToPremulOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
@@ -176,7 +176,7 @@ private:
int m_channel;
public:
SeparateChannelOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();
@@ -193,7 +193,7 @@ private:
SocketReader *m_inputChannel4Operation;
public:
CombineChannelsOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -82,10 +82,10 @@ CropOperation::CropOperation() : CropBaseOperation()
/* pass */
}
void CropOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void CropOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
if ((x < this->m_xmax && x >= this->m_xmin) && (y < this->m_ymax && y >= this->m_ymin)) {
this->m_inputOperation->read(output, x, y, sampler);
this->m_inputOperation->readSampled(output, x, y, sampler);
}
else {
zero_v4(output);
@@ -117,10 +117,10 @@ void CropImageOperation::determineResolution(unsigned int resolution[2], unsigne
resolution[1] = this->m_ymax - this->m_ymin;
}
void CropImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void CropImageOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
if (x >= 0 && x < getWidth() && y >= 0 && y < getHeight()) {
this->m_inputOperation->read(output, (x + this->m_xmin), (y + this->m_ymin), sampler);
this->m_inputOperation->readSampled(output, (x + this->m_xmin), (y + this->m_ymin), sampler);
}
else {
zero_v4(output);

View File

@@ -48,7 +48,7 @@ class CropOperation : public CropBaseOperation {
private:
public:
CropOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class CropImageOperation : public CropBaseOperation {
@@ -57,7 +57,7 @@ public:
CropImageOperation();
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
void determineResolution(unsigned int resolution[2], unsigned int preferedResolution[2]);
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif

View File

@@ -44,7 +44,7 @@ void DifferenceMatteOperation::deinitExecution()
this->m_inputImage2Program = NULL;
}
void DifferenceMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void DifferenceMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inColor1[4];
float inColor2[4];
@@ -54,8 +54,8 @@ void DifferenceMatteOperation::executePixel(float output[4], float x, float y, P
float difference;
float alpha;
this->m_inputImage1Program->read(inColor1, x, y, sampler);
this->m_inputImage2Program->read(inColor2, x, y, sampler);
this->m_inputImage1Program->readSampled(inColor1, x, y, sampler);
this->m_inputImage2Program->readSampled(inColor2, x, y, sampler);
difference = (fabsf(inColor2[0] - inColor1[0]) +
fabsf(inColor2[1] - inColor1[1]) +

View File

@@ -43,7 +43,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -71,7 +71,7 @@ void DirectionalBlurOperation::executePixel(float output[4], int x, int y, void
const int iterations = pow(2.0f, this->m_data->iter);
float col[4] = {0, 0, 0, 0};
float col2[4] = {0, 0, 0, 0};
this->m_inputProgram->read(col2, x, y, COM_PS_NEAREST);
this->m_inputProgram->readSampled(col2, x, y, COM_PS_NEAREST);
float ltx = this->m_tx;
float lty = this->m_ty;
float lsc = this->m_sc;
@@ -84,7 +84,7 @@ void DirectionalBlurOperation::executePixel(float output[4], int x, int y, void
const float v = isc * (y - this->m_center_y_pix) + lty;
const float u = isc * (x - this->m_center_x_pix) + ltx;
this->m_inputProgram->read(col,
this->m_inputProgram->readSampled(col,
cs * u + ss * v + this->m_center_x_pix,
cs * v - ss * u + this->m_center_y_pix,
COM_PS_NEAREST);

View File

@@ -64,9 +64,9 @@ void DisplaceOperation::executePixel(float output[4], int x, int y, void *data)
float dxt, dyt;
float u, v;
this->m_inputScaleXProgram->read(inScale, x, y, COM_PS_NEAREST);
this->m_inputScaleXProgram->readSampled(inScale, x, y, COM_PS_NEAREST);
float xs = inScale[0];
this->m_inputScaleYProgram->read(inScale, x, y, COM_PS_NEAREST);
this->m_inputScaleYProgram->readSampled(inScale, x, y, COM_PS_NEAREST);
float ys = inScale[0];
/* clamp x and y displacement to triple image resolution -
@@ -74,7 +74,7 @@ void DisplaceOperation::executePixel(float output[4], int x, int y, void *data)
CLAMP(xs, -this->m_width_x4, this->m_width_x4);
CLAMP(ys, -this->m_height_x4, this->m_height_x4);
this->m_inputVectorProgram->read(inVector, x, y, COM_PS_NEAREST);
this->m_inputVectorProgram->readSampled(inVector, x, y, COM_PS_NEAREST);
p_dx = inVector[0] * xs;
p_dy = inVector[1] * ys;
@@ -83,9 +83,9 @@ void DisplaceOperation::executePixel(float output[4], int x, int y, void *data)
v = y - p_dy + 0.5f;
/* calc derivatives */
this->m_inputVectorProgram->read(inVector, x + 1, y, COM_PS_NEAREST);
this->m_inputVectorProgram->readSampled(inVector, x + 1, y, COM_PS_NEAREST);
d_dx = inVector[0] * xs;
this->m_inputVectorProgram->read(inVector, x, y + 1, COM_PS_NEAREST);
this->m_inputVectorProgram->readSampled(inVector, x, y + 1, COM_PS_NEAREST);
d_dy = inVector[1] * ys;
/* clamp derivatives to minimum displacement distance in UV space */
@@ -96,7 +96,7 @@ void DisplaceOperation::executePixel(float output[4], int x, int y, void *data)
dyt = signf(dyt) * max_ff(fabsf(dyt), DISPLACE_EPSILON) / this->getHeight();
/* EWA filtering (without nearest it gets blurry with NO distortion) */
this->m_inputColorProgram->read(output, u, v, dxt, dyt, COM_PS_NEAREST);
this->m_inputColorProgram->readFiltered(output, u, v, dxt, dyt, COM_PS_NEAREST);
}
void DisplaceOperation::deinitExecution()

View File

@@ -53,7 +53,7 @@ void DisplaceSimpleOperation::initExecution()
* in order to take effect */
// #define DISPLACE_EPSILON 0.01f
void DisplaceSimpleOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void DisplaceSimpleOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inVector[4];
float inScale[4];
@@ -61,9 +61,9 @@ void DisplaceSimpleOperation::executePixel(float output[4], float x, float y, Pi
float p_dx, p_dy; /* main displacement in pixel space */
float u, v;
this->m_inputScaleXProgram->read(inScale, x, y, sampler);
this->m_inputScaleXProgram->readSampled(inScale, x, y, sampler);
float xs = inScale[0];
this->m_inputScaleYProgram->read(inScale, x, y, sampler);
this->m_inputScaleYProgram->readSampled(inScale, x, y, sampler);
float ys = inScale[0];
/* clamp x and y displacement to triple image resolution -
@@ -71,7 +71,7 @@ void DisplaceSimpleOperation::executePixel(float output[4], float x, float y, Pi
CLAMP(xs, -this->m_width_x4, this->m_width_x4);
CLAMP(ys, -this->m_height_x4, this->m_height_x4);
this->m_inputVectorProgram->read(inVector, x, y, sampler);
this->m_inputVectorProgram->readSampled(inVector, x, y, sampler);
p_dx = inVector[0] * xs;
p_dy = inVector[1] * ys;
@@ -82,7 +82,7 @@ void DisplaceSimpleOperation::executePixel(float output[4], float x, float y, Pi
CLAMP(u, 0.f, this->getWidth() - 1.f);
CLAMP(v, 0.f, this->getHeight() - 1.f);
this->m_inputColorProgram->read(output, u, v, sampler);
this->m_inputColorProgram->readSampled(output, u, v, sampler);
}
void DisplaceSimpleOperation::deinitExecution()

View File

@@ -48,7 +48,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -49,7 +49,7 @@ float DistanceRGBMatteOperation::calculateDistance(float key[4], float image[4])
return len_v3v3(key, image);
}
void DistanceRGBMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void DistanceRGBMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inKey[4];
float inImage[4];
@@ -60,8 +60,8 @@ void DistanceRGBMatteOperation::executePixel(float output[4], float x, float y,
float distance;
float alpha;
this->m_inputKeyProgram->read(inKey, x, y, sampler);
this->m_inputImageProgram->read(inImage, x, y, sampler);
this->m_inputKeyProgram->readSampled(inKey, x, y, sampler);
this->m_inputImageProgram->readSampled(inImage, x, y, sampler);
distance = this->calculateDistance(inKey, inImage);

View File

@@ -45,7 +45,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -45,11 +45,11 @@ void DotproductOperation::deinitExecution()
/** @todo: current implementation is the inverse of a dotproduct. not 'logically' correct
*/
void DotproductOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void DotproductOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float input1[4];
float input2[4];
this->m_input1Operation->read(input1, x, y, sampler);
this->m_input2Operation->read(input2, x, y, sampler);
this->m_input1Operation->readSampled(input1, x, y, sampler);
this->m_input2Operation->readSampled(input2, x, y, sampler);
output[0] = -(input1[0] * input2[0] + input1[1] * input2[1] + input1[2] * input2[2]);
}

View File

@@ -31,7 +31,7 @@ private:
SocketReader *m_input2Operation;
public:
DotproductOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -44,7 +44,7 @@ void EllipseMaskOperation::initExecution()
this->m_aspectRatio = ((float)this->getWidth()) / this->getHeight();
}
void EllipseMaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void EllipseMaskOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputMask[4];
float inputValue[4];
@@ -57,8 +57,8 @@ void EllipseMaskOperation::executePixel(float output[4], float x, float y, Pixel
rx = this->m_data->x + (this->m_cosine * dx + this->m_sine * dy);
ry = this->m_data->y + (-this->m_sine * dx + this->m_cosine * dy);
this->m_inputMask->read(inputMask, x, y, sampler);
this->m_inputValue->read(inputValue, x, y, sampler);
this->m_inputMask->readSampled(inputMask, x, y, sampler);
this->m_inputValue->readSampled(inputValue, x, y, sampler);
const float halfHeight = (this->m_data->height) / 2.0f;
const float halfWidth = this->m_data->width / 2.0f;

View File

@@ -45,7 +45,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -42,12 +42,12 @@ void FlipOperation::deinitExecution()
}
void FlipOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void FlipOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float nx = this->m_flipX ? this->getWidth() - 1 - x : x;
float ny = this->m_flipY ? this->getHeight() - 1 - y : y;
this->m_inputOperation->read(output, nx, ny, sampler);
this->m_inputOperation->readSampled(output, nx, ny, sampler);
}
bool FlipOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)

View File

@@ -33,7 +33,7 @@ private:
public:
FlipOperation();
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -34,10 +34,10 @@ void GammaCorrectOperation::initExecution()
this->m_inputProgram = this->getInputSocketReader(0);
}
void GammaCorrectOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void GammaCorrectOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor[4];
this->m_inputProgram->read(inputColor, x, y, sampler);
this->m_inputProgram->readSampled(inputColor, x, y, sampler);
if (inputColor[3] > 0.0f) {
inputColor[0] /= inputColor[3];
inputColor[1] /= inputColor[3];
@@ -73,10 +73,10 @@ void GammaUncorrectOperation::initExecution()
this->m_inputProgram = this->getInputSocketReader(0);
}
void GammaUncorrectOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void GammaUncorrectOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor[4];
this->m_inputProgram->read(inputColor, x, y, sampler);
this->m_inputProgram->readSampled(inputColor, x, y, sampler);
if (inputColor[3] > 0.0f) {
inputColor[0] /= inputColor[3];

View File

@@ -38,7 +38,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution
@@ -64,7 +64,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -37,13 +37,13 @@ void GammaOperation::initExecution()
this->m_inputGammaProgram = this->getInputSocketReader(1);
}
void GammaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void GammaOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue[4];
float inputGamma[4];
this->m_inputProgram->read(inputValue, x, y, sampler);
this->m_inputGammaProgram->read(inputGamma, x, y, sampler);
this->m_inputProgram->readSampled(inputValue, x, y, sampler);
this->m_inputGammaProgram->readSampled(inputGamma, x, y, sampler);
const float gamma = inputGamma[0];
/* check for negative to avoid nan's */
output[0] = inputValue[0] > 0.0f ? powf(inputValue[0], gamma) : inputValue[0];

View File

@@ -39,7 +39,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -42,11 +42,11 @@ void GlareThresholdOperation::initExecution()
this->m_inputProgram = this->getInputSocketReader(0);
}
void GlareThresholdOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void GlareThresholdOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
const float threshold = this->m_settings->threshold;
this->m_inputProgram->read(output, x, y, sampler);
this->m_inputProgram->readSampled(output, x, y, sampler);
if (rgb_to_luma_y(output) >= threshold) {
output[0] -= threshold, output[1] -= threshold, output[2] -= threshold;
output[0] = max(output[0], 0.0f);

View File

@@ -42,7 +42,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -45,11 +45,11 @@ void HueSaturationValueCorrectOperation::initExecution()
this->m_inputProgram = this->getInputSocketReader(0);
}
void HueSaturationValueCorrectOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void HueSaturationValueCorrectOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float hsv[4], f;
this->m_inputProgram->read(hsv, x, y, sampler);
this->m_inputProgram->readSampled(hsv, x, y, sampler);
/* adjust hue, scaling returned default 0.5 up to 1 */
f = curvemapping_evaluateF(this->m_curveMapping, 0, hsv[0]);

View File

@@ -37,7 +37,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -33,11 +33,11 @@ void IDMaskOperation::initExecution()
this->m_inputProgram = this->getInputSocketReader(0);
}
void IDMaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void IDMaskOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue[4];
this->m_inputProgram->read(inputValue, x, y, sampler);
this->m_inputProgram->readSampled(inputValue, x, y, sampler);
const float a = (inputValue[0] == this->m_objectIndex) ? 1.0f : 0.0f;
output[0] = a;
}

View File

@@ -39,7 +39,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -146,7 +146,7 @@ static void sampleImageAtLocation(ImBuf *ibuf, float x, float y, PixelSampler sa
}
}
void ImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ImageOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
if ((this->m_imageFloatBuffer == NULL && this->m_imageByteBuffer == NULL) || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
zero_v4(output);
@@ -156,7 +156,7 @@ void ImageOperation::executePixel(float output[4], float x, float y, PixelSample
}
}
void ImageAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ImageAlphaOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float tempcolor[4];
@@ -170,7 +170,7 @@ void ImageAlphaOperation::executePixel(float output[4], float x, float y, PixelS
}
}
void ImageDepthOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ImageDepthOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
if (this->m_depthBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
output[0] = 0.0f;

View File

@@ -73,7 +73,7 @@ public:
* Constructor
*/
ImageOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class ImageAlphaOperation : public BaseImageOperation {
public:
@@ -81,7 +81,7 @@ public:
* Constructor
*/
ImageAlphaOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class ImageDepthOperation : public BaseImageOperation {
public:
@@ -89,6 +89,6 @@ public:
* Constructor
*/
ImageDepthOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif

View File

@@ -39,12 +39,12 @@ void InvertOperation::initExecution()
this->m_inputColorProgram = this->getInputSocketReader(1);
}
void InvertOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void InvertOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue[4];
float inputColor[4];
this->m_inputValueProgram->read(inputValue, x, y, sampler);
this->m_inputColorProgram->read(inputColor, x, y, sampler);
this->m_inputValueProgram->readSampled(inputValue, x, y, sampler);
this->m_inputColorProgram->readSampled(inputColor, x, y, sampler);
const float value = inputValue[0];
const float invertedValue = 1.0f - value;

View File

@@ -42,7 +42,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -53,13 +53,13 @@ void KeyingDespillOperation::deinitExecution()
this->m_screenReader = NULL;
}
void KeyingDespillOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void KeyingDespillOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float pixelColor[4];
float screenColor[4];
this->m_pixelReader->read(pixelColor, x, y, sampler);
this->m_screenReader->read(screenColor, x, y, sampler);
this->m_pixelReader->readSampled(pixelColor, x, y, sampler);
this->m_screenReader->readSampled(screenColor, x, y, sampler);
const int screen_primary_channel = max_axis_v3(screenColor);
const int other_1 = (screen_primary_channel + 1) % 3;

View File

@@ -45,7 +45,7 @@ public:
void setDespillFactor(float value) {this->m_despillFactor = value;}
void setColorBalance(float value) {this->m_colorBalance = value;}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif

View File

@@ -65,13 +65,13 @@ void KeyingOperation::deinitExecution()
this->m_screenReader = NULL;
}
void KeyingOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void KeyingOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float pixelColor[4];
float screenColor[4];
this->m_pixelReader->read(pixelColor, x, y, sampler);
this->m_screenReader->read(screenColor, x, y, sampler);
this->m_pixelReader->readSampled(pixelColor, x, y, sampler);
this->m_screenReader->readSampled(screenColor, x, y, sampler);
const int primary_channel = max_axis_v3(screenColor);

View File

@@ -49,7 +49,7 @@ public:
void setScreenBalance(float value) {this->m_screenBalance = value;}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif

View File

@@ -40,7 +40,7 @@ void LuminanceMatteOperation::deinitExecution()
this->m_inputImageProgram = NULL;
}
void LuminanceMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void LuminanceMatteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inColor[4];
@@ -49,7 +49,7 @@ void LuminanceMatteOperation::executePixel(float output[4], float x, float y, Pi
float alpha;
this->m_inputImageProgram->read(inColor, x, y, sampler);
this->m_inputImageProgram->readSampled(inColor, x, y, sampler);
/* one line thread-friend algorithm:
* output[0] = max(inputValue[3], min(high, max(low, ((inColor[0]-low)/(high-low))))

View File

@@ -41,7 +41,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -46,18 +46,18 @@ void MapRangeOperation::initExecution()
/* The code below assumes all data is inside range +- this, and that input buffer is single channel */
#define BLENDER_ZMAX 10000.0f
void MapRangeOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MapRangeOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputs[8]; /* includes the 5 inputs + 3 pads */
float value;
float source_min, source_max;
float dest_min, dest_max;
this->m_inputOperation->read(inputs, x, y, sampler);
this->m_sourceMinOperation->read(inputs + 1, x, y, sampler);
this->m_sourceMaxOperation->read(inputs + 2, x, y, sampler);
this->m_destMinOperation->read(inputs + 3, x, y, sampler);
this->m_destMaxOperation->read(inputs + 4, x, y, sampler);
this->m_inputOperation->readSampled(inputs, x, y, sampler);
this->m_sourceMinOperation->readSampled(inputs + 1, x, y, sampler);
this->m_sourceMaxOperation->readSampled(inputs + 2, x, y, sampler);
this->m_destMinOperation->readSampled(inputs + 3, x, y, sampler);
this->m_destMaxOperation->readSampled(inputs + 4, x, y, sampler);
value = inputs[0];
source_min = inputs[1];

View File

@@ -50,7 +50,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -40,7 +40,7 @@ void MapUVOperation::initExecution()
this->m_inputUVProgram = this->getInputSocketReader(1);
}
void MapUVOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MapUVOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputUV[4];
float uv_a[4], uv_b[4];
@@ -50,22 +50,22 @@ void MapUVOperation::executePixel(float output[4], float x, float y, PixelSample
float uv_l, uv_r;
float uv_u, uv_d;
this->m_inputUVProgram->read(inputUV, x, y, sampler);
this->m_inputUVProgram->readSampled(inputUV, x, y, sampler);
if (inputUV[2] == 0.f) {
zero_v4(output);
return;
}
/* adaptive sampling, red (U) channel */
this->m_inputUVProgram->read(uv_a, x - 1, y, COM_PS_NEAREST);
this->m_inputUVProgram->read(uv_b, x + 1, y, COM_PS_NEAREST);
this->m_inputUVProgram->readSampled(uv_a, x - 1, y, COM_PS_NEAREST);
this->m_inputUVProgram->readSampled(uv_b, x + 1, y, COM_PS_NEAREST);
uv_l = uv_a[2] != 0.f ? fabsf(inputUV[0] - uv_a[0]) : 0.f;
uv_r = uv_b[2] != 0.f ? fabsf(inputUV[0] - uv_b[0]) : 0.f;
dx = 0.5f * (uv_l + uv_r);
/* adaptive sampling, green (V) channel */
this->m_inputUVProgram->read(uv_a, x, y - 1, COM_PS_NEAREST);
this->m_inputUVProgram->read(uv_b, x, y + 1, COM_PS_NEAREST);
this->m_inputUVProgram->readSampled(uv_a, x, y - 1, COM_PS_NEAREST);
this->m_inputUVProgram->readSampled(uv_b, x, y + 1, COM_PS_NEAREST);
uv_u = uv_a[2] != 0.f ? fabsf(inputUV[1] - uv_a[1]) : 0.f;
uv_d = uv_b[2] != 0.f ? fabsf(inputUV[1] - uv_b[1]) : 0.f;
@@ -81,7 +81,7 @@ void MapUVOperation::executePixel(float output[4], float x, float y, PixelSample
u = inputUV[0] * this->m_inputColorProgram->getWidth();
v = inputUV[1] * this->m_inputColorProgram->getHeight();
this->m_inputColorProgram->read(output, u, v, dx, dy, COM_PS_NEAREST);
this->m_inputColorProgram->readFiltered(output, u, v, dx, dy, COM_PS_NEAREST);
/* "premul" */
if (alpha < 1.0f) {

View File

@@ -45,7 +45,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -34,10 +34,10 @@ void MapValueOperation::initExecution()
this->m_inputOperation = this->getInputSocketReader(0);
}
void MapValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MapValueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float src[4];
this->m_inputOperation->read(src, x, y, sampler);
this->m_inputOperation->readSampled(src, x, y, sampler);
TexMapping *texmap = this->m_settings;
float value = (src[0] + texmap->loc[0]) * texmap->size[0];
if (texmap->flag & TEXMAP_CLIP_MIN)

View File

@@ -45,7 +45,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -127,7 +127,7 @@ void MaskOperation::determineResolution(unsigned int resolution[2], unsigned int
}
}
void MaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MaskOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
const float xy[2] = {x * this->m_maskWidthInv,
y * this->m_maskHeightInv};

View File

@@ -83,7 +83,7 @@ public:
void setMotionBlurSamples(int samples) { this->m_rasterMaskHandleTot = min(max(1, samples), CMP_NODE_MASK_MBLUR_SAMPLES_MAX); }
void setMotionBlurShutter(float shutter) { this->m_frame_shutter = shutter; }
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif

View File

@@ -72,52 +72,52 @@ void MathBaseOperation::clampIfNeeded(float *color)
}
}
void MathAddOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathAddOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
output[0] = inputValue1[0] + inputValue2[0];
clampIfNeeded(output);
}
void MathSubtractOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathSubtractOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
output[0] = inputValue1[0] - inputValue2[0];
clampIfNeeded(output);
}
void MathMultiplyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathMultiplyOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
output[0] = inputValue1[0] * inputValue2[0];
clampIfNeeded(output);
}
void MathDivideOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathDivideOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
if (inputValue2[0] == 0) /* We don't want to divide by zero. */
output[0] = 0.0;
@@ -127,52 +127,52 @@ void MathDivideOperation::executePixel(float output[4], float x, float y, PixelS
clampIfNeeded(output);
}
void MathSineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathSineOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
output[0] = sin(inputValue1[0]);
clampIfNeeded(output);
}
void MathCosineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathCosineOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
output[0] = cos(inputValue1[0]);
clampIfNeeded(output);
}
void MathTangentOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathTangentOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
output[0] = tan(inputValue1[0]);
clampIfNeeded(output);
}
void MathArcSineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathArcSineOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
if (inputValue1[0] <= 1 && inputValue1[0] >= -1)
output[0] = asin(inputValue1[0]);
@@ -182,13 +182,13 @@ void MathArcSineOperation::executePixel(float output[4], float x, float y, Pixel
clampIfNeeded(output);
}
void MathArcCosineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathArcCosineOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
if (inputValue1[0] <= 1 && inputValue1[0] >= -1)
output[0] = acos(inputValue1[0]);
@@ -198,26 +198,26 @@ void MathArcCosineOperation::executePixel(float output[4], float x, float y, Pix
clampIfNeeded(output);
}
void MathArcTangentOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathArcTangentOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
output[0] = atan(inputValue1[0]);
clampIfNeeded(output);
}
void MathPowerOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathPowerOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
if (inputValue1[0] >= 0) {
output[0] = pow(inputValue1[0], inputValue2[0]);
@@ -236,13 +236,13 @@ void MathPowerOperation::executePixel(float output[4], float x, float y, PixelSa
clampIfNeeded(output);
}
void MathLogarithmOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathLogarithmOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
if (inputValue1[0] > 0 && inputValue2[0] > 0)
output[0] = log(inputValue1[0]) / log(inputValue2[0]);
@@ -252,78 +252,78 @@ void MathLogarithmOperation::executePixel(float output[4], float x, float y, Pix
clampIfNeeded(output);
}
void MathMinimumOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathMinimumOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
output[0] = min(inputValue1[0], inputValue2[0]);
clampIfNeeded(output);
}
void MathMaximumOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathMaximumOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
output[0] = max(inputValue1[0], inputValue2[0]);
clampIfNeeded(output);
}
void MathRoundOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathRoundOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
output[0] = round(inputValue1[0]);
clampIfNeeded(output);
}
void MathLessThanOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathLessThanOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
output[0] = inputValue1[0] < inputValue2[0] ? 1.0f : 0.0f;
clampIfNeeded(output);
}
void MathGreaterThanOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathGreaterThanOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
output[0] = inputValue1[0] > inputValue2[0] ? 1.0f : 0.0f;
clampIfNeeded(output);
}
void MathModuloOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MathModuloOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputValue1[4];
float inputValue2[4];
this->m_inputValue1Operation->read(inputValue1, x, y, sampler);
this->m_inputValue2Operation->read(inputValue2, x, y, sampler);
this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
if (inputValue2[0] == 0)
output[0] = 0.0;

View File

@@ -50,7 +50,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler) = 0;
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) = 0;
/**
* Initialize the execution
@@ -73,94 +73,94 @@ public:
class MathAddOperation : public MathBaseOperation {
public:
MathAddOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathSubtractOperation : public MathBaseOperation {
public:
MathSubtractOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathMultiplyOperation : public MathBaseOperation {
public:
MathMultiplyOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathDivideOperation : public MathBaseOperation {
public:
MathDivideOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathSineOperation : public MathBaseOperation {
public:
MathSineOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathCosineOperation : public MathBaseOperation {
public:
MathCosineOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathTangentOperation : public MathBaseOperation {
public:
MathTangentOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathArcSineOperation : public MathBaseOperation {
public:
MathArcSineOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathArcCosineOperation : public MathBaseOperation {
public:
MathArcCosineOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathArcTangentOperation : public MathBaseOperation {
public:
MathArcTangentOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathPowerOperation : public MathBaseOperation {
public:
MathPowerOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathLogarithmOperation : public MathBaseOperation {
public:
MathLogarithmOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathMinimumOperation : public MathBaseOperation {
public:
MathMinimumOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathMaximumOperation : public MathBaseOperation {
public:
MathMaximumOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathRoundOperation : public MathBaseOperation {
public:
MathRoundOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathLessThanOperation : public MathBaseOperation {
public:
MathLessThanOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathGreaterThanOperation : public MathBaseOperation {
public:
MathGreaterThanOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MathModuloOperation : public MathBaseOperation {
public:
MathModuloOperation() : MathBaseOperation() {}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif

View File

@@ -48,15 +48,15 @@ void MixBaseOperation::initExecution()
this->m_inputColor2Operation = this->getInputSocketReader(2);
}
void MixBaseOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixBaseOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -107,15 +107,15 @@ MixAddOperation::MixAddOperation() : MixBaseOperation()
/* pass */
}
void MixAddOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixAddOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -136,16 +136,16 @@ MixBlendOperation::MixBlendOperation() : MixBaseOperation()
/* pass */
}
void MixBlendOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixBlendOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
float value;
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -167,16 +167,16 @@ MixBurnOperation::MixBurnOperation() : MixBaseOperation()
/* pass */
}
void MixBurnOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixBurnOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
float tmp;
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -235,15 +235,15 @@ MixColorOperation::MixColorOperation() : MixBaseOperation()
/* pass */
}
void MixColorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixColorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -277,15 +277,15 @@ MixDarkenOperation::MixDarkenOperation() : MixBaseOperation()
/* pass */
}
void MixDarkenOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixDarkenOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -315,15 +315,15 @@ MixDifferenceOperation::MixDifferenceOperation() : MixBaseOperation()
/* pass */
}
void MixDifferenceOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixDifferenceOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -345,15 +345,15 @@ MixDivideOperation::MixDivideOperation() : MixBaseOperation()
/* pass */
}
void MixDivideOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixDivideOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -386,16 +386,16 @@ MixDodgeOperation::MixDodgeOperation() : MixBaseOperation()
/* pass */
}
void MixDodgeOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixDodgeOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
float tmp;
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -459,16 +459,16 @@ MixGlareOperation::MixGlareOperation() : MixBaseOperation()
/* pass */
}
void MixGlareOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixGlareOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
float value;
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
value = inputValue[0];
float mf = 2.f - 2.f * fabsf(value - 0.5f);
@@ -491,15 +491,15 @@ MixHueOperation::MixHueOperation() : MixBaseOperation()
/* pass */
}
void MixHueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixHueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -533,15 +533,15 @@ MixLightenOperation::MixLightenOperation() : MixBaseOperation()
/* pass */
}
void MixLightenOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixLightenOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -569,15 +569,15 @@ MixLinearLightOperation::MixLinearLightOperation() : MixBaseOperation()
/* pass */
}
void MixLinearLightOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixLinearLightOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -608,15 +608,15 @@ MixMultiplyOperation::MixMultiplyOperation() : MixBaseOperation()
/* pass */
}
void MixMultiplyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixMultiplyOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -638,15 +638,15 @@ MixOverlayOperation::MixOverlayOperation() : MixBaseOperation()
/* pass */
}
void MixOverlayOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixOverlayOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -685,15 +685,15 @@ MixSaturationOperation::MixSaturationOperation() : MixBaseOperation()
/* pass */
}
void MixSaturationOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixSaturationOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -724,15 +724,15 @@ MixScreenOperation::MixScreenOperation() : MixBaseOperation()
/* pass */
}
void MixScreenOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixScreenOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -755,15 +755,15 @@ MixSoftLightOperation::MixSoftLightOperation() : MixBaseOperation()
/* pass */
}
void MixSoftLightOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) \
void MixSoftLightOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) \
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -792,15 +792,15 @@ MixSubtractOperation::MixSubtractOperation() : MixBaseOperation()
/* pass */
}
void MixSubtractOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixSubtractOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {
@@ -821,15 +821,15 @@ MixValueOperation::MixValueOperation() : MixBaseOperation()
/* pass */
}
void MixValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MixValueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float inputColor1[4];
float inputColor2[4];
float inputValue[4];
this->m_inputValueOperation->read(inputValue, x, y, sampler);
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
this->m_inputValueOperation->readSampled(inputValue, x, y, sampler);
this->m_inputColor1Operation->readSampled(inputColor1, x, y, sampler);
this->m_inputColor2Operation->readSampled(inputColor2, x, y, sampler);
float value = inputValue[0];
if (this->useValueAlphaMultiply()) {

View File

@@ -60,7 +60,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution
@@ -83,115 +83,115 @@ public:
class MixAddOperation : public MixBaseOperation {
public:
MixAddOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixBlendOperation : public MixBaseOperation {
public:
MixBlendOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixBurnOperation : public MixBaseOperation {
public:
MixBurnOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixColorOperation : public MixBaseOperation {
public:
MixColorOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixDarkenOperation : public MixBaseOperation {
public:
MixDarkenOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixDifferenceOperation : public MixBaseOperation {
public:
MixDifferenceOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixDivideOperation : public MixBaseOperation {
public:
MixDivideOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixDodgeOperation : public MixBaseOperation {
public:
MixDodgeOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixGlareOperation : public MixBaseOperation {
public:
MixGlareOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixHueOperation : public MixBaseOperation {
public:
MixHueOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixLightenOperation : public MixBaseOperation {
public:
MixLightenOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixLinearLightOperation : public MixBaseOperation {
public:
MixLinearLightOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixMultiplyOperation : public MixBaseOperation {
public:
MixMultiplyOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixOverlayOperation : public MixBaseOperation {
public:
MixOverlayOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixSaturationOperation : public MixBaseOperation {
public:
MixSaturationOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixScreenOperation : public MixBaseOperation {
public:
MixScreenOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixSoftLightOperation : public MixBaseOperation {
public:
MixSoftLightOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixSubtractOperation : public MixBaseOperation {
public:
MixSubtractOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MixValueOperation : public MixBaseOperation {
public:
MixValueOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif

View File

@@ -33,7 +33,7 @@ MovieClipAttributeOperation::MovieClipAttributeOperation() : NodeOperation()
this->m_attribute = MCA_X;
}
void MovieClipAttributeOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MovieClipAttributeOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
if (!this->m_valueSet) {
float loc[2], scale, angle;

View File

@@ -51,7 +51,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
void setMovieClip(MovieClip *clip) { this->m_clip = clip; }

View File

@@ -86,7 +86,7 @@ void MovieClipBaseOperation::determineResolution(unsigned int resolution[2], uns
}
}
void MovieClipBaseOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MovieClipBaseOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
ImBuf *ibuf = this->m_movieClipBuffer;
@@ -122,9 +122,9 @@ MovieClipAlphaOperation::MovieClipAlphaOperation() : MovieClipBaseOperation()
this->addOutputSocket(COM_DT_VALUE);
}
void MovieClipAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MovieClipAlphaOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
MovieClipBaseOperation::executePixel(output, x, y, sampler);
MovieClipBaseOperation::executePixelSampled(output, x, y, sampler);
output[0] = output[3];
output[1] = 0.0f;
output[2] = 0.0f;

View File

@@ -57,7 +57,7 @@ public:
void setCacheFrame(bool value) { this->m_cacheFrame = value; }
void setFramenumber(int framenumber) { this->m_framenumber = framenumber; }
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MovieClipOperation : public MovieClipBaseOperation {
@@ -68,7 +68,7 @@ public:
class MovieClipAlphaOperation : public MovieClipBaseOperation {
public:
MovieClipAlphaOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif

View File

@@ -122,16 +122,16 @@ void MovieDistortionOperation::deinitExecution()
}
void MovieDistortionOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MovieDistortionOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
if (this->m_cache != NULL) {
float u, v;
this->m_cache->getUV(&this->m_movieClip->tracking, x, y, &u, &v);
this->m_inputOperation->read(output, u, v, COM_PS_BILINEAR);
this->m_inputOperation->readSampled(output, u, v, COM_PS_BILINEAR);
}
else {
this->m_inputOperation->read(output, x, y, COM_PS_BILINEAR);
this->m_inputOperation->readSampled(output, x, y, COM_PS_BILINEAR);
}
}

View File

@@ -156,7 +156,7 @@ protected:
public:
MovieDistortionOperation(bool distortion);
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -42,7 +42,7 @@ ImBuf *MultilayerBaseOperation::getImBuf()
return NULL;
}
void MultilayerColorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MultilayerColorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
int yi = y;
int xi = x;
@@ -70,7 +70,7 @@ void MultilayerColorOperation::executePixel(float output[4], float x, float y, P
}
}
void MultilayerValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MultilayerValueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
int yi = y;
int xi = x;
@@ -83,7 +83,7 @@ void MultilayerValueOperation::executePixel(float output[4], float x, float y, P
}
}
void MultilayerVectorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void MultilayerVectorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
int yi = y;
int xi = x;

View File

@@ -46,7 +46,7 @@ public:
MultilayerColorOperation(int passindex) : MultilayerBaseOperation(passindex) {
this->addOutputSocket(COM_DT_COLOR);
}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MultilayerValueOperation : public MultilayerBaseOperation {
@@ -54,7 +54,7 @@ public:
MultilayerValueOperation(int passindex) : MultilayerBaseOperation(passindex) {
this->addOutputSocket(COM_DT_VALUE);
}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class MultilayerVectorOperation : public MultilayerBaseOperation {
@@ -62,7 +62,7 @@ public:
MultilayerVectorOperation(int passindex) : MultilayerBaseOperation(passindex) {
this->addOutputSocket(COM_DT_VECTOR);
}
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif

View File

@@ -79,7 +79,7 @@ static void write_buffer_rect(rcti *rect, const bNodeTree *tree,
for (y = y1; y < y2 && (!breaked); y++) {
for (x = x1; x < x2 && (!breaked); x++) {
reader->read(color, x, y, COM_PS_NEAREST);
reader->readSampled(color, x, y, COM_PS_NEAREST);
for (i = 0; i < size; ++i)
buffer[offset + i] = color[i];

View File

@@ -40,10 +40,10 @@ void PixelateOperation::deinitExecution()
this->m_inputOperation = NULL;
}
void PixelateOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void PixelateOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float nx = round(x);
float ny = round(y);
this->m_inputOperation->read(output, nx, ny, sampler);
this->m_inputOperation->readSampled(output, nx, ny, sampler);
}

View File

@@ -62,7 +62,7 @@ public:
* @param y y-coordinate
* @param sampler sampler
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif

View File

@@ -50,7 +50,7 @@ void PlaneTrackMaskOperation::initExecution()
BLI_jitter_init(this->m_jitter[0], this->m_osa);
}
void PlaneTrackMaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void PlaneTrackMaskOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float point[2];

View File

@@ -43,7 +43,7 @@ public:
void initExecution();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif

View File

@@ -125,7 +125,7 @@ void PlaneTrackWarpImageOperation::deinitExecution()
this->m_pixelReader = NULL;
}
void PlaneTrackWarpImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void PlaneTrackWarpImageOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float color_accum[4];
@@ -142,7 +142,7 @@ void PlaneTrackWarpImageOperation::executePixel(float output[4], float x, float
u *= this->m_pixelReader->getWidth();
v *= this->m_pixelReader->getHeight();
this->m_pixelReader->read(current_color, u, v, dx, dy, COM_PS_NEAREST);
this->m_pixelReader->readFiltered(current_color, u, v, dx, dy, COM_PS_NEAREST);
add_v4_v4(color_accum, current_color);
}
}

View File

@@ -45,7 +45,7 @@ public:
void initExecution();
void deinitExecution();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
};

View File

@@ -104,7 +104,7 @@ void PreviewOperation::executeRegion(rcti *rect, unsigned int tileNumber)
color[1] = 0.0f;
color[2] = 0.0f;
color[3] = 1.0f;
this->m_input->read(color, rx, ry, COM_PS_NEAREST);
this->m_input->readSampled(color, rx, ry, COM_PS_NEAREST);
IMB_colormanagement_processor_apply_v4(cm_processor, color);
F4TOCHAR4(color, this->m_outputBuffer + offset);
offset += 4;

View File

@@ -102,7 +102,7 @@ void ProjectorLensDistortionOperation::updateDispersion()
this->lockMutex();
if (!this->m_dispersionAvailable) {
float result[4];
this->getInputSocketReader(1)->read(result, 1, 1, COM_PS_NEAREST);
this->getInputSocketReader(1)->readSampled(result, 1, 1, COM_PS_NEAREST);
this->m_dispersion = result[0];
this->m_kr = 0.25f * max_ff(min_ff(this->m_dispersion, 1.0f), 0.0f);
this->m_kr2 = this->m_kr * 20;

View File

@@ -52,7 +52,7 @@ void ReadBufferOperation::determineResolution(unsigned int resolution[2], unsign
m_single_value = operation->isSingleValue();
}
}
void ReadBufferOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ReadBufferOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
if (m_single_value) {
/* write buffer has a single value stored at (0,0) */
@@ -81,7 +81,7 @@ void ReadBufferOperation::executePixelExtend(float output[4], float x, float y,
}
}
void ReadBufferOperation::executePixel(float output[4], float x, float y, float dx, float dy, PixelSampler sampler)
void ReadBufferOperation::executePixelFiltered(float output[4], float x, float y, float dx, float dy, PixelSampler sampler)
{
if (m_single_value) {
/* write buffer has a single value stored at (0,0) */

View File

@@ -40,10 +40,10 @@ public:
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
void *initializeTileData(rcti *rect);
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void executePixelExtend(float output[4], float x, float y, PixelSampler sampler,
MemoryBufferExtend extend_x, MemoryBufferExtend extend_y);
void executePixel(float output[4], float x, float y, float dx, float dy, PixelSampler sampler);
void executePixelFiltered(float output[4], float x, float y, float dx, float dy, PixelSampler sampler);
const bool isReadBufferOperation() const { return true; }
void setOffset(unsigned int offset) { this->m_offset = offset; }
unsigned int getOffset() const { return this->m_offset; }

View File

@@ -112,7 +112,7 @@ void RenderLayersBaseProg::doInterpolation(float output[4], float x, float y, Pi
}
}
void RenderLayersBaseProg::executePixel(float output[4], float x, float y, PixelSampler sampler)
void RenderLayersBaseProg::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
#if 0
const RenderData *rd = this->m_rd;
@@ -192,7 +192,7 @@ RenderLayersAlphaProg::RenderLayersAlphaProg() : RenderLayersBaseProg(SCE_PASS_C
this->addOutputSocket(COM_DT_VALUE);
}
void RenderLayersAlphaProg::executePixel(float output[4], float x, float y, PixelSampler sampler)
void RenderLayersAlphaProg::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
int ix = x;
int iy = y;
@@ -234,7 +234,7 @@ RenderLayersDepthProg::RenderLayersDepthProg() : RenderLayersBaseProg(SCE_PASS_Z
this->addOutputSocket(COM_DT_VALUE);
}
void RenderLayersDepthProg::executePixel(float output[4], float x, float y, PixelSampler sampler)
void RenderLayersDepthProg::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
int ix = x;
int iy = y;

View File

@@ -99,7 +99,7 @@ public:
short getLayerId() { return this->m_layerId; }
void initExecution();
void deinitExecution();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class RenderLayersAOOperation : public RenderLayersBaseProg {
@@ -110,7 +110,7 @@ public:
class RenderLayersAlphaProg : public RenderLayersBaseProg {
public:
RenderLayersAlphaProg();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class RenderLayersColorOperation : public RenderLayersBaseProg {
@@ -126,7 +126,7 @@ public:
class RenderLayersDepthProg : public RenderLayersBaseProg {
public:
RenderLayersDepthProg();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class RenderLayersDiffuseOperation : public RenderLayersBaseProg {

View File

@@ -52,7 +52,7 @@ inline void RotateOperation::ensureDegree()
{
if (!this->m_isDegreeSet) {
float degree[4];
this->m_degreeSocket->read(degree, 0, 0, COM_PS_NEAREST);
this->m_degreeSocket->readSampled(degree, 0, 0, COM_PS_NEAREST);
double rad;
if (this->m_doDegree2RadConversion) {
rad = DEG2RAD((double)degree[0]);
@@ -68,14 +68,14 @@ inline void RotateOperation::ensureDegree()
}
void RotateOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void RotateOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
ensureDegree();
const float dy = y - this->m_centerY;
const float dx = x - this->m_centerX;
const float nx = this->m_centerX + (this->m_cosine * dx + this->m_sine * dy);
const float ny = this->m_centerY + (-this->m_sine * dx + this->m_cosine * dy);
this->m_imageSocket->read(output, nx, ny, sampler);
this->m_imageSocket->readSampled(output, nx, ny, sampler);
}
bool RotateOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)

View File

@@ -38,7 +38,7 @@ private:
public:
RotateOperation();
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();
void setDoDegree2RadConversion(bool abool) { this->m_doDegree2RadConversion = abool; }

View File

@@ -66,22 +66,22 @@ void ScaleOperation::deinitExecution()
}
void ScaleOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ScaleOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
PixelSampler effective_sampler = getEffectiveSampler(sampler);
float scaleX[4];
float scaleY[4];
this->m_inputXOperation->read(scaleX, x, y, effective_sampler);
this->m_inputYOperation->read(scaleY, x, y, effective_sampler);
this->m_inputXOperation->readSampled(scaleX, x, y, effective_sampler);
this->m_inputYOperation->readSampled(scaleY, x, y, effective_sampler);
const float scx = scaleX[0];
const float scy = scaleY[0];
float nx = this->m_centerX + (x - this->m_centerX) / scx;
float ny = this->m_centerY + (y - this->m_centerY) / scy;
this->m_inputOperation->read(output, nx, ny, effective_sampler);
this->m_inputOperation->readSampled(output, nx, ny, effective_sampler);
}
bool ScaleOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
@@ -90,8 +90,8 @@ bool ScaleOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOpe
float scaleX[4];
float scaleY[4];
this->m_inputXOperation->read(scaleX, 0, 0, COM_PS_NEAREST);
this->m_inputYOperation->read(scaleY, 0, 0, COM_PS_NEAREST);
this->m_inputXOperation->readSampled(scaleX, 0, 0, COM_PS_NEAREST);
this->m_inputYOperation->readSampled(scaleY, 0, 0, COM_PS_NEAREST);
const float scx = scaleX[0];
const float scy = scaleY[0];
@@ -134,15 +134,15 @@ void ScaleAbsoluteOperation::deinitExecution()
}
void ScaleAbsoluteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ScaleAbsoluteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
PixelSampler effective_sampler = getEffectiveSampler(sampler);
float scaleX[4];
float scaleY[4];
this->m_inputXOperation->read(scaleX, x, y, effective_sampler);
this->m_inputYOperation->read(scaleY, x, y, effective_sampler);
this->m_inputXOperation->readSampled(scaleX, x, y, effective_sampler);
this->m_inputYOperation->readSampled(scaleY, x, y, effective_sampler);
const float scx = scaleX[0]; // target absolute scale
const float scy = scaleY[0]; // target absolute scale
@@ -156,7 +156,7 @@ void ScaleAbsoluteOperation::executePixel(float output[4], float x, float y, Pix
float nx = this->m_centerX + (x - this->m_centerX) / relativeXScale;
float ny = this->m_centerY + (y - this->m_centerY) / relativeYScale;
this->m_inputOperation->read(output, nx, ny, effective_sampler);
this->m_inputOperation->readSampled(output, nx, ny, effective_sampler);
}
bool ScaleAbsoluteOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
@@ -165,8 +165,8 @@ bool ScaleAbsoluteOperation::determineDependingAreaOfInterest(rcti *input, ReadB
float scaleX[4];
float scaleY[4];
this->m_inputXOperation->read(scaleX, 0, 0, COM_PS_NEAREST);
this->m_inputYOperation->read(scaleY, 0, 0, COM_PS_NEAREST);
this->m_inputXOperation->readSampled(scaleX, 0, 0, COM_PS_NEAREST);
this->m_inputYOperation->readSampled(scaleY, 0, 0, COM_PS_NEAREST);
const float scx = scaleX[0];
const float scy = scaleY[0];
@@ -253,17 +253,17 @@ void ScaleFixedSizeOperation::deinitExecution()
}
void ScaleFixedSizeOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ScaleFixedSizeOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
PixelSampler effective_sampler = getEffectiveSampler(sampler);
if (this->m_is_offset) {
float nx = ((x - this->m_offsetX) * this->m_relX);
float ny = ((y - this->m_offsetY) * this->m_relY);
this->m_inputOperation->read(output, nx, ny, effective_sampler);
this->m_inputOperation->readSampled(output, nx, ny, effective_sampler);
}
else {
this->m_inputOperation->read(output, x * this->m_relX, y * this->m_relY, effective_sampler);
this->m_inputOperation->readSampled(output, x * this->m_relX, y * this->m_relY, effective_sampler);
}
}

View File

@@ -47,7 +47,7 @@ private:
public:
ScaleOperation();
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();
@@ -63,7 +63,7 @@ class ScaleAbsoluteOperation : public BaseScaleOperation {
public:
ScaleAbsoluteOperation();
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();
@@ -88,7 +88,7 @@ public:
ScaleFixedSizeOperation();
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -291,9 +291,9 @@ void ScreenLensDistortionOperation::updateDispersionAndDistortion()
this->lockMutex();
if (!this->m_valuesAvailable) {
float result[4];
this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST);
this->getInputSocketReader(1)->readSampled(result, 0, 0, COM_PS_NEAREST);
this->m_distortion = result[0];
this->getInputSocketReader(2)->read(result, 0, 0, COM_PS_NEAREST);
this->getInputSocketReader(2)->readSampled(result, 0, 0, COM_PS_NEAREST);
this->m_dispersion = result[0];
updateVariables(this->m_distortion, this->m_dispersion);
this->m_valuesAvailable = true;

View File

@@ -38,12 +38,12 @@ void SetAlphaOperation::initExecution()
this->m_inputAlpha = getInputSocketReader(1);
}
void SetAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void SetAlphaOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float alphaInput[4];
this->m_inputColor->read(output, x, y, sampler);
this->m_inputAlpha->read(alphaInput, x, y, sampler);
this->m_inputColor->readSampled(output, x, y, sampler);
this->m_inputAlpha->readSampled(alphaInput, x, y, sampler);
output[3] = alphaInput[0];
}

View File

@@ -43,7 +43,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -27,7 +27,7 @@ SetColorOperation::SetColorOperation() : NodeOperation()
this->addOutputSocket(COM_DT_COLOR);
}
void SetColorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void SetColorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
copy_v4_v4(output, this->m_color);
}

View File

@@ -55,7 +55,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
bool isSetOperation() const { return true; }

View File

@@ -37,7 +37,7 @@ void SetSamplerOperation::deinitExecution()
this->m_reader = NULL;
}
void SetSamplerOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void SetSamplerOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
this->m_reader->read(output, x, y, this->m_sampler);
this->m_reader->readSampled(output, x, y, this->m_sampler);
}

View File

@@ -44,7 +44,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();
};

View File

@@ -27,7 +27,7 @@ SetValueOperation::SetValueOperation() : NodeOperation()
this->addOutputSocket(COM_DT_VALUE);
}
void SetValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void SetValueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
output[0] = this->m_value;
}

View File

@@ -46,7 +46,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
bool isSetOperation() const { return true; }

View File

@@ -28,7 +28,7 @@ SetVectorOperation::SetVectorOperation() : NodeOperation()
this->addOutputSocket(COM_DT_VECTOR);
}
void SetVectorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void SetVectorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
output[0] = this->m_x;
output[1] = this->m_y;

View File

@@ -54,7 +54,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
bool isSetOperation() const { return true; }

View File

@@ -39,9 +39,9 @@ void SocketProxyOperation::deinitExecution()
this->m_inputOperation = NULL;
}
void SocketProxyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void SocketProxyOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
if (this->m_inputOperation) {
this->m_inputOperation->read(output, x, y, sampler);
this->m_inputOperation->readSampled(output, x, y, sampler);
}
}

View File

@@ -30,7 +30,7 @@ private:
SocketReader *m_inputOperation;
public:
SocketProxyOperation(DataType type);
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();

View File

@@ -57,15 +57,15 @@ void SplitOperation::deinitExecution()
this->m_image2Input = NULL;
}
void SplitOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void SplitOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
int perc = this->m_xSplit ? this->m_splitPercentage * this->getWidth() / 100.0f : this->m_splitPercentage * this->getHeight() / 100.0f;
bool image1 = this->m_xSplit ? x > perc : y > perc;
if (image1) {
this->m_image1Input->read(output, x, y, COM_PS_NEAREST);
this->m_image1Input->readSampled(output, x, y, COM_PS_NEAREST);
}
else {
this->m_image2Input->read(output, x, y, COM_PS_NEAREST);
this->m_image2Input->readSampled(output, x, y, COM_PS_NEAREST);
}
}

View File

@@ -35,7 +35,7 @@ public:
SplitOperation();
void initExecution();
void deinitExecution();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
void setSplitPercentage(float splitPercentage) { this->m_splitPercentage = splitPercentage; }
void setXSplit(bool xsplit) { this->m_xSplit = xsplit; }

View File

@@ -75,16 +75,16 @@ void TextureBaseOperation::determineResolution(unsigned int resolution[2], unsig
}
}
void TextureAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void TextureAlphaOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
TextureBaseOperation::executePixel(output, x, y, sampler);
TextureBaseOperation::executePixelSampled(output, x, y, sampler);
output[0] = output[3];
output[1] = 0.0f;
output[2] = 0.0f;
output[3] = 0.0f;
}
void TextureBaseOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void TextureBaseOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
TexResult texres = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
float textureSize[4];
@@ -96,8 +96,8 @@ void TextureBaseOperation::executePixel(float output[4], float x, float y, Pixel
const float u = (x - cx) / this->getWidth() * 2;
const float v = (y - cy) / this->getHeight() * 2;
this->m_inputSize->read(textureSize, x, y, sampler);
this->m_inputOffset->read(textureOffset, x, y, sampler);
this->m_inputSize->readSampled(textureSize, x, y, sampler);
this->m_inputOffset->readSampled(textureOffset, x, y, sampler);
vec[0] = textureSize[0] * (u + textureOffset[0]);
vec[1] = textureSize[1] * (v + textureOffset[1]);
@@ -136,7 +136,7 @@ MemoryBuffer *TextureBaseOperation::createMemoryBuffer(rcti *rect2)
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++, data += 4) {
this->executePixel(data, x, y, COM_PS_NEAREST);
this->executePixelSampled(data, x, y, COM_PS_NEAREST);
}
}

View File

@@ -62,7 +62,7 @@ protected:
MemoryBuffer *createMemoryBuffer(rcti *rect2);
public:
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void setTexture(Tex *texture) { this->m_texture = texture; }
void initExecution();
@@ -79,7 +79,7 @@ public:
class TextureAlphaOperation : public TextureBaseOperation {
public:
TextureAlphaOperation();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};

View File

@@ -102,7 +102,7 @@ void TrackPositionOperation::initExecution()
}
}
void TrackPositionOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void TrackPositionOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
output[0] = this->m_markerPos[this->m_axis] - this->m_relativePos[this->m_axis];

View File

@@ -70,7 +70,7 @@ public:
void initExecution();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
bool isSetOperation() const { return true; }
};

View File

@@ -52,14 +52,14 @@ void TranslateOperation::deinitExecution()
}
void TranslateOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void TranslateOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
ensureDelta();
float originalXPos = x - this->getDeltaX();
float originalYPos = y - this->getDeltaY();
this->m_inputOperation->read(output, originalXPos, originalYPos, sampler);
this->m_inputOperation->readSampled(output, originalXPos, originalYPos, sampler);
}
bool TranslateOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)

View File

@@ -38,7 +38,7 @@ private:
public:
TranslateOperation();
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void initExecution();
void deinitExecution();
@@ -49,9 +49,9 @@ public:
inline void ensureDelta() {
if (!this->m_isDeltaSet) {
float tempDelta[4];
this->m_inputXOperation->read(tempDelta, 0, 0, COM_PS_NEAREST);
this->m_inputXOperation->readSampled(tempDelta, 0, 0, COM_PS_NEAREST);
this->m_deltaX = tempDelta[0];
this->m_inputYOperation->read(tempDelta, 0, 0, COM_PS_NEAREST);
this->m_inputYOperation->readSampled(tempDelta, 0, 0, COM_PS_NEAREST);
this->m_deltaY = tempDelta[0];
this->m_isDeltaSet = true;
}

View File

@@ -338,7 +338,7 @@ voi *InverseSearchRadiusOperation::initializeTileData(rcti *rect)
return data;
}
void InverseSearchRadiusOperation::executePixel(float output[4], int x, int y, void *data)
void InverseSearchRadiusOperation::executePixelChunk(float output[4], int x, int y, void *data)
{
MemoryBuffer *buffer = (MemoryBuffer *)data;
buffer->readNoCheck(color, x, y);

View File

@@ -85,7 +85,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], int x, int y, MemoryBuffer *inputBuffers[], void *data);
void executePixelChunk(float output[4], int x, int y, void *data);
/**
* Initialize the execution

View File

@@ -43,12 +43,12 @@ void VectorCurveOperation::initExecution()
this->m_inputProgram = this->getInputSocketReader(0);
}
void VectorCurveOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void VectorCurveOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float input[4];
this->m_inputProgram->read(input, x, y, sampler);
this->m_inputProgram->readSampled(input, x, y, sampler);
curvemapping_evaluate_premulRGBF(this->m_curveMapping, output, input);
output[3] = input[3];

View File

@@ -37,7 +37,7 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
* Initialize the execution

View File

@@ -101,18 +101,18 @@ void ViewerOperation::executeRegion(rcti *rect, unsigned int tileNumber)
for (y = y1; y < y2 && (!breaked); y++) {
for (x = x1; x < x2; x++) {
this->m_imageInput->read(&(buffer[offset4]), x, y, COM_PS_NEAREST);
this->m_imageInput->readSampled(&(buffer[offset4]), x, y, COM_PS_NEAREST);
if (this->m_ignoreAlpha) {
buffer[offset4 + 3] = 1.0f;
}
else {
if (this->m_alphaInput != NULL) {
this->m_alphaInput->read(alpha, x, y, COM_PS_NEAREST);
this->m_alphaInput->readSampled(alpha, x, y, COM_PS_NEAREST);
buffer[offset4 + 3] = alpha[0];
}
}
if (m_depthInput) {
this->m_depthInput->read(depth, x, y, COM_PS_NEAREST);
this->m_depthInput->readSampled(depth, x, y, COM_PS_NEAREST);
depthbuffer[offset] = depth[0];
}

View File

@@ -42,7 +42,7 @@ inline float WrapOperation::getWrappedOriginalYPos(float y)
return fmodf(y, this->getHeight());
}
void WrapOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void WrapOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float nx, ny;
nx = x;

View File

@@ -31,7 +31,7 @@ private:
public:
WrapOperation();
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
void setWrapping(int wrapping_type);
float getWrappedOriginalXPos(float x);

View File

@@ -40,9 +40,9 @@ WriteBufferOperation::~WriteBufferOperation()
}
}
void WriteBufferOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void WriteBufferOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
this->m_input->read(output, x, y, sampler);
this->m_input->readSampled(output, x, y, sampler);
}
void WriteBufferOperation::initExecution()
@@ -98,7 +98,7 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber)
for (y = y1; y < y2 && (!breaked); y++) {
int offset4 = (y * memoryBuffer->getWidth() + x1) * COM_NUMBER_OF_CHANNELS;
for (x = x1; x < x2; x++) {
this->m_input->read(&(buffer[offset4]), x, y, COM_PS_NEAREST);
this->m_input->readSampled(&(buffer[offset4]), x, y, COM_PS_NEAREST);
offset4 += COM_NUMBER_OF_CHANNELS;
}
if (isBreaked()) {

View File

@@ -39,7 +39,7 @@ public:
~WriteBufferOperation();
int isBufferOperation() { return true; }
MemoryProxy *getMemoryProxy() { return this->m_memoryProxy; }
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
const bool isWriteBufferOperation() const { return true; }
bool isSingleValue() const { return m_single_value; }

View File

@@ -46,36 +46,36 @@ void ZCombineOperation::initExecution()
this->m_depth2Reader = this->getInputSocketReader(3);
}
void ZCombineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ZCombineOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float depth1[4];
float depth2[4];
this->m_depth1Reader->read(depth1, x, y, sampler);
this->m_depth2Reader->read(depth2, x, y, sampler);
this->m_depth1Reader->readSampled(depth1, x, y, sampler);
this->m_depth2Reader->readSampled(depth2, x, y, sampler);
if (depth1[0] < depth2[0]) {
this->m_image1Reader->read(output, x, y, sampler);
this->m_image1Reader->readSampled(output, x, y, sampler);
}
else {
this->m_image2Reader->read(output, x, y, sampler);
this->m_image2Reader->readSampled(output, x, y, sampler);
}
}
void ZCombineAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ZCombineAlphaOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float depth1[4];
float depth2[4];
float color1[4];
float color2[4];
this->m_depth1Reader->read(depth1, x, y, sampler);
this->m_depth2Reader->read(depth2, x, y, sampler);
this->m_depth1Reader->readSampled(depth1, x, y, sampler);
this->m_depth2Reader->readSampled(depth2, x, y, sampler);
if (depth1[0] <= depth2[0]) {
this->m_image1Reader->read(color1, x, y, sampler);
this->m_image2Reader->read(color2, x, y, sampler);
this->m_image1Reader->readSampled(color1, x, y, sampler);
this->m_image2Reader->readSampled(color2, x, y, sampler);
}
else {
this->m_image1Reader->read(color2, x, y, sampler);
this->m_image2Reader->read(color1, x, y, sampler);
this->m_image1Reader->readSampled(color2, x, y, sampler);
this->m_image2Reader->readSampled(color1, x, y, sampler);
}
float fac = color1[3];
float ifac = 1.0f - fac;
@@ -113,28 +113,28 @@ void ZCombineMaskOperation::initExecution()
this->m_image2Reader = this->getInputSocketReader(2);
}
void ZCombineMaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ZCombineMaskOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float mask[4];
float color1[4];
float color2[4];
this->m_maskReader->read(mask, x, y, sampler);
this->m_image1Reader->read(color1, x, y, sampler);
this->m_image2Reader->read(color2, x, y, sampler);
this->m_maskReader->readSampled(mask, x, y, sampler);
this->m_image1Reader->readSampled(color1, x, y, sampler);
this->m_image2Reader->readSampled(color2, x, y, sampler);
interp_v4_v4v4(output, color1, color2, 1.0f - mask[0]);
}
void ZCombineMaskAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
void ZCombineMaskAlphaOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
float mask[4];
float color1[4];
float color2[4];
this->m_maskReader->read(mask, x, y, sampler);
this->m_image1Reader->read(color1, x, y, sampler);
this->m_image2Reader->read(color2, x, y, sampler);
this->m_maskReader->readSampled(mask, x, y, sampler);
this->m_image1Reader->readSampled(color1, x, y, sampler);
this->m_image2Reader->readSampled(color2, x, y, sampler);
float fac = (1.0f - mask[0]) * (1.0f - color1[3]) + mask[0] * color2[3];
float mfac = 1.0f - fac;

View File

@@ -47,11 +47,11 @@ public:
/**
* the inner loop of this program
*/
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class ZCombineAlphaOperation : public ZCombineOperation {
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class ZCombineMaskOperation : public NodeOperation {
@@ -64,10 +64,10 @@ public:
void initExecution();
void deinitExecution();
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
class ZCombineMaskAlphaOperation : public ZCombineMaskOperation {
void executePixel(float output[4], float x, float y, PixelSampler sampler);
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
#endif