Merging r48889 through r48893 from trunk into soc-2011-tomato
This commit is contained in:
@@ -70,7 +70,7 @@ int BLI_system_thread_count(void); /* gets the number of threads the system
|
||||
* One custom lock available now. can be extended. */
|
||||
|
||||
#define LOCK_IMAGE 0
|
||||
#define LOCK_PREVIEW 1
|
||||
#define LOCK_DRAW_IMAGE 1
|
||||
#define LOCK_VIEWER 2
|
||||
#define LOCK_CUSTOM1 3
|
||||
#define LOCK_RCACHE 4
|
||||
|
||||
@@ -106,7 +106,7 @@ static void *thread_tls_data;
|
||||
************************************************ */
|
||||
static pthread_mutex_t _malloc_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_mutex_t _image_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_mutex_t _preview_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_mutex_t _image_draw_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_mutex_t _viewer_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_mutex_t _custom1_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_mutex_t _rcache_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
@@ -337,8 +337,8 @@ void BLI_lock_thread(int type)
|
||||
{
|
||||
if (type == LOCK_IMAGE)
|
||||
pthread_mutex_lock(&_image_lock);
|
||||
else if (type == LOCK_PREVIEW)
|
||||
pthread_mutex_lock(&_preview_lock);
|
||||
else if (type == LOCK_DRAW_IMAGE)
|
||||
pthread_mutex_lock(&_image_draw_lock);
|
||||
else if (type == LOCK_VIEWER)
|
||||
pthread_mutex_lock(&_viewer_lock);
|
||||
else if (type == LOCK_CUSTOM1)
|
||||
@@ -357,8 +357,8 @@ void BLI_unlock_thread(int type)
|
||||
{
|
||||
if (type == LOCK_IMAGE)
|
||||
pthread_mutex_unlock(&_image_lock);
|
||||
else if (type == LOCK_PREVIEW)
|
||||
pthread_mutex_unlock(&_preview_lock);
|
||||
else if (type == LOCK_DRAW_IMAGE)
|
||||
pthread_mutex_unlock(&_image_draw_lock);
|
||||
else if (type == LOCK_VIEWER)
|
||||
pthread_mutex_unlock(&_viewer_lock);
|
||||
else if (type == LOCK_CUSTOM1)
|
||||
|
||||
@@ -33,7 +33,7 @@ void SingleThreadedNodeOperation::initExecution()
|
||||
initMutex();
|
||||
}
|
||||
|
||||
void SingleThreadedNodeOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void SingleThreadedNodeOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
this->m_cachedInstance->readNoCheck(color, x, y);
|
||||
}
|
||||
@@ -46,14 +46,14 @@ void SingleThreadedNodeOperation::deinitExecution()
|
||||
this->m_cachedInstance = NULL;
|
||||
}
|
||||
}
|
||||
void *SingleThreadedNodeOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *SingleThreadedNodeOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
if (this->m_cachedInstance) return this->m_cachedInstance;
|
||||
|
||||
lockMutex();
|
||||
if (this->m_cachedInstance == NULL) {
|
||||
//
|
||||
this->m_cachedInstance = createMemoryBuffer(rect, memoryBuffers);
|
||||
this->m_cachedInstance = createMemoryBuffer(rect);
|
||||
}
|
||||
unlockMutex();
|
||||
return this->m_cachedInstance;
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
@@ -51,9 +51,9 @@ public:
|
||||
*/
|
||||
void deinitExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
|
||||
virtual MemoryBuffer *createMemoryBuffer(rcti *rect, MemoryBuffer **memoryBuffers) = 0;
|
||||
virtual MemoryBuffer *createMemoryBuffer(rcti *rect) = 0;
|
||||
|
||||
int isSingleThreaded() { return true; }
|
||||
};
|
||||
|
||||
@@ -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 *result, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) {}
|
||||
virtual void executePixel(float *result, float x, float y, PixelSampler sampler) {}
|
||||
|
||||
/**
|
||||
* @brief calculate a single pixel
|
||||
@@ -74,8 +74,8 @@ protected:
|
||||
* @param inputBuffers chunks that can be read by their ReadBufferOperation.
|
||||
* @param chunkData chunk specific data a during execution time.
|
||||
*/
|
||||
virtual void executePixel(float *result, int x, int y, MemoryBuffer *inputBuffers[], void *chunkData) {
|
||||
executePixel(result, x, y, COM_PS_NEAREST, inputBuffers);
|
||||
virtual void executePixel(float *result, int x, int y, void *chunkData) {
|
||||
executePixel(result, x, y, COM_PS_NEAREST);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,21 +88,21 @@ protected:
|
||||
* @param dy
|
||||
* @param inputBuffers chunks that can be read by their ReadBufferOperation.
|
||||
*/
|
||||
virtual void executePixel(float *result, float x, float y, float dx, float dy, MemoryBuffer *inputBuffers[]) {}
|
||||
virtual void executePixel(float *result, float x, float y, float dx, float dy) {}
|
||||
|
||||
public:
|
||||
inline void read(float *result, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) {
|
||||
executePixel(result, x, y, sampler, inputBuffers);
|
||||
inline void read(float *result, float x, float y, PixelSampler sampler) {
|
||||
executePixel(result, x, y, sampler);
|
||||
}
|
||||
inline void read(float *result, int x, int y, MemoryBuffer *inputBuffers[], void *chunkData) {
|
||||
executePixel(result, x, y, inputBuffers, chunkData);
|
||||
inline void read(float *result, int x, int y, void *chunkData) {
|
||||
executePixel(result, x, y, chunkData);
|
||||
}
|
||||
inline void read(float *result, float x, float y, float dx, float dy, MemoryBuffer *inputBuffers[]) {
|
||||
executePixel(result, x, y, dx, dy, inputBuffers);
|
||||
inline void read(float *result, float x, float y, float dx, float dy) {
|
||||
executePixel(result, x, y, dx, dy);
|
||||
}
|
||||
|
||||
virtual void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers) { return 0; }
|
||||
virtual void deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data) {
|
||||
virtual void *initializeTileData(rcti *rect) { return 0; }
|
||||
virtual void deinitializeTileData(rcti *rect, void *data) {
|
||||
}
|
||||
|
||||
virtual MemoryBuffer *getInputMemoryBuffer(MemoryBuffer **memoryBuffers) { return 0; }
|
||||
|
||||
@@ -27,15 +27,15 @@ AlphaOverKeyOperation::AlphaOverKeyOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void AlphaOverKeyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void AlphaOverKeyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputOverColor[4];
|
||||
float value[4];
|
||||
|
||||
this->m_inputValueOperation->read(value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(inputOverColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
||||
this->m_inputColor2Operation->read(inputOverColor, x, y, sampler);
|
||||
|
||||
if (inputOverColor[3] <= 0.0f) {
|
||||
copy_v4_v4(outputValue, inputColor1);
|
||||
|
||||
@@ -39,6 +39,6 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,15 +27,15 @@ AlphaOverMixedOperation::AlphaOverMixedOperation() : MixBaseOperation()
|
||||
this->m_x = 0.0f;
|
||||
}
|
||||
|
||||
void AlphaOverMixedOperation::executePixel(float outputValue[4], float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void AlphaOverMixedOperation::executePixel(float outputValue[4], float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputOverColor[4];
|
||||
float value[4];
|
||||
|
||||
this->m_inputValueOperation->read(value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(inputOverColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
||||
this->m_inputColor2Operation->read(inputOverColor, x, y, sampler);
|
||||
|
||||
if (inputOverColor[3] <= 0.0f) {
|
||||
copy_v4_v4(outputValue, inputColor1);
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void setX(float x) { this->m_x = x; }
|
||||
};
|
||||
|
||||
@@ -27,15 +27,15 @@ AlphaOverPremultiplyOperation::AlphaOverPremultiplyOperation() : MixBaseOperatio
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void AlphaOverPremultiplyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void AlphaOverPremultiplyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputOverColor[4];
|
||||
float value[4];
|
||||
|
||||
this->m_inputValueOperation->read(value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(inputOverColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
||||
this->m_inputColor2Operation->read(inputOverColor, x, y, sampler);
|
||||
|
||||
/* Zero alpha values should still permit an add of RGB data */
|
||||
if (inputOverColor[3] < 0.0f) {
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,7 @@ void AntiAliasOperation::initExecution()
|
||||
NodeOperation::initMutex();
|
||||
}
|
||||
|
||||
void AntiAliasOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void AntiAliasOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
if (y < 0 || (unsigned int)y >= this->m_height || x < 0 || (unsigned int)x >= this->m_width) {
|
||||
color[0] = 0.0f;
|
||||
@@ -82,12 +82,12 @@ bool AntiAliasOperation::determineDependingAreaOfInterest(rcti *input, ReadBuffe
|
||||
return false;
|
||||
}
|
||||
|
||||
void *AntiAliasOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *AntiAliasOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
if (this->m_buffer) { return this->m_buffer; }
|
||||
lockMutex();
|
||||
if (this->m_buffer == NULL) {
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_valueReader->initializeTileData(rect, memoryBuffers);
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_valueReader->initializeTileData(rect);
|
||||
int size = tile->getHeight() * tile->getWidth();
|
||||
float *input = tile->getBuffer();
|
||||
char *valuebuffer = new char[size];
|
||||
|
||||
@@ -43,14 +43,14 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
*/
|
||||
void initExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
|
||||
@@ -46,7 +46,7 @@ void BilateralBlurOperation::initExecution()
|
||||
QualityStepHelper::initExecution(COM_QH_INCREASE);
|
||||
}
|
||||
|
||||
void BilateralBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void BilateralBlurOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
// read the determinator color at x, y, this will be used as the reference color for the determinator
|
||||
float determinatorReferenceColor[4];
|
||||
@@ -61,20 +61,20 @@ void BilateralBlurOperation::executePixel(float *color, int x, int y, MemoryBuff
|
||||
int miny = floor(y - space);
|
||||
int maxy = ceil(y + space);
|
||||
float deltaColor;
|
||||
this->m_inputDeterminatorProgram->read(determinatorReferenceColor, x, y, inputBuffers, data);
|
||||
this->m_inputDeterminatorProgram->read(determinatorReferenceColor, x, y, data);
|
||||
|
||||
zero_v4(blurColor);
|
||||
blurDivider = 0.0f;
|
||||
for (int yi = miny; yi < maxy; yi += QualityStepHelper::getStep()) {
|
||||
for (int xi = minx; xi < maxx; xi += QualityStepHelper::getStep()) {
|
||||
// read determinator
|
||||
this->m_inputDeterminatorProgram->read(determinator, xi, yi, inputBuffers, data);
|
||||
this->m_inputDeterminatorProgram->read(determinator, xi, yi, data);
|
||||
deltaColor = (fabsf(determinatorReferenceColor[0] - determinator[0]) +
|
||||
fabsf(determinatorReferenceColor[1] - determinator[1]) +
|
||||
fabsf(determinatorReferenceColor[2] - determinator[2])); // do not take the alpha channel into account
|
||||
if (deltaColor < sigmacolor) {
|
||||
// add this to the blur
|
||||
this->m_inputColorProgram->read(tempColor, xi, yi, inputBuffers, data);
|
||||
this->m_inputColorProgram->read(tempColor, xi, yi, data);
|
||||
add_v4_v4(blurColor, tempColor);
|
||||
blurDivider += 1.0f;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -140,11 +140,11 @@ void BlurBaseOperation::deinitExecution()
|
||||
this->m_data = NULL;
|
||||
}
|
||||
|
||||
void BlurBaseOperation::updateSize(MemoryBuffer **memoryBuffers)
|
||||
void BlurBaseOperation::updateSize()
|
||||
{
|
||||
if (!this->m_sizeavailable) {
|
||||
float result[4];
|
||||
this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST, memoryBuffers);
|
||||
this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST);
|
||||
this->m_size = result[0];
|
||||
this->m_sizeavailable = true;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ protected:
|
||||
float *make_gausstab(int rad);
|
||||
float *make_dist_fac_inverse(int rad, int falloff);
|
||||
|
||||
void updateSize(MemoryBuffer **memoryBuffers);
|
||||
void updateSize();
|
||||
|
||||
/**
|
||||
* Cached reference to the inputProgram
|
||||
|
||||
@@ -45,13 +45,13 @@ BokehBlurOperation::BokehBlurOperation() : NodeOperation()
|
||||
this->m_inputBoundingBoxReader = NULL;
|
||||
}
|
||||
|
||||
void *BokehBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *BokehBlurOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
lockMutex();
|
||||
if (!this->m_sizeavailable) {
|
||||
updateSize(memoryBuffers);
|
||||
updateSize();
|
||||
}
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL, memoryBuffers);
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL);
|
||||
unlockMutex();
|
||||
return buffer;
|
||||
}
|
||||
@@ -79,13 +79,13 @@ void BokehBlurOperation::initExecution()
|
||||
QualityStepHelper::initExecution(COM_QH_INCREASE);
|
||||
}
|
||||
|
||||
void BokehBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void BokehBlurOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
float color_accum[4];
|
||||
float tempBoundingBox[4];
|
||||
float bokeh[4];
|
||||
|
||||
this->m_inputBoundingBoxReader->read(tempBoundingBox, x, y, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputBoundingBoxReader->read(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;
|
||||
@@ -95,7 +95,7 @@ void BokehBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *
|
||||
int bufferstarty = inputBuffer->getRect()->ymin;
|
||||
int pixelSize = this->m_size * this->getWidth() / 100.0f;
|
||||
if (pixelSize==0){
|
||||
this->m_inputProgram->read(color, x, y, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputProgram->read(color, x, y, COM_PS_NEAREST);
|
||||
return;
|
||||
}
|
||||
int miny = y - pixelSize;
|
||||
@@ -118,7 +118,7 @@ void BokehBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *
|
||||
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, inputBuffers);
|
||||
this->m_inputBokehProgram->read(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 *color, int x, int y, MemoryBuffer *
|
||||
color[3] = color_accum[3] * (1.0f / multiplier_accum[3]);
|
||||
}
|
||||
else {
|
||||
this->m_inputProgram->read(color, x, y, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputProgram->read(color, x, y, COM_PS_NEAREST);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ void BokehBlurOperation::executeOpenCL(OpenCLDevice* device,
|
||||
{
|
||||
cl_kernel kernel = device->COM_clCreateKernel("bokehBlurKernel", NULL);
|
||||
if (!this->m_sizeavailable) {
|
||||
updateSize(inputMemoryBuffers);
|
||||
updateSize();
|
||||
}
|
||||
cl_int radius = this->getWidth() * this->m_size / 100.0f;
|
||||
cl_int step = this->getStep();
|
||||
@@ -213,11 +213,11 @@ void BokehBlurOperation::executeOpenCL(OpenCLDevice* device,
|
||||
device->COM_clEnqueueRange(kernel, outputMemoryBuffer, 9, this);
|
||||
}
|
||||
|
||||
void BokehBlurOperation::updateSize(MemoryBuffer **memoryBuffers)
|
||||
void BokehBlurOperation::updateSize()
|
||||
{
|
||||
if (!this->m_sizeavailable) {
|
||||
float result[4];
|
||||
this->getInputSocketReader(3)->read(result, 0, 0, COM_PS_NEAREST, memoryBuffers);
|
||||
this->getInputSocketReader(3)->read(result, 0, 0, COM_PS_NEAREST);
|
||||
this->m_size = result[0];
|
||||
CLAMP(this->m_size, 0.0f, 10.0f);
|
||||
this->m_sizeavailable = true;
|
||||
|
||||
@@ -30,7 +30,7 @@ private:
|
||||
SocketReader *m_inputProgram;
|
||||
SocketReader *m_inputBokehProgram;
|
||||
SocketReader *m_inputBoundingBoxReader;
|
||||
void updateSize(MemoryBuffer **memoryBuffers);
|
||||
void updateSize();
|
||||
float m_size;
|
||||
bool m_sizeavailable;
|
||||
float m_bokehMidX;
|
||||
@@ -39,11 +39,11 @@ private:
|
||||
public:
|
||||
BokehBlurOperation();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -87,7 +87,7 @@ float BokehImageOperation::isInsideBokeh(float distance, float x, float y)
|
||||
}
|
||||
return insideBokeh;
|
||||
}
|
||||
void BokehImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void BokehImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float shift = this->m_data->lensshift;
|
||||
float shift2 = shift / 2.0f;
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -44,7 +44,7 @@ void BoxMaskOperation::initExecution()
|
||||
this->m_aspectRatio = ((float)this->getWidth()) / this->getHeight();
|
||||
}
|
||||
|
||||
void BoxMaskOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void BoxMaskOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputMask[4];
|
||||
float inputValue[4];
|
||||
@@ -57,8 +57,8 @@ void BoxMaskOperation::executePixel(float *color, float x, float y, PixelSampler
|
||||
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, inputBuffers);
|
||||
this->m_inputValue->read(inputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputMask->read(inputMask, x, y, sampler);
|
||||
this->m_inputValue->read(inputValue, x, y, sampler);
|
||||
|
||||
float halfHeight = this->m_data->height / 2.0f;
|
||||
float halfWidth = this->m_data->width / 2.0f;
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -37,15 +37,15 @@ void BrightnessOperation::initExecution()
|
||||
this->m_inputContrastProgram = this->getInputSocketReader(2);
|
||||
}
|
||||
|
||||
void BrightnessOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void BrightnessOperation::executePixel(float *color, 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, inputBuffers);
|
||||
this->m_inputBrightnessProgram->read(inputBrightness, x, y, sampler, inputBuffers);
|
||||
this->m_inputContrastProgram->read(inputContrast, x, y, sampler, inputBuffers);
|
||||
this->m_inputProgram->read(inputValue, x, y, sampler);
|
||||
this->m_inputBrightnessProgram->read(inputBrightness, x, y, sampler);
|
||||
this->m_inputContrastProgram->read(inputContrast, x, y, sampler);
|
||||
float brightness = inputBrightness[0];
|
||||
float contrast = inputContrast[0];
|
||||
brightness /= 100.0f;
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -42,7 +42,7 @@ void CalculateMeanOperation::initExecution()
|
||||
NodeOperation::initMutex();
|
||||
}
|
||||
|
||||
void CalculateMeanOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void CalculateMeanOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
color[0] = this->m_result;
|
||||
}
|
||||
@@ -70,11 +70,11 @@ bool CalculateMeanOperation::determineDependingAreaOfInterest(rcti *input, ReadB
|
||||
return false;
|
||||
}
|
||||
|
||||
void *CalculateMeanOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *CalculateMeanOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
lockMutex();
|
||||
if (!this->m_iscalculated) {
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_imageReader->initializeTileData(rect, memoryBuffers);
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_imageReader->initializeTileData(rect);
|
||||
calculateMean(tile);
|
||||
this->m_iscalculated = true;
|
||||
}
|
||||
|
||||
@@ -46,14 +46,14 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
*/
|
||||
void initExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
|
||||
@@ -31,16 +31,16 @@ CalculateStandardDeviationOperation::CalculateStandardDeviationOperation() : Cal
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void CalculateStandardDeviationOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void CalculateStandardDeviationOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
color[0] = this->m_standardDeviation;
|
||||
}
|
||||
|
||||
void *CalculateStandardDeviationOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *CalculateStandardDeviationOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
lockMutex();
|
||||
if (!this->m_iscalculated) {
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_imageReader->initializeTileData(rect, memoryBuffers);
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_imageReader->initializeTileData(rect);
|
||||
CalculateMeanOperation::calculateMean(tile);
|
||||
this->m_standardDeviation = 0.0f;
|
||||
float *buffer = tile->getBuffer();
|
||||
|
||||
@@ -39,9 +39,9 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -39,11 +39,11 @@ void ChangeHSVOperation::deinitExecution()
|
||||
this->m_inputOperation = NULL;
|
||||
}
|
||||
|
||||
void ChangeHSVOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ChangeHSVOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
|
||||
this->m_inputOperation->read(inputColor1, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(inputColor1, x, y, sampler);
|
||||
|
||||
outputValue[0] = inputColor1[0] + (this->m_hue - 0.5f);
|
||||
if (outputValue[0] > 1.0f) outputValue[0] -= 1.0f;
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void setHue(float hue) { this->m_hue = hue; }
|
||||
void setSaturation(float saturation) { this->m_saturation = saturation; }
|
||||
|
||||
@@ -83,7 +83,7 @@ void ChannelMatteOperation::deinitExecution()
|
||||
this->m_inputImageProgram = NULL;
|
||||
}
|
||||
|
||||
void ChannelMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ChannelMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inColor[4];
|
||||
float alpha;
|
||||
@@ -92,7 +92,7 @@ void ChannelMatteOperation::executePixel(float *outputValue, float x, float y, P
|
||||
const float limit_min = this->m_limit_min;
|
||||
const float limit_range = this->m_limit_range;
|
||||
|
||||
this->m_inputImageProgram->read(inColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputImageProgram->read(inColor, x, y, sampler);
|
||||
|
||||
/* matte operation */
|
||||
alpha = inColor[this->m_ids[0]] - max(inColor[this->m_ids[1]], inColor[this->m_ids[2]]);
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -44,7 +44,7 @@ void ChromaMatteOperation::deinitExecution()
|
||||
this->m_inputKeyProgram = NULL;
|
||||
}
|
||||
|
||||
void ChromaMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ChromaMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inKey[4];
|
||||
float inImage[4];
|
||||
@@ -57,8 +57,8 @@ void ChromaMatteOperation::executePixel(float *outputValue, float x, float y, Pi
|
||||
float theta, beta;
|
||||
float kfg;
|
||||
|
||||
this->m_inputKeyProgram->read(inKey, x, y, sampler, inputBuffers);
|
||||
this->m_inputImageProgram->read(inImage, x, y, sampler, inputBuffers);
|
||||
this->m_inputKeyProgram->read(inKey, x, y, sampler);
|
||||
this->m_inputImageProgram->read(inImage, x, y, sampler);
|
||||
|
||||
/* store matte(alpha) value in [0] to go with
|
||||
* COM_SetAlphaOperation and the Value output
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -49,13 +49,13 @@ void ColorBalanceASCCDLOperation::initExecution()
|
||||
this->m_inputColorOperation = this->getInputSocketReader(1);
|
||||
}
|
||||
|
||||
void ColorBalanceASCCDLOperation::executePixel(float *outputColor, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ColorBalanceASCCDLOperation::executePixel(float *outputColor, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor[4];
|
||||
float value[4];
|
||||
|
||||
this->m_inputValueOperation->read(value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColorOperation->read(inputColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(value, x, y, sampler);
|
||||
this->m_inputColorOperation->read(inputColor, x, y, sampler);
|
||||
|
||||
float fac = value[0];
|
||||
fac = min(1.0f, fac);
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -54,13 +54,13 @@ void ColorBalanceLGGOperation::initExecution()
|
||||
this->m_inputColorOperation = this->getInputSocketReader(1);
|
||||
}
|
||||
|
||||
void ColorBalanceLGGOperation::executePixel(float *outputColor, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ColorBalanceLGGOperation::executePixel(float *outputColor, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor[4];
|
||||
float value[4];
|
||||
|
||||
this->m_inputValueOperation->read(value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColorOperation->read(inputColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(value, x, y, sampler);
|
||||
this->m_inputColorOperation->read(inputColor, x, y, sampler);
|
||||
|
||||
float fac = value[0];
|
||||
fac = min(1.0f, fac);
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -40,12 +40,12 @@ void ColorCorrectionOperation::initExecution()
|
||||
this->m_inputMask = this->getInputSocketReader(1);
|
||||
}
|
||||
|
||||
void ColorCorrectionOperation::executePixel(float *output, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ColorCorrectionOperation::executePixel(float *output, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputImageColor[4];
|
||||
float inputMask[4];
|
||||
this->m_inputImage->read(inputImageColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputMask->read(inputMask, x, y, sampler, inputBuffers);
|
||||
this->m_inputImage->read(inputImageColor, x, y, sampler);
|
||||
this->m_inputMask->read(inputMask, x, y, sampler);
|
||||
|
||||
float level = (inputImageColor[0] + inputImageColor[1] + inputImageColor[2]) / 3.0f;
|
||||
float contrast = this->m_data->master.contrast;
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -58,7 +58,7 @@ void ColorCurveOperation::initExecution()
|
||||
|
||||
}
|
||||
|
||||
void ColorCurveOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ColorCurveOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
CurveMapping *cumap = this->m_curveMapping;
|
||||
CurveMapping *workingCopy = (CurveMapping *)MEM_dupallocN(cumap);
|
||||
@@ -68,13 +68,13 @@ void ColorCurveOperation::executePixel(float *color, float x, float y, PixelSamp
|
||||
float fac[4];
|
||||
float image[4];
|
||||
|
||||
this->m_inputBlackProgram->read(black, x, y, sampler, inputBuffers);
|
||||
this->m_inputWhiteProgram->read(white, x, y, sampler, inputBuffers);
|
||||
this->m_inputBlackProgram->read(black, x, y, sampler);
|
||||
this->m_inputWhiteProgram->read(white, x, y, sampler);
|
||||
|
||||
curvemapping_set_black_white(workingCopy, black, white);
|
||||
|
||||
this->m_inputFacProgram->read(fac, x, y, sampler, inputBuffers);
|
||||
this->m_inputImageProgram->read(image, x, y, sampler, inputBuffers);
|
||||
this->m_inputFacProgram->read(fac, x, y, sampler);
|
||||
this->m_inputImageProgram->read(image, x, y, sampler);
|
||||
|
||||
if (*fac >= 1.0f)
|
||||
curvemapping_evaluate_premulRGBF(workingCopy, color, image);
|
||||
@@ -126,14 +126,14 @@ void ConstantLevelColorCurveOperation::initExecution()
|
||||
curvemapping_set_black_white(this->m_curveMapping, this->m_black, this->m_white);
|
||||
}
|
||||
|
||||
void ConstantLevelColorCurveOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConstantLevelColorCurveOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float fac[4];
|
||||
float image[4];
|
||||
|
||||
|
||||
this->m_inputFacProgram->read(fac, x, y, sampler, inputBuffers);
|
||||
this->m_inputImageProgram->read(image, x, y, sampler, inputBuffers);
|
||||
this->m_inputFacProgram->read(fac, x, y, sampler);
|
||||
this->m_inputImageProgram->read(image, x, y, sampler);
|
||||
|
||||
if (*fac >= 1.0f)
|
||||
curvemapping_evaluate_premulRGBF(this->m_curveMapping, color, image);
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -44,7 +44,7 @@ void ColorMatteOperation::deinitExecution()
|
||||
this->m_inputKeyProgram = NULL;
|
||||
}
|
||||
|
||||
void ColorMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ColorMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inColor[4];
|
||||
float inKey[4];
|
||||
@@ -55,8 +55,8 @@ void ColorMatteOperation::executePixel(float *outputValue, float x, float y, Pix
|
||||
|
||||
float h_wrap;
|
||||
|
||||
this->m_inputImageProgram->read(inColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputKeyProgram->read(inKey, x, y, sampler, inputBuffers);
|
||||
this->m_inputImageProgram->read(inColor, x, y, sampler);
|
||||
this->m_inputKeyProgram->read(inKey, x, y, sampler);
|
||||
|
||||
|
||||
/* store matte(alpha) value in [0] to go with
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -43,11 +43,11 @@ void ColorRampOperation::initExecution()
|
||||
this->m_inputProgram = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ColorRampOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ColorRampOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float values[4];
|
||||
|
||||
this->m_inputProgram->read(values, x, y, sampler, inputBuffers);
|
||||
this->m_inputProgram->read(values, x, y, sampler);
|
||||
do_colorband(this->m_colorBand, values[0], color);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -84,12 +84,12 @@ void ColorSpillOperation::deinitExecution()
|
||||
this->m_inputFacReader = NULL;
|
||||
}
|
||||
|
||||
void ColorSpillOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ColorSpillOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float fac[4];
|
||||
float input[4];
|
||||
this->m_inputFacReader->read(fac, x, y, sampler, inputBuffers);
|
||||
this->m_inputImageReader->read(input, x, y, sampler, inputBuffers);
|
||||
this->m_inputFacReader->read(fac, x, y, sampler);
|
||||
this->m_inputImageReader->read(input, x, y, sampler);
|
||||
float rfac = min(1.0f, fac[0]);
|
||||
float map = calculateMapValue(rfac, input);
|
||||
if (map > 0.0f) {
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -78,24 +78,24 @@ void CombineChannelsOperation::deinitExecution()
|
||||
}
|
||||
|
||||
|
||||
void CombineChannelsOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void CombineChannelsOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float input[4];
|
||||
/// @todo: remove if statements
|
||||
if (this->m_inputChannel1Operation) {
|
||||
this->m_inputChannel1Operation->read(input, x, y, sampler, inputBuffers);
|
||||
this->m_inputChannel1Operation->read(input, x, y, sampler);
|
||||
color[0] = input[0];
|
||||
}
|
||||
if (this->m_inputChannel2Operation) {
|
||||
this->m_inputChannel2Operation->read(input, x, y, sampler, inputBuffers);
|
||||
this->m_inputChannel2Operation->read(input, x, y, sampler);
|
||||
color[1] = input[0];
|
||||
}
|
||||
if (this->m_inputChannel3Operation) {
|
||||
this->m_inputChannel3Operation->read(input, x, y, sampler, inputBuffers);
|
||||
this->m_inputChannel3Operation->read(input, x, y, sampler);
|
||||
color[2] = input[0];
|
||||
}
|
||||
if (this->m_inputChannel4Operation) {
|
||||
this->m_inputChannel4Operation->read(input, x, y, sampler, inputBuffers);
|
||||
this->m_inputChannel4Operation->read(input, x, y, sampler);
|
||||
color[3] = input[0];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ private:
|
||||
SocketReader *m_inputChannel4Operation;
|
||||
public:
|
||||
CombineChannelsOperation();
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "BKE_image.h"
|
||||
|
||||
extern "C" {
|
||||
#include "BLI_threads.h"
|
||||
#include "RE_pipeline.h"
|
||||
#include "RE_shader_ext.h"
|
||||
#include "RE_render_ext.h"
|
||||
@@ -63,6 +64,7 @@ void CompositorOperation::deinitExecution()
|
||||
const RenderData *rd = this->m_rd;
|
||||
Render *re = RE_GetRender_FromData(rd);
|
||||
RenderResult *rr = RE_AcquireResultWrite(re);
|
||||
|
||||
if (rr) {
|
||||
if (rr->rectf != NULL) {
|
||||
MEM_freeN(rr->rectf);
|
||||
@@ -75,7 +77,9 @@ void CompositorOperation::deinitExecution()
|
||||
}
|
||||
}
|
||||
|
||||
BLI_lock_thread(LOCK_DRAW_IMAGE);
|
||||
BKE_image_signal(BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"), NULL, IMA_SIGNAL_FREE);
|
||||
BLI_unlock_thread(LOCK_DRAW_IMAGE);
|
||||
|
||||
if (re) {
|
||||
RE_ReleaseResult(re);
|
||||
@@ -111,9 +115,9 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int tileNumber)
|
||||
|
||||
for (y = y1; y < y2 && (!breaked); y++) {
|
||||
for (x = x1; x < x2 && (!breaked); x++) {
|
||||
this->m_imageInput->read(color, x, y, COM_PS_NEAREST, NULL);
|
||||
this->m_imageInput->read(color, x, y, COM_PS_NEAREST);
|
||||
if (this->m_alphaInput != NULL) {
|
||||
this->m_alphaInput->read(&(color[3]), x, y, COM_PS_NEAREST, NULL);
|
||||
this->m_alphaInput->read(&(color[3]), x, y, COM_PS_NEAREST);
|
||||
}
|
||||
copy_v4_v4(buffer + offset, color);
|
||||
offset += COM_NUMBER_OF_CHANNELS;
|
||||
|
||||
@@ -38,10 +38,10 @@ void ConvertColorProfileOperation::initExecution()
|
||||
this->m_inputOperation = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertColorProfileOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertColorProfileOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float color[4];
|
||||
this->m_inputOperation->read(color, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(color, x, y, sampler);
|
||||
IMB_buffer_float_from_float(outputValue, color, 4, this->m_toProfile, this->m_fromProfile, this->m_predivided, 1, 1, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -34,10 +34,10 @@ void ConvertColorToBWOperation::initExecution()
|
||||
this->m_inputOperation = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertColorToBWOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertColorToBWOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor[4];
|
||||
this->m_inputOperation->read(&inputColor[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(&inputColor[0], x, y, sampler);
|
||||
outputValue[0] = rgb_to_bw(inputColor);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -34,10 +34,10 @@ void ConvertColorToValueProg::initExecution()
|
||||
this->m_inputOperation = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertColorToValueProg::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertColorToValueProg::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor[4];
|
||||
this->m_inputOperation->read(&inputColor[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(&inputColor[0], x, y, sampler);
|
||||
outputValue[0] = (inputColor[0] + inputColor[1] + inputColor[2]) / 3.0f;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -34,9 +34,9 @@ void ConvertColorToVectorOperation::initExecution()
|
||||
this->m_inputOperation = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertColorToVectorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertColorToVectorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
this->m_inputOperation->read(outputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(outputValue, x, y, sampler);
|
||||
}
|
||||
|
||||
void ConvertColorToVectorOperation::deinitExecution()
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -75,12 +75,12 @@ void ConvertDepthToRadiusOperation::initExecution()
|
||||
}
|
||||
}
|
||||
|
||||
void ConvertDepthToRadiusOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertDepthToRadiusOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue[4];
|
||||
float z;
|
||||
float radius;
|
||||
this->m_inputOperation->read(inputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(inputValue, x, y, sampler);
|
||||
z = inputValue[0];
|
||||
if (z != 0.f) {
|
||||
float iZ = (1.f / z);
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -35,10 +35,10 @@ void ConvertHSVToRGBOperation::initExecution()
|
||||
this->m_inputOperation = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertHSVToRGBOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertHSVToRGBOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor[4];
|
||||
this->m_inputOperation->read(inputColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(inputColor, x, y, sampler);
|
||||
hsv_to_rgb(inputColor[0], inputColor[1], inputColor[2], &outputValue[0], &outputValue[1], &outputValue[2]);
|
||||
outputValue[3] = inputColor[3];
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -35,12 +35,12 @@ void ConvertKeyToPremulOperation::initExecution()
|
||||
this->m_inputColor = getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertKeyToPremulOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertKeyToPremulOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue[4];
|
||||
float alpha;
|
||||
|
||||
this->m_inputColor->read(inputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor->read(inputValue, x, y, sampler);
|
||||
alpha = inputValue[3];
|
||||
|
||||
mul_v3_v3fl(outputValue, inputValue, alpha);
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -35,12 +35,12 @@ void ConvertPremulToKeyOperation::initExecution()
|
||||
this->m_inputColor = getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertPremulToKeyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertPremulToKeyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue[4];
|
||||
float alpha;
|
||||
|
||||
this->m_inputColor->read(inputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor->read(inputValue, x, y, sampler);
|
||||
alpha = inputValue[3];
|
||||
|
||||
if (fabsf(alpha) < 1e-5f) {
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -35,10 +35,10 @@ void ConvertRGBToHSVOperation::initExecution()
|
||||
this->m_inputOperation = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertRGBToHSVOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertRGBToHSVOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor[4];
|
||||
this->m_inputOperation->read(inputColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(inputColor, x, y, sampler);
|
||||
rgb_to_hsv(inputColor[0], inputColor[1], inputColor[2], &outputValue[0], &outputValue[1], &outputValue[2]);
|
||||
outputValue[3] = inputColor[3];
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -50,12 +50,12 @@ void ConvertRGBToYCCOperation::setMode(int mode)
|
||||
}
|
||||
}
|
||||
|
||||
void ConvertRGBToYCCOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertRGBToYCCOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor[4];
|
||||
float color[3];
|
||||
|
||||
this->m_inputOperation->read(inputColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(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 */
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -34,10 +34,10 @@ void ConvertRGBToYUVOperation::initExecution()
|
||||
this->m_inputOperation = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertRGBToYUVOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertRGBToYUVOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor[4];
|
||||
this->m_inputOperation->read(inputColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(inputColor, x, y, sampler);
|
||||
rgb_to_yuv(inputColor[0], inputColor[1], inputColor[2], &outputValue[0], &outputValue[1], &outputValue[2]);
|
||||
outputValue[3] = inputColor[3];
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -33,10 +33,10 @@ void ConvertValueToColorProg::initExecution()
|
||||
this->m_inputProgram = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertValueToColorProg::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertValueToColorProg::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue[4];
|
||||
this->m_inputProgram->read(inputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputProgram->read(inputValue, x, y, sampler);
|
||||
color[0] = inputValue[0];
|
||||
color[1] = inputValue[0];
|
||||
color[2] = inputValue[0];
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -34,10 +34,10 @@ void ConvertValueToVectorOperation::initExecution()
|
||||
this->m_inputOperation = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertValueToVectorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertValueToVectorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float input[4];
|
||||
this->m_inputOperation->read(input, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(input, x, y, sampler);
|
||||
outputValue[0] = input[0];
|
||||
outputValue[1] = input[0];
|
||||
outputValue[2] = input[0];
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -34,9 +34,9 @@ void ConvertVectorToColorOperation::initExecution()
|
||||
this->m_inputOperation = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertVectorToColorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertVectorToColorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
this->m_inputOperation->read(outputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(outputValue, x, y, sampler);
|
||||
outputValue[3] = 1.0f;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -34,10 +34,10 @@ void ConvertVectorToValueOperation::initExecution()
|
||||
this->m_inputOperation = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertVectorToValueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertVectorToValueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float input[4];
|
||||
this->m_inputOperation->read(input, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(input, x, y, sampler);
|
||||
outputValue[0] = (input[0] + input[1] + input[2]) / 3.0f;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -50,10 +50,10 @@ void ConvertYCCToRGBOperation::setMode(int mode)
|
||||
}
|
||||
}
|
||||
|
||||
void ConvertYCCToRGBOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertYCCToRGBOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor[4];
|
||||
this->m_inputOperation->read(inputColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(inputColor, x, y, sampler);
|
||||
|
||||
/* need to un-normalize the data */
|
||||
/* R,G,B --> Y,Cb,Cr */
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -34,10 +34,10 @@ void ConvertYUVToRGBOperation::initExecution()
|
||||
this->m_inputOperation = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void ConvertYUVToRGBOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ConvertYUVToRGBOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor[4];
|
||||
this->m_inputOperation->read(inputColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(inputColor, x, y, sampler);
|
||||
yuv_to_rgb(inputColor[0], inputColor[1], inputColor[2], &outputValue[0], &outputValue[1], &outputValue[2]);
|
||||
outputValue[3] = inputColor[3];
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -28,7 +28,7 @@ ConvolutionEdgeFilterOperation::ConvolutionEdgeFilterOperation() : ConvolutionFi
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void ConvolutionEdgeFilterOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void ConvolutionEdgeFilterOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
float in1[4], in2[4], res1[4], res2[4];
|
||||
|
||||
@@ -46,7 +46,7 @@ void ConvolutionEdgeFilterOperation::executePixel(float *color, int x, int y, Me
|
||||
CLAMP(y3, 0, getHeight() - 1);
|
||||
|
||||
float value[4];
|
||||
this->m_inputValueOperation->read(value, x2, y2, inputBuffers, NULL);
|
||||
this->m_inputValueOperation->read(value, x2, y2, NULL);
|
||||
float mval = 1.0f - value[0];
|
||||
|
||||
res1[0] = 0.0f;
|
||||
@@ -58,39 +58,39 @@ void ConvolutionEdgeFilterOperation::executePixel(float *color, int x, int y, Me
|
||||
res2[2] = 0.0f;
|
||||
res2[3] = 0.0f;
|
||||
|
||||
this->m_inputOperation->read(in1, x1, y1, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x1, y1, NULL);
|
||||
madd_v3_v3fl(res1, in1, this->m_filter[0]);
|
||||
madd_v3_v3fl(res2, in1, this->m_filter[0]);
|
||||
|
||||
this->m_inputOperation->read(in1, x2, y1, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x2, y1, NULL);
|
||||
madd_v3_v3fl(res1, in1, this->m_filter[1]);
|
||||
madd_v3_v3fl(res2, in1, this->m_filter[3]);
|
||||
|
||||
this->m_inputOperation->read(in1, x3, y1, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x3, y1, NULL);
|
||||
madd_v3_v3fl(res1, in1, this->m_filter[2]);
|
||||
madd_v3_v3fl(res2, in1, this->m_filter[6]);
|
||||
|
||||
this->m_inputOperation->read(in1, x1, y2, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x1, y2, NULL);
|
||||
madd_v3_v3fl(res1, in1, this->m_filter[3]);
|
||||
madd_v3_v3fl(res2, in1, this->m_filter[1]);
|
||||
|
||||
this->m_inputOperation->read(in2, x2, y2, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in2, x2, y2, NULL);
|
||||
madd_v3_v3fl(res1, in2, this->m_filter[4]);
|
||||
madd_v3_v3fl(res2, in2, this->m_filter[4]);
|
||||
|
||||
this->m_inputOperation->read(in1, x3, y2, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x3, y2, NULL);
|
||||
madd_v3_v3fl(res1, in1, this->m_filter[5]);
|
||||
madd_v3_v3fl(res2, in1, this->m_filter[7]);
|
||||
|
||||
this->m_inputOperation->read(in1, x1, y3, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x1, y3, NULL);
|
||||
madd_v3_v3fl(res1, in1, this->m_filter[6]);
|
||||
madd_v3_v3fl(res2, in1, this->m_filter[2]);
|
||||
|
||||
this->m_inputOperation->read(in1, x2, y3, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x2, y3, NULL);
|
||||
madd_v3_v3fl(res1, in1, this->m_filter[7]);
|
||||
madd_v3_v3fl(res2, in1, this->m_filter[5]);
|
||||
|
||||
this->m_inputOperation->read(in1, x3, y3, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x3, y3, NULL);
|
||||
madd_v3_v3fl(res1, in1, this->m_filter[8]);
|
||||
madd_v3_v3fl(res2, in1, this->m_filter[8]);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
class ConvolutionEdgeFilterOperation : public ConvolutionFilterOperation {
|
||||
public:
|
||||
ConvolutionEdgeFilterOperation();
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -67,7 +67,7 @@ void ConvolutionFilterOperation::deinitExecution()
|
||||
}
|
||||
|
||||
|
||||
void ConvolutionFilterOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void ConvolutionFilterOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
float in1[4];
|
||||
float in2[4];
|
||||
@@ -84,27 +84,27 @@ void ConvolutionFilterOperation::executePixel(float *color, int x, int y, Memory
|
||||
CLAMP(y2, 0, getHeight() - 1);
|
||||
CLAMP(y3, 0, getHeight() - 1);
|
||||
float value[4];
|
||||
this->m_inputValueOperation->read(value, x2, y2, inputBuffers, NULL);
|
||||
this->m_inputValueOperation->read(value, x2, y2, NULL);
|
||||
const float mval = 1.0f - value[0];
|
||||
|
||||
zero_v4(color);
|
||||
this->m_inputOperation->read(in1, x1, y1, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x1, y1, NULL);
|
||||
madd_v4_v4fl(color, in1, this->m_filter[0]);
|
||||
this->m_inputOperation->read(in1, x2, y1, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x2, y1, NULL);
|
||||
madd_v4_v4fl(color, in1, this->m_filter[1]);
|
||||
this->m_inputOperation->read(in1, x3, y1, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x3, y1, NULL);
|
||||
madd_v4_v4fl(color, in1, this->m_filter[2]);
|
||||
this->m_inputOperation->read(in1, x1, y2, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x1, y2, NULL);
|
||||
madd_v4_v4fl(color, in1, this->m_filter[3]);
|
||||
this->m_inputOperation->read(in2, x2, y2, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in2, x2, y2, NULL);
|
||||
madd_v4_v4fl(color, in2, this->m_filter[4]);
|
||||
this->m_inputOperation->read(in1, x3, y2, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x3, y2, NULL);
|
||||
madd_v4_v4fl(color, in1, this->m_filter[5]);
|
||||
this->m_inputOperation->read(in1, x1, y3, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x1, y3, NULL);
|
||||
madd_v4_v4fl(color, in1, this->m_filter[6]);
|
||||
this->m_inputOperation->read(in1, x2, y3, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x2, y3, NULL);
|
||||
madd_v4_v4fl(color, in1, this->m_filter[7]);
|
||||
this->m_inputOperation->read(in1, x3, y3, inputBuffers, NULL);
|
||||
this->m_inputOperation->read(in1, x3, y3, NULL);
|
||||
madd_v4_v4fl(color, in1, this->m_filter[8]);
|
||||
|
||||
color[0] = color[0] * value[0] + in2[0] * mval;
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
ConvolutionFilterOperation();
|
||||
void set3x3Filter(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9);
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -73,10 +73,10 @@ CropOperation::CropOperation() : CropBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void CropOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void CropOperation::executePixel(float *color, 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(color, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(color, x, y, sampler);
|
||||
}
|
||||
else {
|
||||
zero_v4(color);
|
||||
@@ -108,7 +108,7 @@ void CropImageOperation::determineResolution(unsigned int resolution[], unsigned
|
||||
resolution[1] = this->m_ymax - this->m_ymin;
|
||||
}
|
||||
|
||||
void CropImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void CropImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
this->m_inputOperation->read(color, (x + this->m_xmin), (y + this->m_ymin), sampler, inputBuffers);
|
||||
this->m_inputOperation->read(color, (x + this->m_xmin), (y + this->m_ymin), sampler);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class CropOperation : public CropBaseOperation {
|
||||
private:
|
||||
public:
|
||||
CropOperation();
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, 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[], unsigned int preferedResolution[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -44,7 +44,7 @@ void DifferenceMatteOperation::deinitExecution()
|
||||
this->m_inputImage2Program = NULL;
|
||||
}
|
||||
|
||||
void DifferenceMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void DifferenceMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inColor1[4];
|
||||
float inColor2[4];
|
||||
@@ -54,8 +54,8 @@ void DifferenceMatteOperation::executePixel(float *outputValue, float x, float y
|
||||
float difference;
|
||||
float alpha;
|
||||
|
||||
this->m_inputImage1Program->read(inColor1, x, y, sampler, inputBuffers);
|
||||
this->m_inputImage2Program->read(inColor2, x, y, sampler, inputBuffers);
|
||||
this->m_inputImage1Program->read(inColor1, x, y, sampler);
|
||||
this->m_inputImage2Program->read(inColor2, x, y, sampler);
|
||||
|
||||
difference = (fabsf(inColor2[0] - inColor1[0]) +
|
||||
fabsf(inColor2[1] - inColor1[1]) +
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -54,13 +54,13 @@ void DilateErodeThresholdOperation::initExecution()
|
||||
}
|
||||
}
|
||||
|
||||
void *DilateErodeThresholdOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *DilateErodeThresholdOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
void *buffer = this->m_inputProgram->initializeTileData(NULL, memoryBuffers);
|
||||
void *buffer = this->m_inputProgram->initializeTileData(NULL);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void DilateErodeThresholdOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void DilateErodeThresholdOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
float inputValue[4];
|
||||
const float sw = this->m__switch;
|
||||
@@ -80,7 +80,7 @@ void DilateErodeThresholdOperation::executePixel(float *color, int x, int y, Mem
|
||||
const int bufferWidth = rect->xmax - rect->xmin;
|
||||
int offset;
|
||||
|
||||
this->m_inputProgram->read(inputValue, x, y, inputBuffers, NULL);
|
||||
this->m_inputProgram->read(inputValue, x, y, NULL);
|
||||
if (inputValue[0] > sw) {
|
||||
for (int yi = miny; yi < maxy; yi++) {
|
||||
const float dy = yi - y;
|
||||
@@ -179,13 +179,13 @@ void DilateDistanceOperation::initExecution()
|
||||
}
|
||||
}
|
||||
|
||||
void *DilateDistanceOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *DilateDistanceOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
void *buffer = this->m_inputProgram->initializeTileData(NULL, memoryBuffers);
|
||||
void *buffer = this->m_inputProgram->initializeTileData(NULL);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void DilateDistanceOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void DilateDistanceOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
const float distance = this->m_distance;
|
||||
const float mindist = distance * distance;
|
||||
@@ -259,7 +259,7 @@ ErodeDistanceOperation::ErodeDistanceOperation() : DilateDistanceOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void ErodeDistanceOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void ErodeDistanceOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
const float distance = this->m_distance;
|
||||
const float mindist = distance * distance;
|
||||
@@ -325,14 +325,14 @@ void DilateStepOperation::initExecution()
|
||||
this->initMutex();
|
||||
}
|
||||
|
||||
void *DilateStepOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *DilateStepOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
if (this->m_cached_buffer != NULL) {
|
||||
return this->m_cached_buffer;
|
||||
}
|
||||
lockMutex();
|
||||
if (this->m_cached_buffer == NULL) {
|
||||
MemoryBuffer *buffer = (MemoryBuffer *)this->m_inputProgram->initializeTileData(NULL, memoryBuffers);
|
||||
MemoryBuffer *buffer = (MemoryBuffer *)this->m_inputProgram->initializeTileData(NULL);
|
||||
float *rectf = buffer->convertToValueBuffer();
|
||||
int x, y, i;
|
||||
float *p;
|
||||
@@ -374,7 +374,7 @@ void *DilateStepOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryB
|
||||
}
|
||||
|
||||
|
||||
void DilateStepOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void DilateStepOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
color[0] = this->m_cached_buffer[y * this->getWidth() + x];
|
||||
}
|
||||
@@ -412,14 +412,14 @@ ErodeStepOperation::ErodeStepOperation() : DilateStepOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void *ErodeStepOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *ErodeStepOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
if (this->m_cached_buffer != NULL) {
|
||||
return this->m_cached_buffer;
|
||||
}
|
||||
lockMutex();
|
||||
if (this->m_cached_buffer == NULL) {
|
||||
MemoryBuffer *buffer = (MemoryBuffer *)this->m_inputProgram->initializeTileData(NULL, memoryBuffers);
|
||||
MemoryBuffer *buffer = (MemoryBuffer *)this->m_inputProgram->initializeTileData(NULL);
|
||||
float *rectf = buffer->convertToValueBuffer();
|
||||
int x, y, i;
|
||||
float *p;
|
||||
|
||||
@@ -47,14 +47,14 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
*/
|
||||
void initExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
*/
|
||||
@@ -83,14 +83,14 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
*/
|
||||
void initExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
*/
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
void executeOpenCL(OpenCLDevice* device,
|
||||
MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer,
|
||||
@@ -135,14 +135,14 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
*/
|
||||
void initExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
*/
|
||||
@@ -157,7 +157,7 @@ class ErodeStepOperation : public DilateStepOperation {
|
||||
public:
|
||||
ErodeStepOperation();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -66,12 +66,12 @@ void DirectionalBlurOperation::initExecution()
|
||||
|
||||
}
|
||||
|
||||
void DirectionalBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void DirectionalBlurOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
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, inputBuffers);
|
||||
this->m_inputProgram->read(col2, x, y, COM_PS_NEAREST);
|
||||
float ltx = this->m_tx;
|
||||
float lty = this->m_ty;
|
||||
float lsc = this->m_sc;
|
||||
@@ -87,7 +87,7 @@ void DirectionalBlurOperation::executePixel(float *color, int x, int y, MemoryBu
|
||||
this->m_inputProgram->read(col,
|
||||
cs * u + ss * v + this->m_center_x_pix,
|
||||
cs * v - ss * u + this->m_center_y_pix,
|
||||
COM_PS_NEAREST, inputBuffers);
|
||||
COM_PS_NEAREST);
|
||||
|
||||
add_v4_v4(col2, col);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -54,7 +54,7 @@ void DisplaceOperation::initExecution()
|
||||
* in order to take effect */
|
||||
#define DISPLACE_EPSILON 0.01f
|
||||
|
||||
void DisplaceOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void DisplaceOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
float inVector[4];
|
||||
float inScale[4];
|
||||
@@ -64,9 +64,9 @@ void DisplaceOperation::executePixel(float *color, int x, int y, MemoryBuffer *i
|
||||
float dxt, dyt;
|
||||
float u, v;
|
||||
|
||||
this->m_inputScaleXProgram->read(inScale, x, y, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputScaleXProgram->read(inScale, x, y, COM_PS_NEAREST);
|
||||
float xs = inScale[0];
|
||||
this->m_inputScaleYProgram->read(inScale, x, y, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputScaleYProgram->read(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 *color, int x, int y, MemoryBuffer *i
|
||||
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, inputBuffers);
|
||||
this->m_inputVectorProgram->read(inVector, x, y, COM_PS_NEAREST);
|
||||
p_dx = inVector[0] * xs;
|
||||
p_dy = inVector[1] * ys;
|
||||
|
||||
@@ -83,9 +83,9 @@ void DisplaceOperation::executePixel(float *color, int x, int y, MemoryBuffer *i
|
||||
v = y - p_dy + 0.5f;
|
||||
|
||||
/* calc derivatives */
|
||||
this->m_inputVectorProgram->read(inVector, x + 1, y, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputVectorProgram->read(inVector, x + 1, y, COM_PS_NEAREST);
|
||||
d_dx = inVector[0] * xs;
|
||||
this->m_inputVectorProgram->read(inVector, x, y + 1, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputVectorProgram->read(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 *color, int x, int y, MemoryBuffer *i
|
||||
dyt = signf(dyt) * maxf(fabsf(dyt), DISPLACE_EPSILON) / this->getHeight();
|
||||
|
||||
/* EWA filtering */
|
||||
this->m_inputColorProgram->read(color, u, v, dxt, dyt, inputBuffers);
|
||||
this->m_inputColorProgram->read(color, u, v, dxt, dyt);
|
||||
}
|
||||
|
||||
void DisplaceOperation::deinitExecution()
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -53,7 +53,7 @@ void DisplaceSimpleOperation::initExecution()
|
||||
* in order to take effect */
|
||||
#define DISPLACE_EPSILON 0.01f
|
||||
|
||||
void DisplaceSimpleOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void DisplaceSimpleOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inVector[4];
|
||||
float inScale[4];
|
||||
@@ -61,9 +61,9 @@ void DisplaceSimpleOperation::executePixel(float *color, float x, float y, Pixel
|
||||
float p_dx, p_dy; /* main displacement in pixel space */
|
||||
float u, v;
|
||||
|
||||
this->m_inputScaleXProgram->read(inScale, x, y, sampler, inputBuffers);
|
||||
this->m_inputScaleXProgram->read(inScale, x, y, sampler);
|
||||
float xs = inScale[0];
|
||||
this->m_inputScaleYProgram->read(inScale, x, y, sampler, inputBuffers);
|
||||
this->m_inputScaleYProgram->read(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 *color, float x, float y, Pixel
|
||||
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, inputBuffers);
|
||||
this->m_inputVectorProgram->read(inVector, x, y, sampler);
|
||||
p_dx = inVector[0] * xs;
|
||||
p_dy = inVector[1] * ys;
|
||||
|
||||
@@ -82,7 +82,7 @@ void DisplaceSimpleOperation::executePixel(float *color, float x, float y, Pixel
|
||||
CLAMP(u, 0.f, this->getWidth() - 1.f);
|
||||
CLAMP(v, 0.f, this->getHeight() - 1.f);
|
||||
|
||||
this->m_inputColorProgram->read(color, u, v, sampler, inputBuffers);
|
||||
this->m_inputColorProgram->read(color, u, v, sampler);
|
||||
}
|
||||
|
||||
void DisplaceSimpleOperation::deinitExecution()
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -44,7 +44,7 @@ void DistanceMatteOperation::deinitExecution()
|
||||
this->m_inputKeyProgram = NULL;
|
||||
}
|
||||
|
||||
void DistanceMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void DistanceMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inKey[4];
|
||||
float inImage[4];
|
||||
@@ -55,8 +55,8 @@ void DistanceMatteOperation::executePixel(float *outputValue, float x, float y,
|
||||
float distance;
|
||||
float alpha;
|
||||
|
||||
this->m_inputKeyProgram->read(inKey, x, y, sampler, inputBuffers);
|
||||
this->m_inputImageProgram->read(inImage, x, y, sampler, inputBuffers);
|
||||
this->m_inputKeyProgram->read(inKey, x, y, sampler);
|
||||
this->m_inputImageProgram->read(inImage, x, y, sampler);
|
||||
|
||||
distance = sqrt(pow((inKey[0] - inImage[0]), 2) +
|
||||
pow((inKey[1] - inImage[1]), 2) +
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -45,11 +45,11 @@ void DotproductOperation::deinitExecution()
|
||||
|
||||
/** @todo: current implementation is the inverse of a dotproduct. not 'logically' correct
|
||||
*/
|
||||
void DotproductOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void DotproductOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float input1[4];
|
||||
float input2[4];
|
||||
this->m_input1Operation->read(input1, x, y, sampler, inputBuffers);
|
||||
this->m_input2Operation->read(input2, x, y, sampler, inputBuffers);
|
||||
this->m_input1Operation->read(input1, x, y, sampler);
|
||||
this->m_input2Operation->read(input2, x, y, sampler);
|
||||
color[0] = -(input1[0] * input2[0] + input1[1] * input2[1] + input1[2] * input2[2]);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ private:
|
||||
SocketReader *m_input2Operation;
|
||||
public:
|
||||
DotproductOperation();
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -1260,15 +1260,15 @@ void DoubleEdgeMaskOperation::initExecution()
|
||||
this->m_cachedInstance = NULL;
|
||||
}
|
||||
|
||||
void *DoubleEdgeMaskOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *DoubleEdgeMaskOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
if (this->m_cachedInstance)
|
||||
return this->m_cachedInstance;
|
||||
|
||||
lockMutex();
|
||||
if (this->m_cachedInstance == NULL) {
|
||||
MemoryBuffer *innerMask = (MemoryBuffer *)this->m_inputInnerMask->initializeTileData(rect, memoryBuffers);
|
||||
MemoryBuffer *outerMask = (MemoryBuffer *)this->m_inputOuterMask->initializeTileData(rect, memoryBuffers);
|
||||
MemoryBuffer *innerMask = (MemoryBuffer *)this->m_inputInnerMask->initializeTileData(rect);
|
||||
MemoryBuffer *outerMask = (MemoryBuffer *)this->m_inputOuterMask->initializeTileData(rect);
|
||||
float *data = new float[this->getWidth() * this->getHeight()];
|
||||
float *imask = innerMask->convertToValueBuffer();
|
||||
float *omask = outerMask->convertToValueBuffer();
|
||||
@@ -1280,7 +1280,7 @@ void *DoubleEdgeMaskOperation::initializeTileData(rcti *rect, MemoryBuffer **mem
|
||||
unlockMutex();
|
||||
return this->m_cachedInstance;
|
||||
}
|
||||
void DoubleEdgeMaskOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void DoubleEdgeMaskOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
float *buffer = (float *) data;
|
||||
int index = (y * this->getWidth() + x);
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
*/
|
||||
void deinitExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ void EllipseMaskOperation::initExecution()
|
||||
this->m_aspectRatio = ((float)this->getWidth()) / this->getHeight();
|
||||
}
|
||||
|
||||
void EllipseMaskOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void EllipseMaskOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputMask[4];
|
||||
float inputValue[4];
|
||||
@@ -57,8 +57,8 @@ void EllipseMaskOperation::executePixel(float *color, float x, float y, PixelSam
|
||||
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, inputBuffers);
|
||||
this->m_inputValue->read(inputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputMask->read(inputMask, x, y, sampler);
|
||||
this->m_inputValue->read(inputValue, x, y, sampler);
|
||||
|
||||
const float halfHeight = (this->m_data->height) / 2.0f;
|
||||
const float halfWidth = this->m_data->width / 2.0f;
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -31,7 +31,7 @@ FastGaussianBlurOperation::FastGaussianBlurOperation() : BlurBaseOperation(COM_D
|
||||
this->m_iirgaus = NULL;
|
||||
}
|
||||
|
||||
void FastGaussianBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void FastGaussianBlurOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
MemoryBuffer *newData = (MemoryBuffer *)data;
|
||||
newData->read(color, x, y);
|
||||
@@ -79,13 +79,13 @@ void FastGaussianBlurOperation::deinitExecution()
|
||||
BlurBaseOperation::deinitMutex();
|
||||
}
|
||||
|
||||
void *FastGaussianBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *FastGaussianBlurOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
lockMutex();
|
||||
if (!this->m_iirgaus) {
|
||||
MemoryBuffer *newBuf = (MemoryBuffer *)this->m_inputProgram->initializeTileData(rect, memoryBuffers);
|
||||
MemoryBuffer *newBuf = (MemoryBuffer *)this->m_inputProgram->initializeTileData(rect);
|
||||
MemoryBuffer *copy = newBuf->duplicate();
|
||||
updateSize(memoryBuffers);
|
||||
updateSize();
|
||||
|
||||
int c;
|
||||
this->m_sx = this->m_data->sizex * this->m_size / 2.0f;
|
||||
@@ -233,7 +233,7 @@ FastGaussianBlurValueOperation::FastGaussianBlurValueOperation() : NodeOperation
|
||||
setComplex(true);
|
||||
}
|
||||
|
||||
void FastGaussianBlurValueOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void FastGaussianBlurValueOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
MemoryBuffer *newData = (MemoryBuffer *)data;
|
||||
newData->read(color, x, y);
|
||||
@@ -270,11 +270,11 @@ void FastGaussianBlurValueOperation::deinitExecution()
|
||||
deinitMutex();
|
||||
}
|
||||
|
||||
void *FastGaussianBlurValueOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *FastGaussianBlurValueOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
lockMutex();
|
||||
if (!this->m_iirgaus) {
|
||||
MemoryBuffer *newBuf = (MemoryBuffer *)this->m_inputprogram->initializeTileData(rect, memoryBuffers);
|
||||
MemoryBuffer *newBuf = (MemoryBuffer *)this->m_inputprogram->initializeTileData(rect);
|
||||
MemoryBuffer *copy = newBuf->duplicate();
|
||||
FastGaussianBlurOperation::IIR_gauss(copy, this->m_sigma, 0, 3);
|
||||
this->m_iirgaus = copy;
|
||||
|
||||
@@ -34,10 +34,10 @@ private:
|
||||
public:
|
||||
FastGaussianBlurOperation();
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
static void IIR_gauss(MemoryBuffer *src, float sigma, unsigned int channel, unsigned int xy);
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
void deinitExecution();
|
||||
void initExecution();
|
||||
};
|
||||
@@ -50,9 +50,9 @@ private:
|
||||
public:
|
||||
FastGaussianBlurValueOperation();
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
void deinitExecution();
|
||||
void initExecution();
|
||||
void setSigma(float sigma) { this->m_sigma = sigma; }
|
||||
|
||||
@@ -42,12 +42,12 @@ void FlipOperation::deinitExecution()
|
||||
}
|
||||
|
||||
|
||||
void FlipOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void FlipOperation::executePixel(float *color, 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(color, nx, ny, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(color, nx, ny, sampler);
|
||||
}
|
||||
|
||||
bool FlipOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
|
||||
|
||||
@@ -33,7 +33,7 @@ private:
|
||||
public:
|
||||
FlipOperation();
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -34,10 +34,10 @@ void GammaCorrectOperation::initExecution()
|
||||
this->m_inputProgram = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void GammaCorrectOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void GammaCorrectOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor[4];
|
||||
this->m_inputProgram->read(inputColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputProgram->read(inputColor, x, y, sampler);
|
||||
if (inputColor[3] > 0.0f) {
|
||||
inputColor[0] /= inputColor[3];
|
||||
inputColor[1] /= inputColor[3];
|
||||
@@ -75,10 +75,10 @@ void GammaUncorrectOperation::initExecution()
|
||||
this->m_inputProgram = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void GammaUncorrectOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void GammaUncorrectOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor[4];
|
||||
this->m_inputProgram->read(inputColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputProgram->read(inputColor, x, y, sampler);
|
||||
|
||||
if (inputColor[3] > 0.0f) {
|
||||
inputColor[0] /= inputColor[3];
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -37,13 +37,13 @@ void GammaOperation::initExecution()
|
||||
this->m_inputGammaProgram = this->getInputSocketReader(1);
|
||||
}
|
||||
|
||||
void GammaOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void GammaOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue[4];
|
||||
float inputGamma[4];
|
||||
|
||||
this->m_inputProgram->read(inputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputGammaProgram->read(inputGamma, x, y, sampler, inputBuffers);
|
||||
this->m_inputProgram->read(inputValue, x, y, sampler);
|
||||
this->m_inputGammaProgram->read(inputGamma, x, y, sampler);
|
||||
const float gamma = inputGamma[0];
|
||||
/* check for negative to avoid nan's */
|
||||
color[0] = inputValue[0] > 0.0f ? powf(inputValue[0], gamma) : inputValue[0];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -34,13 +34,13 @@ GaussianAlphaXBlurOperation::GaussianAlphaXBlurOperation() : BlurBaseOperation(C
|
||||
this->m_rad = 0;
|
||||
}
|
||||
|
||||
void *GaussianAlphaXBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *GaussianAlphaXBlurOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
lockMutex();
|
||||
if (!this->m_sizeavailable) {
|
||||
updateGauss(memoryBuffers);
|
||||
updateGauss();
|
||||
}
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL, memoryBuffers);
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL);
|
||||
unlockMutex();
|
||||
return buffer;
|
||||
}
|
||||
@@ -62,10 +62,10 @@ void GaussianAlphaXBlurOperation::initExecution()
|
||||
}
|
||||
}
|
||||
|
||||
void GaussianAlphaXBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
|
||||
void GaussianAlphaXBlurOperation::updateGauss()
|
||||
{
|
||||
if (this->m_gausstab == NULL) {
|
||||
updateSize(memoryBuffers);
|
||||
updateSize();
|
||||
float rad = this->m_size * this->m_data->sizex;
|
||||
if (rad < 1)
|
||||
rad = 1;
|
||||
@@ -75,7 +75,7 @@ void GaussianAlphaXBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
|
||||
}
|
||||
|
||||
if (this->m_distbuf_inv == NULL) {
|
||||
updateSize(memoryBuffers);
|
||||
updateSize();
|
||||
float rad = this->m_size * this->m_data->sizex;
|
||||
if (rad < 1)
|
||||
rad = 1;
|
||||
@@ -90,7 +90,7 @@ BLI_INLINE float finv_test(const float f, const bool test)
|
||||
return (LIKELY(test == false)) ? f : 1.0f - f;
|
||||
}
|
||||
|
||||
void GaussianAlphaXBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void GaussianAlphaXBlurOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
const bool do_invert = this->m_do_subtract;
|
||||
MemoryBuffer *inputBuffer = (MemoryBuffer *)data;
|
||||
|
||||
@@ -33,14 +33,14 @@ private:
|
||||
int m_falloff; /* falloff for distbuf_inv */
|
||||
bool m_do_subtract;
|
||||
int m_rad;
|
||||
void updateGauss(MemoryBuffer **memoryBuffers);
|
||||
void updateGauss();
|
||||
public:
|
||||
GaussianAlphaXBlurOperation();
|
||||
|
||||
/**
|
||||
* @brief the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* @brief initialize the execution
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
*/
|
||||
void deinitExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,13 +34,13 @@ GaussianAlphaYBlurOperation::GaussianAlphaYBlurOperation() : BlurBaseOperation(C
|
||||
this->m_rad = 0;
|
||||
}
|
||||
|
||||
void *GaussianAlphaYBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *GaussianAlphaYBlurOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
lockMutex();
|
||||
if (!this->m_sizeavailable) {
|
||||
updateGauss(memoryBuffers);
|
||||
updateGauss();
|
||||
}
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL, memoryBuffers);
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL);
|
||||
unlockMutex();
|
||||
return buffer;
|
||||
}
|
||||
@@ -62,10 +62,10 @@ void GaussianAlphaYBlurOperation::initExecution()
|
||||
}
|
||||
}
|
||||
|
||||
void GaussianAlphaYBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
|
||||
void GaussianAlphaYBlurOperation::updateGauss()
|
||||
{
|
||||
if (this->m_gausstab == NULL) {
|
||||
updateSize(memoryBuffers);
|
||||
updateSize();
|
||||
float rad = this->m_size * this->m_data->sizey;
|
||||
if (rad < 1)
|
||||
rad = 1;
|
||||
@@ -75,7 +75,7 @@ void GaussianAlphaYBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
|
||||
}
|
||||
|
||||
if (this->m_distbuf_inv == NULL) {
|
||||
updateSize(memoryBuffers);
|
||||
updateSize();
|
||||
float rad = this->m_size * this->m_data->sizex;
|
||||
if (rad < 1)
|
||||
rad = 1;
|
||||
@@ -90,7 +90,7 @@ BLI_INLINE float finv_test(const float f, const bool test)
|
||||
return (LIKELY(test == false)) ? f : 1.0f - f;
|
||||
}
|
||||
|
||||
void GaussianAlphaYBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void GaussianAlphaYBlurOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
const bool do_invert = this->m_do_subtract;
|
||||
MemoryBuffer *inputBuffer = (MemoryBuffer *)data;
|
||||
|
||||
@@ -33,14 +33,14 @@ private:
|
||||
bool m_do_subtract;
|
||||
int m_falloff;
|
||||
int m_rad;
|
||||
void updateGauss(MemoryBuffer **memoryBuffers);
|
||||
void updateGauss();
|
||||
public:
|
||||
GaussianAlphaYBlurOperation();
|
||||
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* @brief initialize the execution
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
*/
|
||||
void deinitExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,13 +32,13 @@ GaussianBokehBlurOperation::GaussianBokehBlurOperation() : BlurBaseOperation(COM
|
||||
this->m_gausstab = NULL;
|
||||
}
|
||||
|
||||
void *GaussianBokehBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *GaussianBokehBlurOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
lockMutex();
|
||||
if (!this->m_sizeavailable) {
|
||||
updateGauss(memoryBuffers);
|
||||
updateGauss();
|
||||
}
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL, memoryBuffers);
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL);
|
||||
unlockMutex();
|
||||
return buffer;
|
||||
}
|
||||
@@ -50,11 +50,11 @@ void GaussianBokehBlurOperation::initExecution()
|
||||
initMutex();
|
||||
|
||||
if (this->m_sizeavailable) {
|
||||
updateGauss(NULL);
|
||||
updateGauss();
|
||||
}
|
||||
}
|
||||
|
||||
void GaussianBokehBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
|
||||
void GaussianBokehBlurOperation::updateGauss()
|
||||
{
|
||||
if (this->m_gausstab == NULL) {
|
||||
float radxf;
|
||||
@@ -67,7 +67,7 @@ void GaussianBokehBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
|
||||
const float width = this->getWidth();
|
||||
const float height = this->getHeight();
|
||||
if (!this->m_sizeavailable) {
|
||||
updateSize(memoryBuffers);
|
||||
updateSize();
|
||||
}
|
||||
radxf = this->m_size * (float)this->m_data->sizex;
|
||||
if (radxf > width / 2.0f)
|
||||
@@ -112,7 +112,7 @@ void GaussianBokehBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
|
||||
}
|
||||
}
|
||||
|
||||
void GaussianBokehBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void GaussianBokehBlurOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
float tempColor[4];
|
||||
tempColor[0] = 0;
|
||||
@@ -138,8 +138,10 @@ void GaussianBokehBlurOperation::executePixel(float *color, int x, int y, Memory
|
||||
int index;
|
||||
int step = QualityStepHelper::getStep();
|
||||
int offsetadd = QualityStepHelper::getOffsetAdd();
|
||||
const int addConst = (minx - x + this->m_radx);
|
||||
const int mulConst = (this->m_radx * 2 + 1);
|
||||
for (int ny = miny; ny < maxy; ny += step) {
|
||||
index = ((ny - y) + this->m_rady) * (this->m_radx * 2 + 1) + (minx - x + this->m_radx);
|
||||
index = ((ny - y) + this->m_rady) * mulConst + addConst;
|
||||
int bufferindex = ((minx - bufferstartx) * 4) + ((ny - bufferstarty) * 4 * bufferwidth);
|
||||
for (int nx = minx; nx < maxx; nx += step) {
|
||||
const float multiplier = this->m_gausstab[index];
|
||||
@@ -207,9 +209,9 @@ GaussianBokehBlurReferenceOperation::GaussianBokehBlurReferenceOperation() : Nod
|
||||
this->m_inputSize = NULL;
|
||||
}
|
||||
|
||||
void *GaussianBokehBlurReferenceOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *GaussianBokehBlurReferenceOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL, memoryBuffers);
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@@ -263,7 +265,7 @@ void GaussianBokehBlurReferenceOperation::updateGauss()
|
||||
this->m_gausstab = ddgauss;
|
||||
}
|
||||
|
||||
void GaussianBokehBlurReferenceOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void GaussianBokehBlurReferenceOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
float tempColor[4];
|
||||
float tempSize[4];
|
||||
@@ -277,14 +279,14 @@ void GaussianBokehBlurReferenceOperation::executePixel(float *color, int x, int
|
||||
int bufferwidth = inputBuffer->getWidth();
|
||||
int bufferstartx = inputBuffer->getRect()->xmin;
|
||||
int bufferstarty = inputBuffer->getRect()->ymin;
|
||||
this->m_inputSize->read(tempSize, x, y, inputBuffers, data);
|
||||
this->m_inputSize->read(tempSize, x, y, data);
|
||||
float size = tempSize[0];
|
||||
CLAMP(size, 0.0f, 1.0f);
|
||||
float sizeX = ceil(this->m_data->sizex * size);
|
||||
float sizeY = ceil(this->m_data->sizey * size);
|
||||
|
||||
if (sizeX <= 0.5f && sizeY <= 0.5f) {
|
||||
this->m_inputImage->read(color, x, y, inputBuffers, data);
|
||||
this->m_inputImage->read(color, x, y, data);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,16 +30,16 @@ class GaussianBokehBlurOperation : public BlurBaseOperation {
|
||||
private:
|
||||
float *m_gausstab;
|
||||
int m_radx, m_rady;
|
||||
void updateGauss(MemoryBuffer **memoryBuffers);
|
||||
void updateGauss();
|
||||
|
||||
public:
|
||||
GaussianBokehBlurOperation();
|
||||
void initExecution();
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
@@ -66,11 +66,11 @@ private:
|
||||
public:
|
||||
GaussianBokehBlurReferenceOperation();
|
||||
void initExecution();
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
|
||||
@@ -33,13 +33,13 @@ GaussianXBlurOperation::GaussianXBlurOperation() : BlurBaseOperation(COM_DT_COLO
|
||||
this->m_rad = 0;
|
||||
}
|
||||
|
||||
void *GaussianXBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *GaussianXBlurOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
lockMutex();
|
||||
if (!this->m_sizeavailable) {
|
||||
updateGauss(memoryBuffers);
|
||||
updateGauss();
|
||||
}
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL, memoryBuffers);
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL);
|
||||
unlockMutex();
|
||||
return buffer;
|
||||
}
|
||||
@@ -60,10 +60,10 @@ void GaussianXBlurOperation::initExecution()
|
||||
}
|
||||
}
|
||||
|
||||
void GaussianXBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
|
||||
void GaussianXBlurOperation::updateGauss()
|
||||
{
|
||||
if (this->m_gausstab == NULL) {
|
||||
updateSize(memoryBuffers);
|
||||
updateSize();
|
||||
float rad = this->m_size * this->m_data->sizex;
|
||||
if (rad < 1)
|
||||
rad = 1;
|
||||
@@ -73,7 +73,7 @@ void GaussianXBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
|
||||
}
|
||||
}
|
||||
|
||||
void GaussianXBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void GaussianXBlurOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
float color_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
float multiplier_accum = 0.0f;
|
||||
@@ -92,12 +92,10 @@ void GaussianXBlurOperation::executePixel(float *color, int x, int y, MemoryBuff
|
||||
maxy = min(maxy, inputBuffer->getRect()->ymax);
|
||||
maxx = min(maxx, inputBuffer->getRect()->xmax);
|
||||
|
||||
int index;
|
||||
int step = getStep();
|
||||
int offsetadd = getOffsetAdd();
|
||||
int bufferindex = ((minx - bufferstartx) * 4) + ((miny - bufferstarty) * 4 * bufferwidth);
|
||||
for (int nx = minx; nx < maxx; nx += step) {
|
||||
index = (nx - x) + this->m_rad;
|
||||
for (int nx = minx, index = (minx - x) + this->m_rad; nx < maxx; nx += step, index += step) {
|
||||
const float multiplier = this->m_gausstab[index];
|
||||
madd_v4_v4fl(color_accum, &buffer[bufferindex], multiplier);
|
||||
multiplier_accum += multiplier;
|
||||
|
||||
@@ -29,14 +29,14 @@ class GaussianXBlurOperation : public BlurBaseOperation {
|
||||
private:
|
||||
float *m_gausstab;
|
||||
int m_rad;
|
||||
void updateGauss(MemoryBuffer **memoryBuffers);
|
||||
void updateGauss();
|
||||
public:
|
||||
GaussianXBlurOperation();
|
||||
|
||||
/**
|
||||
* @brief the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* @brief initialize the execution
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
*/
|
||||
void deinitExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -33,13 +33,13 @@ GaussianYBlurOperation::GaussianYBlurOperation() : BlurBaseOperation(COM_DT_COLO
|
||||
this->m_rad = 0;
|
||||
}
|
||||
|
||||
void *GaussianYBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *GaussianYBlurOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
lockMutex();
|
||||
if (!this->m_sizeavailable) {
|
||||
updateGauss(memoryBuffers);
|
||||
updateGauss();
|
||||
}
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL, memoryBuffers);
|
||||
void *buffer = getInputOperation(0)->initializeTileData(NULL);
|
||||
unlockMutex();
|
||||
return buffer;
|
||||
}
|
||||
@@ -60,10 +60,10 @@ void GaussianYBlurOperation::initExecution()
|
||||
}
|
||||
}
|
||||
|
||||
void GaussianYBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
|
||||
void GaussianYBlurOperation::updateGauss()
|
||||
{
|
||||
if (this->m_gausstab == NULL) {
|
||||
updateSize(memoryBuffers);
|
||||
updateSize();
|
||||
float rad = this->m_size * this->m_data->sizey;
|
||||
if (rad < 1)
|
||||
rad = 1;
|
||||
@@ -73,7 +73,7 @@ void GaussianYBlurOperation::updateGauss(MemoryBuffer **memoryBuffers)
|
||||
}
|
||||
}
|
||||
|
||||
void GaussianYBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void GaussianYBlurOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
float color_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
float multiplier_accum = 0.0f;
|
||||
@@ -94,9 +94,10 @@ void GaussianYBlurOperation::executePixel(float *color, int x, int y, MemoryBuff
|
||||
|
||||
int index;
|
||||
int step = getStep();
|
||||
const int bufferIndexx = ((minx - bufferstartx) * 4) ;
|
||||
for (int ny = miny; ny < maxy; ny += step) {
|
||||
index = (ny - y) + this->m_rad;
|
||||
int bufferindex = ((minx - bufferstartx) * 4) + ((ny - bufferstarty) * 4 * bufferwidth);
|
||||
int bufferindex = bufferIndexx + ((ny - bufferstarty) * 4 * bufferwidth);
|
||||
const float multiplier = this->m_gausstab[index];
|
||||
madd_v4_v4fl(color_accum, &buffer[bufferindex], multiplier);
|
||||
multiplier_accum += multiplier;
|
||||
|
||||
@@ -29,14 +29,14 @@ class GaussianYBlurOperation : public BlurBaseOperation {
|
||||
private:
|
||||
float *m_gausstab;
|
||||
int m_rad;
|
||||
void updateGauss(MemoryBuffer **memoryBuffers);
|
||||
void updateGauss();
|
||||
public:
|
||||
GaussianYBlurOperation();
|
||||
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* @brief initialize the execution
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
*/
|
||||
void deinitExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -41,9 +41,9 @@ void GlareBaseOperation::deinitExecution()
|
||||
SingleThreadedNodeOperation::deinitExecution();
|
||||
}
|
||||
|
||||
MemoryBuffer *GlareBaseOperation::createMemoryBuffer(rcti *rect2, MemoryBuffer **memoryBuffers)
|
||||
MemoryBuffer *GlareBaseOperation::createMemoryBuffer(rcti *rect2)
|
||||
{
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_inputProgram->initializeTileData(rect2, memoryBuffers);
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_inputProgram->initializeTileData(rect2);
|
||||
rcti rect;
|
||||
rect.xmin = 0;
|
||||
rect.ymin = 0;
|
||||
|
||||
@@ -68,7 +68,7 @@ protected:
|
||||
|
||||
virtual void generateGlare(float *data, MemoryBuffer *inputTile, NodeGlare *settings) = 0;
|
||||
|
||||
MemoryBuffer *createMemoryBuffer(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
MemoryBuffer *createMemoryBuffer(rcti *rect);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -42,11 +42,11 @@ void GlareThresholdOperation::initExecution()
|
||||
this->m_inputProgram = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void GlareThresholdOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void GlareThresholdOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
const float threshold = this->m_settings->threshold;
|
||||
|
||||
this->m_inputProgram->read(color, x, y, sampler, inputBuffers);
|
||||
this->m_inputProgram->read(color, x, y, sampler);
|
||||
if (rgb_to_luma_y(color) >= threshold) {
|
||||
color[0] -= threshold, color[1] -= threshold, color[2] -= threshold;
|
||||
color[0] = MAX2(color[0], 0.0f);
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -45,11 +45,11 @@ void HueSaturationValueCorrectOperation::initExecution()
|
||||
this->m_inputProgram = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void HueSaturationValueCorrectOperation::executePixel(float *output, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void HueSaturationValueCorrectOperation::executePixel(float *output, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float hsv[4], f;
|
||||
|
||||
this->m_inputProgram->read(hsv, x, y, sampler, inputBuffers);
|
||||
this->m_inputProgram->read(hsv, x, y, sampler);
|
||||
|
||||
/* adjust hue, scaling returned default 0.5 up to 1 */
|
||||
f = curvemapping_evaluateF(this->m_curveMapping, 0, hsv[0]);
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *Vector, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *Vector, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -33,11 +33,11 @@ void IDMaskOperation::initExecution()
|
||||
this->m_inputProgram = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void IDMaskOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void IDMaskOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue[4];
|
||||
|
||||
this->m_inputProgram->read(inputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputProgram->read(inputValue, x, y, sampler);
|
||||
const float a = (inputValue[0] == this->m_objectIndex) ? 1.0f : 0.0f;
|
||||
color[0] = a;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -108,7 +108,7 @@ void BaseImageOperation::determineResolution(unsigned int resolution[], unsigned
|
||||
}
|
||||
}
|
||||
|
||||
void ImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
if (this->m_imageBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
|
||||
zero_v4(color);
|
||||
@@ -128,7 +128,7 @@ void ImageOperation::executePixel(float *color, float x, float y, PixelSampler s
|
||||
}
|
||||
}
|
||||
|
||||
void ImageAlphaOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ImageAlphaOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float tempcolor[4];
|
||||
|
||||
@@ -152,7 +152,7 @@ void ImageAlphaOperation::executePixel(float *color, float x, float y, PixelSamp
|
||||
}
|
||||
}
|
||||
|
||||
void ImageDepthOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ImageDepthOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
if (this->m_depthBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
|
||||
color[0] = 0.0f;
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
* Constructor
|
||||
*/
|
||||
ImageOperation();
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class ImageAlphaOperation : public BaseImageOperation {
|
||||
public:
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
* Constructor
|
||||
*/
|
||||
ImageAlphaOperation();
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class ImageDepthOperation : public BaseImageOperation {
|
||||
public:
|
||||
@@ -89,6 +89,6 @@ public:
|
||||
* Constructor
|
||||
*/
|
||||
ImageDepthOperation();
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -39,12 +39,12 @@ void InvertOperation::initExecution()
|
||||
this->m_inputColorProgram = this->getInputSocketReader(1);
|
||||
}
|
||||
|
||||
void InvertOperation::executePixel(float *out, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void InvertOperation::executePixel(float *out, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue[4];
|
||||
float inputColor[4];
|
||||
this->m_inputValueProgram->read(inputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputColorProgram->read(inputColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputValueProgram->read(inputValue, x, y, sampler);
|
||||
this->m_inputColorProgram->read(inputColor, x, y, sampler);
|
||||
|
||||
const float value = inputValue[0];
|
||||
const float invertedValue = 1.0f - value;
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -39,14 +39,14 @@ KeyingBlurOperation::KeyingBlurOperation() : NodeOperation()
|
||||
this->setComplex(true);
|
||||
}
|
||||
|
||||
void *KeyingBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *KeyingBlurOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
void *buffer = getInputOperation(0)->initializeTileData(rect, memoryBuffers);
|
||||
void *buffer = getInputOperation(0)->initializeTileData(rect);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void KeyingBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void KeyingBlurOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
MemoryBuffer *inputBuffer = (MemoryBuffer *)data;
|
||||
float *buffer = inputBuffer->getBuffer();
|
||||
|
||||
@@ -45,9 +45,9 @@ public:
|
||||
void setSize(int value) {this->m_size = value;}
|
||||
void setAxis(int value) {this->m_axis = value;}
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
};
|
||||
|
||||
@@ -44,14 +44,14 @@ KeyingClipOperation::KeyingClipOperation() : NodeOperation()
|
||||
this->setComplex(true);
|
||||
}
|
||||
|
||||
void *KeyingClipOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *KeyingClipOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
void *buffer = getInputOperation(0)->initializeTileData(rect, memoryBuffers);
|
||||
void *buffer = getInputOperation(0)->initializeTileData(rect);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void KeyingClipOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void KeyingClipOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
const int delta = this->m_kernelRadius;
|
||||
const float tolerance = this->m_kernelTolerance;
|
||||
|
||||
@@ -49,9 +49,9 @@ public:
|
||||
|
||||
void setIsEdgeMatte(bool value) {this->m_isEdgeMatte = value;}
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
};
|
||||
|
||||
@@ -65,13 +65,13 @@ void KeyingDespillOperation::deinitExecution()
|
||||
this->m_screenReader = NULL;
|
||||
}
|
||||
|
||||
void KeyingDespillOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void KeyingDespillOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float pixelColor[4];
|
||||
float screenColor[4];
|
||||
|
||||
this->m_pixelReader->read(pixelColor, x, y, sampler, inputBuffers);
|
||||
this->m_screenReader->read(screenColor, x, y, sampler, inputBuffers);
|
||||
this->m_pixelReader->read(pixelColor, x, y, sampler);
|
||||
this->m_screenReader->read(screenColor, x, y, sampler);
|
||||
|
||||
int screen_primary_channel = get_pixel_primary_channel(screenColor);
|
||||
int other_1 = (screen_primary_channel + 1) % 3;
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
void setDespillFactor(float value) {this->m_despillFactor = value;}
|
||||
void setColorBalance(float value) {this->m_colorBalance = value;}
|
||||
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -85,17 +85,17 @@ void KeyingOperation::deinitExecution()
|
||||
this->m_coreReader = NULL;
|
||||
}
|
||||
|
||||
void KeyingOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void KeyingOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float pixelColor[4];
|
||||
float screenColor[4];
|
||||
float garbageValue[4];
|
||||
float coreValue[4];
|
||||
|
||||
this->m_pixelReader->read(pixelColor, x, y, sampler, inputBuffers);
|
||||
this->m_screenReader->read(screenColor, x, y, sampler, inputBuffers);
|
||||
this->m_garbageReader->read(garbageValue, x, y, sampler, inputBuffers);
|
||||
this->m_coreReader->read(coreValue, x, y, sampler, inputBuffers);
|
||||
this->m_pixelReader->read(pixelColor, x, y, sampler);
|
||||
this->m_screenReader->read(screenColor, x, y, sampler);
|
||||
this->m_garbageReader->read(garbageValue, x, y, sampler);
|
||||
this->m_coreReader->read(coreValue, x, y, sampler);
|
||||
|
||||
int primary_channel = get_pixel_primary_channel(screenColor);
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
void setScreenBalance(float value) {this->m_screenBalance = value;}
|
||||
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -217,7 +217,7 @@ KeyingScreenOperation::TriangulationData *KeyingScreenOperation::buildVoronoiTri
|
||||
return triangulation;
|
||||
}
|
||||
|
||||
void *KeyingScreenOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *KeyingScreenOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
TileData *tile_data;
|
||||
TriangulationData *triangulation;
|
||||
@@ -272,7 +272,7 @@ void *KeyingScreenOperation::initializeTileData(rcti *rect, MemoryBuffer **memor
|
||||
return tile_data;
|
||||
}
|
||||
|
||||
void KeyingScreenOperation::deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data)
|
||||
void KeyingScreenOperation::deinitializeTileData(rcti *rect, void *data)
|
||||
{
|
||||
TileData *tile_data = (TileData *) data;
|
||||
|
||||
@@ -301,7 +301,7 @@ void KeyingScreenOperation::determineResolution(unsigned int resolution[], unsig
|
||||
}
|
||||
}
|
||||
|
||||
void KeyingScreenOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void KeyingScreenOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
color[0] = 0.0f;
|
||||
color[1] = 0.0f;
|
||||
|
||||
@@ -73,14 +73,14 @@ public:
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data);
|
||||
void *initializeTileData(rcti *rect);
|
||||
void deinitializeTileData(rcti *rect, void *data);
|
||||
|
||||
void setMovieClip(MovieClip *clip) {this->m_movieClip = clip;}
|
||||
void setTrackingObject(const char *object) {strncpy(this->m_trackingObject, object, sizeof(this->m_trackingObject));}
|
||||
void setFramenumber(int framenumber) {this->m_framenumber = framenumber;}
|
||||
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -40,7 +40,7 @@ void LuminanceMatteOperation::deinitExecution()
|
||||
this->m_inputImageProgram = NULL;
|
||||
}
|
||||
|
||||
void LuminanceMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void LuminanceMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inColor[4];
|
||||
|
||||
@@ -49,7 +49,7 @@ void LuminanceMatteOperation::executePixel(float *outputValue, float x, float y,
|
||||
|
||||
float alpha;
|
||||
|
||||
this->m_inputImageProgram->read(inColor, x, y, sampler, inputBuffers);
|
||||
this->m_inputImageProgram->read(inColor, x, y, sampler);
|
||||
|
||||
/* one line thread-friend algorithm:
|
||||
* outputValue[0] = max(inputValue[3], min(high, max(low, ((inColor[0]-low)/(high-low))))
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -40,7 +40,7 @@ void MapUVOperation::initExecution()
|
||||
this->m_inputUVProgram = this->getInputSocketReader(1);
|
||||
}
|
||||
|
||||
void MapUVOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MapUVOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputUV[4];
|
||||
float uv_a[4], uv_b[4];
|
||||
@@ -50,30 +50,30 @@ void MapUVOperation::executePixel(float *color, float x, float y, PixelSampler s
|
||||
float uv_l, uv_r;
|
||||
float uv_u, uv_d;
|
||||
|
||||
this->m_inputUVProgram->read(inputUV, x, y, sampler, inputBuffers);
|
||||
this->m_inputUVProgram->read(inputUV, x, y, sampler);
|
||||
if (inputUV[2] == 0.f) {
|
||||
zero_v4(color);
|
||||
return;
|
||||
}
|
||||
/* adaptive sampling, red (U) channel */
|
||||
this->m_inputUVProgram->read(uv_a, x - 1, y, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputUVProgram->read(uv_b, x + 1, y, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputUVProgram->read(uv_a, x - 1, y, COM_PS_NEAREST);
|
||||
this->m_inputUVProgram->read(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, inputBuffers);
|
||||
this->m_inputUVProgram->read(uv_b, x, y + 1, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputUVProgram->read(uv_a, x, y - 1, COM_PS_NEAREST);
|
||||
this->m_inputUVProgram->read(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;
|
||||
|
||||
dy = 0.5f * (uv_u + uv_d);
|
||||
|
||||
/* more adaptive sampling, red and green (UV) channels */
|
||||
this->m_inputUVProgram->read(uv_a, x - 1, y - 1, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputUVProgram->read(uv_b, x - 1, y + 1, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputUVProgram->read(uv_a, x - 1, y - 1, COM_PS_NEAREST);
|
||||
this->m_inputUVProgram->read(uv_b, x - 1, y + 1, 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;
|
||||
uv_u = uv_a[2] != 0.f ? fabsf(inputUV[1] - uv_a[1]) : 0.f;
|
||||
@@ -82,8 +82,8 @@ void MapUVOperation::executePixel(float *color, float x, float y, PixelSampler s
|
||||
dx += 0.25f * (uv_l + uv_r);
|
||||
dy += 0.25f * (uv_u + uv_d);
|
||||
|
||||
this->m_inputUVProgram->read(uv_a, x + 1, y - 1, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputUVProgram->read(uv_b, x + 1, y + 1, COM_PS_NEAREST, inputBuffers);
|
||||
this->m_inputUVProgram->read(uv_a, x + 1, y - 1, COM_PS_NEAREST);
|
||||
this->m_inputUVProgram->read(uv_b, x + 1, y + 1, 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;
|
||||
uv_u = uv_a[2] != 0.f ? fabsf(inputUV[1] - uv_a[1]) : 0.f;
|
||||
@@ -107,7 +107,7 @@ void MapUVOperation::executePixel(float *color, float x, float y, PixelSampler s
|
||||
u = inputUV[0] * this->m_inputColorProgram->getWidth();
|
||||
v = inputUV[1] * this->m_inputColorProgram->getHeight();
|
||||
|
||||
this->m_inputColorProgram->read(color, u, v, dx, dy, inputBuffers);
|
||||
this->m_inputColorProgram->read(color, u, v, dx, dy);
|
||||
|
||||
/* "premul" */
|
||||
if (alpha < 1.0f) {
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -34,10 +34,10 @@ void MapValueOperation::initExecution()
|
||||
this->m_inputOperation = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void MapValueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MapValueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float src[4];
|
||||
this->m_inputOperation->read(src, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(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)
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -70,7 +70,7 @@ void MaskOperation::deinitExecution()
|
||||
}
|
||||
}
|
||||
|
||||
void *MaskOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *MaskOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
if (this->m_rasterizedMask)
|
||||
return this->m_rasterizedMask;
|
||||
@@ -117,7 +117,7 @@ void MaskOperation::determineResolution(unsigned int resolution[], unsigned int
|
||||
}
|
||||
}
|
||||
|
||||
void MaskOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void MaskOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
if (!data) {
|
||||
color[0] = 0.0f;
|
||||
@@ -147,13 +147,15 @@ void MaskOperation::initExecution()
|
||||
{
|
||||
initMutex();
|
||||
|
||||
if (this->m_rasterMaskHandle == NULL) {
|
||||
const int width = this->getWidth();
|
||||
const int height = this->getHeight();
|
||||
if (this->m_mask) {
|
||||
if (this->m_rasterMaskHandle == NULL) {
|
||||
const int width = this->getWidth();
|
||||
const int height = this->getHeight();
|
||||
|
||||
this->m_rasterMaskHandle = BLI_maskrasterize_handle_new();
|
||||
this->m_rasterMaskHandle = BLI_maskrasterize_handle_new();
|
||||
|
||||
BLI_maskrasterize_handle_init(this->m_rasterMaskHandle, this->m_mask, width, height, TRUE, this->m_do_smooth, this->m_do_feather);
|
||||
BLI_maskrasterize_handle_init(this->m_rasterMaskHandle, this->m_mask, width, height, TRUE, this->m_do_smooth, this->m_do_feather);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +169,7 @@ void MaskOperation::deinitExecution()
|
||||
deinitMutex();
|
||||
}
|
||||
|
||||
void *MaskOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *MaskOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
/* pass */
|
||||
return NULL;
|
||||
@@ -191,10 +193,15 @@ void MaskOperation::determineResolution(unsigned int resolution[], unsigned int
|
||||
}
|
||||
}
|
||||
|
||||
void MaskOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void MaskOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
const float xy[2] = {x / (float)this->m_maskWidth, y / (float)this->m_maskHeight};
|
||||
color[0] = BLI_maskrasterize_handle_sample(this->m_rasterMaskHandle, xy);
|
||||
if (this->m_rasterMaskHandle) {
|
||||
color[0] = BLI_maskrasterize_handle_sample(this->m_rasterMaskHandle, xy);
|
||||
}
|
||||
else {
|
||||
color[0] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* USE_RASKTER */
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
|
||||
void setMask(Mask *mask) { this->m_mask = mask; }
|
||||
void setMaskWidth(int width) { this->m_maskWidth = width; }
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
void setSmooth(bool smooth) { this->m_do_smooth = smooth; }
|
||||
void setFeather(bool feather) { this->m_do_feather = feather; }
|
||||
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -71,52 +71,52 @@ void MathBaseOperation::clampIfNeeded(float *color)
|
||||
}
|
||||
}
|
||||
|
||||
void MathAddOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathAddOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
outputValue[0] = inputValue1[0] + inputValue2[0];
|
||||
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathSubtractOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathSubtractOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
outputValue[0] = inputValue1[0] - inputValue2[0];
|
||||
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathMultiplyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathMultiplyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
outputValue[0] = inputValue1[0] * inputValue2[0];
|
||||
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathDivideOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathDivideOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
if (inputValue2[0] == 0) /* We don't want to divide by zero. */
|
||||
outputValue[0] = 0.0;
|
||||
@@ -126,52 +126,52 @@ void MathDivideOperation::executePixel(float *outputValue, float x, float y, Pix
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathSineOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathSineOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
outputValue[0] = sin(inputValue1[0]);
|
||||
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathCosineOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathCosineOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
outputValue[0] = cos(inputValue1[0]);
|
||||
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathTangentOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathTangentOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
outputValue[0] = tan(inputValue1[0]);
|
||||
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathArcSineOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathArcSineOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
if (inputValue1[0] <= 1 && inputValue1[0] >= -1)
|
||||
outputValue[0] = asin(inputValue1[0]);
|
||||
@@ -181,13 +181,13 @@ void MathArcSineOperation::executePixel(float *outputValue, float x, float y, Pi
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathArcCosineOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathArcCosineOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
if (inputValue1[0] <= 1 && inputValue1[0] >= -1)
|
||||
outputValue[0] = acos(inputValue1[0]);
|
||||
@@ -197,26 +197,26 @@ void MathArcCosineOperation::executePixel(float *outputValue, float x, float y,
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathArcTangentOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathArcTangentOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
outputValue[0] = atan(inputValue1[0]);
|
||||
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathPowerOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathPowerOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
if (inputValue1[0] >= 0) {
|
||||
outputValue[0] = pow(inputValue1[0], inputValue2[0]);
|
||||
@@ -235,13 +235,13 @@ void MathPowerOperation::executePixel(float *outputValue, float x, float y, Pixe
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathLogarithmOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathLogarithmOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
if (inputValue1[0] > 0 && inputValue2[0] > 0)
|
||||
outputValue[0] = log(inputValue1[0]) / log(inputValue2[0]);
|
||||
@@ -251,65 +251,65 @@ void MathLogarithmOperation::executePixel(float *outputValue, float x, float y,
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathMinimumOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathMinimumOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
outputValue[0] = min(inputValue1[0], inputValue2[0]);
|
||||
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathMaximumOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathMaximumOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
outputValue[0] = max(inputValue1[0], inputValue2[0]);
|
||||
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathRoundOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathRoundOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
outputValue[0] = round(inputValue1[0]);
|
||||
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathLessThanOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathLessThanOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
outputValue[0] = inputValue1[0] < inputValue2[0] ? 1.0f : 0.0f;
|
||||
|
||||
clampIfNeeded(outputValue);
|
||||
}
|
||||
|
||||
void MathGreaterThanOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MathGreaterThanOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputValue1[4];
|
||||
float inputValue2[4];
|
||||
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler);
|
||||
this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler);
|
||||
|
||||
outputValue[0] = inputValue1[0] > inputValue2[0] ? 1.0f : 0.0f;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]) = 0;
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler) = 0;
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
@@ -73,88 +73,88 @@ public:
|
||||
class MathAddOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathAddOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathSubtractOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathSubtractOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathMultiplyOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathMultiplyOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathDivideOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathDivideOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathSineOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathSineOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathCosineOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathCosineOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathTangentOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathTangentOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
|
||||
class MathArcSineOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathArcSineOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathArcCosineOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathArcCosineOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathArcTangentOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathArcTangentOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathPowerOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathPowerOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathLogarithmOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathLogarithmOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathMinimumOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathMinimumOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathMaximumOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathMaximumOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathRoundOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathRoundOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathLessThanOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathLessThanOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
class MathGreaterThanOperation : public MathBaseOperation {
|
||||
public:
|
||||
MathGreaterThanOperation() : MathBaseOperation() {}
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *outputValue, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,15 +27,15 @@ MixAddOperation::MixAddOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixAddOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixAddOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float inputValue[4];
|
||||
|
||||
this->m_inputValueOperation->read(inputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
||||
|
||||
|
||||
float value = inputValue[0];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -41,15 +41,15 @@ void MixBaseOperation::initExecution()
|
||||
this->m_inputColor2Operation = this->getInputSocketReader(2);
|
||||
}
|
||||
|
||||
void MixBaseOperation::executePixel(float *outputColor, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixBaseOperation::executePixel(float *outputColor, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float inputValue[4];
|
||||
|
||||
this->m_inputValueOperation->read(inputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
||||
|
||||
float value = inputValue[0];
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -27,16 +27,16 @@ MixBlendOperation::MixBlendOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixBlendOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixBlendOperation::executePixel(float *outputValue, 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, inputBuffers);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
||||
value = inputValue[0];
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,16 +27,16 @@ MixBurnOperation::MixBurnOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixBurnOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixBurnOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
float tmp;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -31,15 +31,15 @@ MixColorOperation::MixColorOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixColorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixColorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,15 +27,15 @@ MixDarkenOperation::MixDarkenOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixDarkenOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixDarkenOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -28,15 +28,15 @@ MixDifferenceOperation::MixDifferenceOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixDifferenceOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixDifferenceOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,15 +27,15 @@ MixDivideOperation::MixDivideOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixDivideOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixDivideOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,16 +27,16 @@ MixDodgeOperation::MixDodgeOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixDodgeOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixDodgeOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
float tmp;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,16 +27,16 @@ MixGlareOperation::MixGlareOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixGlareOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixGlareOperation::executePixel(float *outputValue, 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, inputBuffers);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
||||
value = inputValue[0];
|
||||
float mf = 2.f - 2.f * fabsf(value - 0.5f);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -31,15 +31,15 @@ MixHueOperation::MixHueOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixHueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixHueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,15 +27,15 @@ MixLightenOperation::MixLightenOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixLightenOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixLightenOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,6 +39,6 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,15 +27,15 @@ MixLinearLightOperation::MixLinearLightOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixLinearLightOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixLinearLightOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,15 +27,15 @@ MixMultiplyOperation::MixMultiplyOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixMultiplyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixMultiplyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float inputValue[4];
|
||||
|
||||
this->m_inputValueOperation->read(inputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(inputValue, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(inputColor1, x, y, sampler);
|
||||
this->m_inputColor2Operation->read(inputColor2, x, y, sampler);
|
||||
|
||||
float value = inputValue[0];
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,15 +27,15 @@ MixOverlayOperation::MixOverlayOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixOverlayOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixOverlayOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -31,15 +31,15 @@ MixSaturationOperation::MixSaturationOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixSaturationOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixSaturationOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,15 +27,15 @@ MixScreenOperation::MixScreenOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixScreenOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixScreenOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float valuev[4];
|
||||
|
||||
this->m_inputValueOperation->read(valuev, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(valuev, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
float value = valuev[0];
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
|
||||
@@ -39,6 +39,6 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,15 +27,15 @@ MixSoftLightOperation::MixSoftLightOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixSoftLightOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) \
|
||||
void MixSoftLightOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) \
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -27,15 +27,15 @@ MixSubtractOperation::MixSubtractOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixSubtractOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixSubtractOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -31,15 +31,15 @@ MixValueOperation::MixValueOperation() : MixBaseOperation()
|
||||
/* pass */
|
||||
}
|
||||
|
||||
void MixValueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MixValueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float inputColor1[4];
|
||||
float inputColor2[4];
|
||||
float value;
|
||||
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler, inputBuffers);
|
||||
this->m_inputValueOperation->read(&value, x, y, sampler);
|
||||
this->m_inputColor1Operation->read(&inputColor1[0], x, y, sampler);
|
||||
this->m_inputColor2Operation->read(&inputColor2[0], x, y, sampler);
|
||||
|
||||
if (this->useValueAlphaMultiply()) {
|
||||
value *= inputColor2[3];
|
||||
|
||||
@@ -39,6 +39,6 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -33,7 +33,7 @@ MovieClipAttributeOperation::MovieClipAttributeOperation() : NodeOperation()
|
||||
this->m_attribute = MCA_X;
|
||||
}
|
||||
|
||||
void MovieClipAttributeOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MovieClipAttributeOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
if (!this->m_valueSet) {
|
||||
float loc[2], scale, angle;
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
|
||||
|
||||
void setMovieClip(MovieClip *clip) { this->m_clip = clip; }
|
||||
|
||||
@@ -92,7 +92,7 @@ void MovieClipOperation::determineResolution(unsigned int resolution[], unsigned
|
||||
}
|
||||
}
|
||||
|
||||
void MovieClipOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MovieClipOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
if (this->m_movieClipBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
|
||||
zero_v4(color);
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
void setCacheFrame(bool value) { this->m_cacheFrame = value; }
|
||||
|
||||
void setFramenumber(int framenumber) { this->m_framenumber = framenumber; }
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -78,16 +78,16 @@ void MovieDistortionOperation::deinitExecution()
|
||||
}
|
||||
|
||||
|
||||
void MovieDistortionOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MovieDistortionOperation::executePixel(float *color, 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(color, u, v, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(color, u, v, sampler);
|
||||
}
|
||||
else {
|
||||
this->m_inputOperation->read(color, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(color, x, y, sampler);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ protected:
|
||||
public:
|
||||
MovieDistortionOperation(bool distortion);
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -43,7 +43,7 @@ ImBuf *MultilayerBaseOperation::getImBuf()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void MultilayerColorOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MultilayerColorOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
int yi = y;
|
||||
int xi = x;
|
||||
@@ -74,7 +74,7 @@ void MultilayerColorOperation::executePixel(float *color, float x, float y, Pixe
|
||||
}
|
||||
}
|
||||
|
||||
void MultilayerValueOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MultilayerValueOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
int yi = y;
|
||||
int xi = x;
|
||||
@@ -87,7 +87,7 @@ void MultilayerValueOperation::executePixel(float *color, float x, float y, Pixe
|
||||
}
|
||||
}
|
||||
|
||||
void MultilayerVectorOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void MultilayerVectorOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
int yi = y;
|
||||
int xi = x;
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
MultilayerColorOperation(int pass) : MultilayerBaseOperation(pass) {
|
||||
this->addOutputSocket(COM_DT_COLOR);
|
||||
}
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
|
||||
class MultilayerValueOperation : public MultilayerBaseOperation {
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
MultilayerValueOperation(int pass) : MultilayerBaseOperation(pass) {
|
||||
this->addOutputSocket(COM_DT_VALUE);
|
||||
}
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
|
||||
class MultilayerVectorOperation : public MultilayerBaseOperation {
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
MultilayerVectorOperation(int pass) : MultilayerBaseOperation(pass) {
|
||||
this->addOutputSocket(COM_DT_VECTOR);
|
||||
}
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,13 +35,13 @@ void NormalizeOperation::initExecution()
|
||||
NodeOperation::initMutex();
|
||||
}
|
||||
|
||||
void NormalizeOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void NormalizeOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
/* using generic two floats struct to store x: min y: mult */
|
||||
NodeTwoFloats *minmult = (NodeTwoFloats *)data;
|
||||
|
||||
float output[4];
|
||||
this->m_imageReader->read(output, x, y, inputBuffers, NULL);
|
||||
this->m_imageReader->read(output, x, y, NULL);
|
||||
|
||||
color[0] = (output[0] - minmult->x) * minmult->y;
|
||||
}
|
||||
@@ -75,11 +75,11 @@ bool NormalizeOperation::determineDependingAreaOfInterest(rcti *input, ReadBuffe
|
||||
/* The code below assumes all data is inside range +- this, and that input buffer is single channel */
|
||||
#define BLENDER_ZMAX 10000.0f
|
||||
|
||||
void *NormalizeOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *NormalizeOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
lockMutex();
|
||||
if (this->m_cachedInstance == NULL) {
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_imageReader->initializeTileData(rect, memoryBuffers);
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_imageReader->initializeTileData(rect);
|
||||
/* using generic two floats struct to store x: min y: mult */
|
||||
NodeTwoFloats *minmult = new NodeTwoFloats();
|
||||
|
||||
@@ -113,7 +113,7 @@ void *NormalizeOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBu
|
||||
return this->m_cachedInstance;
|
||||
}
|
||||
|
||||
void NormalizeOperation::deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data)
|
||||
void NormalizeOperation::deinitializeTileData(rcti *rect, void *data)
|
||||
{
|
||||
/* pass */
|
||||
}
|
||||
|
||||
@@ -47,15 +47,15 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
*/
|
||||
void initExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data);
|
||||
void *initializeTileData(rcti *rect);
|
||||
void deinitializeTileData(rcti *rect, void *data);
|
||||
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
|
||||
@@ -77,7 +77,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, NULL);
|
||||
reader->read(color, x, y, COM_PS_NEAREST);
|
||||
|
||||
for (i = 0; i < size; ++i)
|
||||
buffer[offset + i] = color[i];
|
||||
|
||||
@@ -93,7 +93,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, NULL);
|
||||
this->m_input->read(color, rx, ry, COM_PS_NEAREST);
|
||||
linearrgb_to_srgb_v4(color, color);
|
||||
F4TOCHAR4(color, this->m_outputBuffer + offset);
|
||||
offset += 4;
|
||||
|
||||
@@ -40,14 +40,14 @@ void ProjectorLensDistortionOperation::initExecution()
|
||||
this->m_inputProgram = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void *ProjectorLensDistortionOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *ProjectorLensDistortionOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
updateDispersion(memoryBuffers);
|
||||
void *buffer = this->m_inputProgram->initializeTileData(NULL, memoryBuffers);
|
||||
updateDispersion();
|
||||
void *buffer = this->m_inputProgram->initializeTileData(NULL);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void ProjectorLensDistortionOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void ProjectorLensDistortionOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
float inputValue[4];
|
||||
const float height = this->getHeight();
|
||||
@@ -87,13 +87,13 @@ bool ProjectorLensDistortionOperation::determineDependingAreaOfInterest(rcti *in
|
||||
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
|
||||
}
|
||||
|
||||
void ProjectorLensDistortionOperation::updateDispersion(MemoryBuffer **inputBuffers)
|
||||
void ProjectorLensDistortionOperation::updateDispersion()
|
||||
{
|
||||
if (this->m_dispersionAvailable) return;
|
||||
this->lockMutex();
|
||||
if (!this->m_dispersionAvailable) {
|
||||
float result[4];
|
||||
this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST, inputBuffers);
|
||||
this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST);
|
||||
this->m_dispersion = result[0];
|
||||
this->m_kr = 0.25f * MAX2(MIN2(this->m_dispersion, 1.f), 0.f);
|
||||
this->m_kr2 = this->m_kr * 20;
|
||||
|
||||
@@ -44,14 +44,14 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
*/
|
||||
void initExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
*/
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
|
||||
void updateDispersion(MemoryBuffer **inputBuffers);
|
||||
void updateDispersion();
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,7 @@ ReadBufferOperation::ReadBufferOperation() : NodeOperation()
|
||||
this->m_buffer = NULL;
|
||||
}
|
||||
|
||||
void *ReadBufferOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *ReadBufferOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
return m_buffer;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ void ReadBufferOperation::determineResolution(unsigned int resolution[], unsigne
|
||||
}
|
||||
}
|
||||
}
|
||||
void ReadBufferOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ReadBufferOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
if (sampler == COM_PS_NEAREST) {
|
||||
m_buffer->read(color, x, y);
|
||||
@@ -59,7 +59,7 @@ void ReadBufferOperation::executePixel(float *color, float x, float y, PixelSamp
|
||||
}
|
||||
}
|
||||
|
||||
void ReadBufferOperation::executePixel(float *color, float x, float y, float dx, float dy, MemoryBuffer *inputBuffers[])
|
||||
void ReadBufferOperation::executePixel(float *color, float x, float y, float dx, float dy)
|
||||
{
|
||||
m_buffer->readEWA(color, x, y, dx, dy);
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@ public:
|
||||
MemoryProxy *getMemoryProxy() { return this->m_memoryProxy; }
|
||||
void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, float dx, float dy, MemoryBuffer * inputBuffers[]);
|
||||
void *initializeTileData(rcti *rect);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
void executePixel(float *color, float x, float y, float dx, float dy);
|
||||
const bool isReadBufferOperation() const { return true; }
|
||||
void setOffset(unsigned int offset) { this->m_offset = offset; }
|
||||
unsigned int getOffset() { return this->m_offset; }
|
||||
|
||||
@@ -27,7 +27,7 @@ RenderLayersAlphaProg::RenderLayersAlphaProg() : RenderLayersBaseProg(SCE_PASS_C
|
||||
this->addOutputSocket(COM_DT_VALUE);
|
||||
}
|
||||
|
||||
void RenderLayersAlphaProg::executePixel(float *output, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void RenderLayersAlphaProg::executePixel(float *output, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
int ix = x;
|
||||
int iy = y;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
class RenderLayersAlphaProg : public RenderLayersBaseProg {
|
||||
public:
|
||||
RenderLayersAlphaProg();
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ void RenderLayersBaseProg::initExecution()
|
||||
}
|
||||
}
|
||||
|
||||
void RenderLayersBaseProg::executePixel(float *output, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void RenderLayersBaseProg::executePixel(float *output, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
int ix = x;
|
||||
int iy = y;
|
||||
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
short getLayerId() { return this->m_layerId; }
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
void executePixel(float *output, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]);
|
||||
void executePixel(float *output, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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, NULL);
|
||||
this->m_degreeSocket->read(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 *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void RotateOperation::executePixel(float *color, 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(color, nx, ny, sampler, inputBuffers);
|
||||
this->m_imageSocket->read(color, nx, ny, sampler);
|
||||
}
|
||||
|
||||
bool RotateOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
|
||||
|
||||
@@ -38,7 +38,7 @@ private:
|
||||
public:
|
||||
RotateOperation();
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
void setDoDegree2RadConversion(bool abool) { this->m_doDegree2RadConversion = abool; }
|
||||
|
||||
@@ -54,7 +54,7 @@ void ScaleOperation::deinitExecution()
|
||||
}
|
||||
|
||||
|
||||
void ScaleOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ScaleOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
#ifdef USE_FORCE_BICUBIC
|
||||
sampler = COM_PS_BICUBIC;
|
||||
@@ -63,15 +63,15 @@ void ScaleOperation::executePixel(float *color, float x, float y, PixelSampler s
|
||||
float scaleX[4];
|
||||
float scaleY[4];
|
||||
|
||||
this->m_inputXOperation->read(scaleX, x, y, sampler, inputBuffers);
|
||||
this->m_inputYOperation->read(scaleY, x, y, sampler, inputBuffers);
|
||||
this->m_inputXOperation->read(scaleX, x, y, sampler);
|
||||
this->m_inputYOperation->read(scaleY, x, y, 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(color, nx, ny, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(color, nx, ny, sampler);
|
||||
}
|
||||
|
||||
bool ScaleOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
|
||||
@@ -80,8 +80,8 @@ bool ScaleOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOpe
|
||||
float scaleX[4];
|
||||
float scaleY[4];
|
||||
|
||||
this->m_inputXOperation->read(scaleX, 0, 0, COM_PS_NEAREST, NULL);
|
||||
this->m_inputYOperation->read(scaleY, 0, 0, COM_PS_NEAREST, NULL);
|
||||
this->m_inputXOperation->read(scaleX, 0, 0, COM_PS_NEAREST);
|
||||
this->m_inputYOperation->read(scaleY, 0, 0, COM_PS_NEAREST);
|
||||
|
||||
const float scx = scaleX[0];
|
||||
const float scy = scaleY[0];
|
||||
@@ -124,7 +124,7 @@ void ScaleAbsoluteOperation::deinitExecution()
|
||||
}
|
||||
|
||||
|
||||
void ScaleAbsoluteOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ScaleAbsoluteOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
#ifdef USE_FORCE_BICUBIC
|
||||
sampler = COM_PS_BICUBIC;
|
||||
@@ -133,8 +133,8 @@ void ScaleAbsoluteOperation::executePixel(float *color, float x, float y, PixelS
|
||||
float scaleX[4];
|
||||
float scaleY[4];
|
||||
|
||||
this->m_inputXOperation->read(scaleX, x, y, sampler, inputBuffers);
|
||||
this->m_inputYOperation->read(scaleY, x, y, sampler, inputBuffers);
|
||||
this->m_inputXOperation->read(scaleX, x, y, sampler);
|
||||
this->m_inputYOperation->read(scaleY, x, y, sampler);
|
||||
|
||||
const float scx = scaleX[0]; // target absolute scale
|
||||
const float scy = scaleY[0]; // target absolute scale
|
||||
@@ -148,7 +148,7 @@ void ScaleAbsoluteOperation::executePixel(float *color, float x, float y, PixelS
|
||||
float nx = this->m_centerX + (x - this->m_centerX) / relativeXScale;
|
||||
float ny = this->m_centerY + (y - this->m_centerY) / relativeYScale;
|
||||
|
||||
this->m_inputOperation->read(color, nx, ny, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(color, nx, ny, sampler);
|
||||
}
|
||||
|
||||
bool ScaleAbsoluteOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
|
||||
@@ -157,8 +157,8 @@ bool ScaleAbsoluteOperation::determineDependingAreaOfInterest(rcti *input, ReadB
|
||||
float scaleX[4];
|
||||
float scaleY[4];
|
||||
|
||||
this->m_inputXOperation->read(scaleX, 0, 0, COM_PS_NEAREST, NULL);
|
||||
this->m_inputYOperation->read(scaleY, 0, 0, COM_PS_NEAREST, NULL);
|
||||
this->m_inputXOperation->read(scaleX, 0, 0, COM_PS_NEAREST);
|
||||
this->m_inputYOperation->read(scaleY, 0, 0, COM_PS_NEAREST);
|
||||
|
||||
const float scx = scaleX[0];
|
||||
const float scy = scaleY[0];
|
||||
@@ -244,7 +244,7 @@ void ScaleFixedSizeOperation::deinitExecution()
|
||||
}
|
||||
|
||||
|
||||
void ScaleFixedSizeOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ScaleFixedSizeOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
#ifdef USE_FORCE_BICUBIC
|
||||
sampler = COM_PS_BICUBIC;
|
||||
@@ -253,10 +253,10 @@ void ScaleFixedSizeOperation::executePixel(float *color, float x, float y, Pixel
|
||||
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(color, nx, ny, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(color, nx, ny, sampler);
|
||||
}
|
||||
else {
|
||||
this->m_inputOperation->read(color, x * this->m_relX, y * this->m_relY, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(color, x * this->m_relX, y * this->m_relY, sampler);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
public:
|
||||
ScaleOperation();
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
@@ -51,7 +51,7 @@ class ScaleAbsoluteOperation : public NodeOperation {
|
||||
public:
|
||||
ScaleAbsoluteOperation();
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
ScaleFixedSizeOperation();
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -48,14 +48,14 @@ void ScreenLensDistortionOperation::initExecution()
|
||||
|
||||
}
|
||||
|
||||
void *ScreenLensDistortionOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *ScreenLensDistortionOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
void *buffer = this->m_inputProgram->initializeTileData(NULL, memoryBuffers);
|
||||
updateDispersionAndDistortion(memoryBuffers);
|
||||
void *buffer = this->m_inputProgram->initializeTileData(NULL);
|
||||
updateDispersionAndDistortion();
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void ScreenLensDistortionOperation::executePixel(float *outputColor, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void ScreenLensDistortionOperation::executePixel(float *outputColor, int x, int y, void *data)
|
||||
{
|
||||
const float height = this->getHeight();
|
||||
const float width = this->getWidth();
|
||||
@@ -316,16 +316,16 @@ void ScreenLensDistortionOperation::updateVariables(float distortion, float disp
|
||||
this->m_kb4 = this->m_kb * 4.0f;
|
||||
}
|
||||
|
||||
void ScreenLensDistortionOperation::updateDispersionAndDistortion(MemoryBuffer **inputBuffers)
|
||||
void ScreenLensDistortionOperation::updateDispersionAndDistortion()
|
||||
{
|
||||
if (this->m_valuesAvailable) return;
|
||||
|
||||
this->lockMutex();
|
||||
if (!this->m_valuesAvailable) {
|
||||
float result[4];
|
||||
this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST, inputBuffers);
|
||||
this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST);
|
||||
this->m_distortion = result[0];
|
||||
this->getInputSocketReader(2)->read(result, 0, 0, COM_PS_NEAREST, inputBuffers);
|
||||
this->getInputSocketReader(2)->read(result, 0, 0, COM_PS_NEAREST);
|
||||
this->m_dispersion = result[0];
|
||||
updateVariables(this->m_distortion, this->m_dispersion);
|
||||
this->m_valuesAvailable = true;
|
||||
|
||||
@@ -49,14 +49,14 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
*/
|
||||
void initExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
*/
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
private:
|
||||
void determineUV(float result[4], float x, float y) const;
|
||||
void determineUV(float result[4], float x, float y, float distortion, float dispersion);
|
||||
void updateDispersionAndDistortion(MemoryBuffer **inputBuffers);
|
||||
void updateDispersionAndDistortion();
|
||||
void updateVariables(float distortion, float dispersion);
|
||||
|
||||
};
|
||||
|
||||
@@ -39,9 +39,9 @@ void SeparateChannelOperation::deinitExecution()
|
||||
}
|
||||
|
||||
|
||||
void SeparateChannelOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void SeparateChannelOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float input[4];
|
||||
this->m_inputOperation->read(input, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(input, x, y, sampler);
|
||||
color[0] = input[this->m_channel];
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ private:
|
||||
int m_channel;
|
||||
public:
|
||||
SeparateChannelOperation();
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -38,12 +38,12 @@ void SetAlphaOperation::initExecution()
|
||||
this->m_inputAlpha = getInputSocketReader(1);
|
||||
}
|
||||
|
||||
void SetAlphaOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void SetAlphaOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float alphaInput[4];
|
||||
|
||||
this->m_inputColor->read(outputValue, x, y, sampler, inputBuffers);
|
||||
this->m_inputAlpha->read(alphaInput, x, y, sampler, inputBuffers);
|
||||
this->m_inputColor->read(outputValue, x, y, sampler);
|
||||
this->m_inputAlpha->read(alphaInput, x, y, sampler);
|
||||
|
||||
outputValue[3] = alphaInput[0];
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -27,7 +27,7 @@ SetColorOperation::SetColorOperation() : NodeOperation()
|
||||
this->addOutputSocket(COM_DT_COLOR);
|
||||
}
|
||||
|
||||
void SetColorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void SetColorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
outputValue[0] = this->m_channel1;
|
||||
outputValue[1] = this->m_channel2;
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
|
||||
const bool isSetOperation() const { return true; }
|
||||
|
||||
@@ -37,7 +37,7 @@ void SetSamplerOperation::deinitExecution()
|
||||
this->m_reader = NULL;
|
||||
}
|
||||
|
||||
void SetSamplerOperation::executePixel(float *output, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void SetSamplerOperation::executePixel(float *output, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
this->m_reader->read(output, x, y, this->m_sampler, inputBuffers);
|
||||
this->m_reader->read(output, x, y, this->m_sampler);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ SetValueOperation::SetValueOperation() : NodeOperation()
|
||||
this->addOutputSocket(COM_DT_VALUE);
|
||||
}
|
||||
|
||||
void SetValueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void SetValueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
outputValue[0] = this->m_value;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
|
||||
|
||||
const bool isSetOperation() const { return true; }
|
||||
|
||||
@@ -28,7 +28,7 @@ SetVectorOperation::SetVectorOperation() : NodeOperation()
|
||||
this->addOutputSocket(COM_DT_VECTOR);
|
||||
}
|
||||
|
||||
void SetVectorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void SetVectorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
outputValue[0] = this->m_x;
|
||||
outputValue[1] = this->m_y;
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
|
||||
const bool isSetOperation() const { return true; }
|
||||
|
||||
@@ -39,9 +39,9 @@ void SocketProxyOperation::deinitExecution()
|
||||
this->m_inputOperation = NULL;
|
||||
}
|
||||
|
||||
void SocketProxyOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void SocketProxyOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
if (this->m_inputOperation) {
|
||||
this->m_inputOperation->read(color, x, y, sampler, inputBuffers);
|
||||
this->m_inputOperation->read(color, x, y, sampler);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ private:
|
||||
SocketReader *m_inputOperation;
|
||||
public:
|
||||
SocketProxyOperation(DataType type);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
|
||||
@@ -80,10 +80,10 @@ void SplitViewerOperation::executeRegion(rcti *rect, unsigned int tileNumber)
|
||||
float srgb[4];
|
||||
image1 = this->m_xSplit ? x > perc : y > perc;
|
||||
if (image1) {
|
||||
this->m_image1Input->read(&(buffer[offset]), x, y, COM_PS_NEAREST, NULL);
|
||||
this->m_image1Input->read(&(buffer[offset]), x, y, COM_PS_NEAREST);
|
||||
}
|
||||
else {
|
||||
this->m_image2Input->read(&(buffer[offset]), x, y, COM_PS_NEAREST, NULL);
|
||||
this->m_image2Input->read(&(buffer[offset]), x, y, COM_PS_NEAREST);
|
||||
}
|
||||
/// @todo: linear conversion only when scene color management is selected, also check predivide.
|
||||
if (this->m_doColorManagement) {
|
||||
|
||||
@@ -68,16 +68,16 @@ void TextureBaseOperation::determineResolution(unsigned int resolution[], unsign
|
||||
}
|
||||
}
|
||||
|
||||
void TextureAlphaOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void TextureAlphaOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
TextureBaseOperation::executePixel(color, x, y, sampler, inputBuffers);
|
||||
TextureBaseOperation::executePixel(color, x, y, sampler);
|
||||
color[0] = color[3];
|
||||
color[1] = 0.0f;
|
||||
color[2] = 0.0f;
|
||||
color[3] = 0.0f;
|
||||
}
|
||||
|
||||
void TextureBaseOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void TextureBaseOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
TexResult texres = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
|
||||
float textureSize[4];
|
||||
@@ -89,8 +89,8 @@ void TextureBaseOperation::executePixel(float *color, float x, float y, PixelSam
|
||||
const float u = (cx - x) / this->getWidth() * 2;
|
||||
const float v = (cy - y) / this->getHeight() * 2;
|
||||
|
||||
this->m_inputSize->read(textureSize, x, y, sampler, inputBuffers);
|
||||
this->m_inputOffset->read(textureOffset, x, y, sampler, inputBuffers);
|
||||
this->m_inputSize->read(textureSize, x, y, sampler);
|
||||
this->m_inputOffset->read(textureOffset, x, y, sampler);
|
||||
|
||||
vec[0] = textureSize[0] * (u + textureOffset[0]);
|
||||
vec[1] = textureSize[1] * (v + textureOffset[1]);
|
||||
|
||||
@@ -60,7 +60,7 @@ protected:
|
||||
TextureBaseOperation();
|
||||
|
||||
public:
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void setTexture(Tex *texture) { this->m_texture = texture; }
|
||||
void initExecution();
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
class TextureAlphaOperation : public TextureBaseOperation {
|
||||
public:
|
||||
TextureAlphaOperation();
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -41,12 +41,12 @@ void TonemapOperation::initExecution()
|
||||
NodeOperation::initMutex();
|
||||
}
|
||||
|
||||
void TonemapOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void TonemapOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
AvgLogLum *avg = (AvgLogLum *)data;
|
||||
|
||||
float output[4];
|
||||
this->m_imageReader->read(output, x, y, inputBuffers, NULL);
|
||||
this->m_imageReader->read(output, x, y, NULL);
|
||||
mul_v3_fl(output, avg->al);
|
||||
float dr = output[0] + this->m_data->offset;
|
||||
float dg = output[1] + this->m_data->offset;
|
||||
@@ -63,7 +63,7 @@ void TonemapOperation::executePixel(float *color, int x, int y, MemoryBuffer *in
|
||||
|
||||
copy_v4_v4(color, output);
|
||||
}
|
||||
void PhotoreceptorTonemapOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void PhotoreceptorTonemapOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
AvgLogLum *avg = (AvgLogLum *)data;
|
||||
NodeTonemap *ntm = this->m_data;
|
||||
@@ -73,7 +73,7 @@ void PhotoreceptorTonemapOperation::executePixel(float *color, int x, int y, Mem
|
||||
const float ic = 1.0f - ntm->c, ia = 1.0f - ntm->a;
|
||||
|
||||
float output[4];
|
||||
this->m_imageReader->read(output, x, y, inputBuffers, NULL);
|
||||
this->m_imageReader->read(output, x, y, NULL);
|
||||
|
||||
const float L = rgb_to_luma_y(output);
|
||||
float I_l = output[0] + ic * (L - output[0]);
|
||||
@@ -116,11 +116,11 @@ bool TonemapOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferO
|
||||
return false;
|
||||
}
|
||||
|
||||
void *TonemapOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *TonemapOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
lockMutex();
|
||||
if (this->m_cachedInstance == NULL) {
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_imageReader->initializeTileData(rect, memoryBuffers);
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_imageReader->initializeTileData(rect);
|
||||
AvgLogLum *data = new AvgLogLum();
|
||||
|
||||
float *buffer = tile->getBuffer();
|
||||
@@ -154,7 +154,7 @@ void *TonemapOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuff
|
||||
return this->m_cachedInstance;
|
||||
}
|
||||
|
||||
void TonemapOperation::deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data)
|
||||
void TonemapOperation::deinitializeTileData(rcti *rect, void *data)
|
||||
{
|
||||
/* pass */
|
||||
}
|
||||
|
||||
@@ -64,15 +64,15 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
*/
|
||||
void initExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data);
|
||||
void *initializeTileData(rcti *rect);
|
||||
void deinitializeTileData(rcti *rect, void *data);
|
||||
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -50,10 +50,10 @@ void TranslateOperation::deinitExecution()
|
||||
}
|
||||
|
||||
|
||||
void TranslateOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void TranslateOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
ensureDelta();
|
||||
this->m_inputOperation->read(color, x - this->getDeltaX(), y - this->getDeltaY(), sampler, inputBuffers);
|
||||
this->m_inputOperation->read(color, x - this->getDeltaX(), y - this->getDeltaY(), sampler);
|
||||
}
|
||||
|
||||
bool TranslateOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
|
||||
|
||||
@@ -36,7 +36,7 @@ private:
|
||||
public:
|
||||
TranslateOperation();
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
|
||||
void initExecution();
|
||||
void deinitExecution();
|
||||
@@ -47,9 +47,9 @@ public:
|
||||
inline void ensureDelta() {
|
||||
if (!this->m_isDeltaSet) {
|
||||
float tempDelta[4];
|
||||
this->m_inputXOperation->read(tempDelta, 0, 0, COM_PS_NEAREST, NULL);
|
||||
this->m_inputXOperation->read(tempDelta, 0, 0, COM_PS_NEAREST);
|
||||
this->m_deltaX = tempDelta[0];
|
||||
this->m_inputYOperation->read(tempDelta, 0, 0, COM_PS_NEAREST, NULL);
|
||||
this->m_inputYOperation->read(tempDelta, 0, 0, COM_PS_NEAREST);
|
||||
this->m_deltaY = tempDelta[0];
|
||||
this->m_isDeltaSet = true;
|
||||
}
|
||||
|
||||
@@ -62,22 +62,22 @@ void VariableSizeBokehBlurOperation::initExecution()
|
||||
QualityStepHelper::initExecution(COM_QH_INCREASE);
|
||||
}
|
||||
|
||||
void *VariableSizeBokehBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *VariableSizeBokehBlurOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
MemoryBuffer** result = new MemoryBuffer*[3];
|
||||
result[0] = (MemoryBuffer*)this->m_inputProgram->initializeTileData(rect, memoryBuffers);
|
||||
result[1] = (MemoryBuffer*)this->m_inputBokehProgram->initializeTileData(rect, memoryBuffers);
|
||||
result[2] = (MemoryBuffer*)this->m_inputSizeProgram->initializeTileData(rect, memoryBuffers);
|
||||
result[0] = (MemoryBuffer*)this->m_inputProgram->initializeTileData(rect);
|
||||
result[1] = (MemoryBuffer*)this->m_inputBokehProgram->initializeTileData(rect);
|
||||
result[2] = (MemoryBuffer*)this->m_inputSizeProgram->initializeTileData(rect);
|
||||
return result;
|
||||
}
|
||||
|
||||
void VariableSizeBokehBlurOperation::deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data)
|
||||
void VariableSizeBokehBlurOperation::deinitializeTileData(rcti *rect, void *data)
|
||||
{
|
||||
MemoryBuffer** result = (MemoryBuffer**)data;
|
||||
delete[] result;
|
||||
}
|
||||
|
||||
void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
MemoryBuffer** buffers = (MemoryBuffer**)data;
|
||||
MemoryBuffer* inputProgramBuffer = buffers[0];
|
||||
@@ -93,7 +93,7 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, Me
|
||||
|
||||
#ifdef COM_DEFOCUS_SEARCH
|
||||
float search[4];
|
||||
this->m_inputSearchProgram->read(search, x/InverseSearchRadiusOperation::DIVIDER, y / InverseSearchRadiusOperation::DIVIDER, inputBuffers, NULL);
|
||||
this->m_inputSearchProgram->read(search, x/InverseSearchRadiusOperation::DIVIDER, y / InverseSearchRadiusOperation::DIVIDER, NULL);
|
||||
int minx = search[0];
|
||||
int miny = search[1];
|
||||
int maxx = search[2];
|
||||
@@ -238,7 +238,7 @@ void InverseSearchRadiusOperation::initExecution()
|
||||
this->m_inputRadius = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void* InverseSearchRadiusOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void* InverseSearchRadiusOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
MemoryBuffer * data = new MemoryBuffer(NULL, rect);
|
||||
float* buffer = data->getBuffer();
|
||||
@@ -268,7 +268,7 @@ void* InverseSearchRadiusOperation::initializeTileData(rcti *rect, MemoryBuffer
|
||||
|
||||
// for (int x2 = 0 ; x2 < DIVIDER ; x2 ++) {
|
||||
// for (int y2 = 0 ; y2 < DIVIDER ; y2 ++) {
|
||||
// this->m_inputRadius->read(temp, rx+x2, ry+y2, COM_PS_NEAREST, NULL);
|
||||
// this->m_inputRadius->read(temp, rx+x2, ry+y2, COM_PS_NEAREST);
|
||||
// if (radius < temp[0]) {
|
||||
// radius = temp[0];
|
||||
// maxx = x2;
|
||||
@@ -292,13 +292,13 @@ void* InverseSearchRadiusOperation::initializeTileData(rcti *rect, MemoryBuffer
|
||||
return data;
|
||||
}
|
||||
|
||||
void InverseSearchRadiusOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void InverseSearchRadiusOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
MemoryBuffer *buffer = (MemoryBuffer*)data;
|
||||
buffer->readNoCheck(color, x, y);
|
||||
}
|
||||
|
||||
void InverseSearchRadiusOperation::deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data)
|
||||
void InverseSearchRadiusOperation::deinitializeTileData(rcti *rect, void *data)
|
||||
{
|
||||
if (data) {
|
||||
MemoryBuffer* mb = (MemoryBuffer*)data;
|
||||
|
||||
@@ -44,16 +44,16 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
*/
|
||||
void initExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
|
||||
void deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data);
|
||||
void deinitializeTileData(rcti *rect, void *data);
|
||||
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
@@ -88,8 +88,8 @@ public:
|
||||
* Initialize the execution
|
||||
*/
|
||||
void initExecution();
|
||||
void* initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data);
|
||||
void* initializeTileData(rcti *rect);
|
||||
void deinitializeTileData(rcti *rect, void *data);
|
||||
|
||||
/**
|
||||
* Deinitialize the execution
|
||||
|
||||
@@ -52,7 +52,7 @@ void VectorBlurOperation::initExecution()
|
||||
|
||||
}
|
||||
|
||||
void VectorBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
|
||||
void VectorBlurOperation::executePixel(float *color, int x, int y, void *data)
|
||||
{
|
||||
float *buffer = (float *) data;
|
||||
int index = (y * this->getWidth() + x) * COM_NUMBER_OF_CHANNELS;
|
||||
@@ -70,7 +70,7 @@ void VectorBlurOperation::deinitExecution()
|
||||
this->m_cachedInstance = NULL;
|
||||
}
|
||||
}
|
||||
void *VectorBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
|
||||
void *VectorBlurOperation::initializeTileData(rcti *rect)
|
||||
{
|
||||
if (this->m_cachedInstance) {
|
||||
return this->m_cachedInstance;
|
||||
@@ -78,9 +78,9 @@ void *VectorBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryB
|
||||
|
||||
lockMutex();
|
||||
if (this->m_cachedInstance == NULL) {
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_inputImageProgram->initializeTileData(rect, memoryBuffers);
|
||||
MemoryBuffer *speed = (MemoryBuffer *)this->m_inputSpeedProgram->initializeTileData(rect, memoryBuffers);
|
||||
MemoryBuffer *z = (MemoryBuffer *)this->m_inputZProgram->initializeTileData(rect, memoryBuffers);
|
||||
MemoryBuffer *tile = (MemoryBuffer *)this->m_inputImageProgram->initializeTileData(rect);
|
||||
MemoryBuffer *speed = (MemoryBuffer *)this->m_inputSpeedProgram->initializeTileData(rect);
|
||||
MemoryBuffer *z = (MemoryBuffer *)this->m_inputZProgram->initializeTileData(rect);
|
||||
float *data = new float[this->getWidth() * this->getHeight() * COM_NUMBER_OF_CHANNELS];
|
||||
memcpy(data, tile->getBuffer(), this->getWidth() * this->getHeight() * COM_NUMBER_OF_CHANNELS * sizeof(float));
|
||||
this->generateVectorBlur(data, tile, speed, z);
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
|
||||
void executePixel(float *color, int x, int y, void *data);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
*/
|
||||
void deinitExecution();
|
||||
|
||||
void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
|
||||
void *initializeTileData(rcti *rect);
|
||||
|
||||
void setVectorBlurSettings(NodeBlurData *settings) { this->m_settings = settings; }
|
||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||
|
||||
@@ -43,12 +43,12 @@ void VectorCurveOperation::initExecution()
|
||||
this->m_inputProgram = this->getInputSocketReader(0);
|
||||
}
|
||||
|
||||
void VectorCurveOperation::executePixel(float *output, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void VectorCurveOperation::executePixel(float *output, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float input[4];
|
||||
|
||||
|
||||
this->m_inputProgram->read(input, x, y, sampler, inputBuffers);
|
||||
this->m_inputProgram->read(input, x, y, sampler);
|
||||
|
||||
curvemapping_evaluate_premulRGBF(this->m_curveMapping, output, input);
|
||||
output[3] = input[3];
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *Vector, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *Vector, float x, float y, PixelSampler sampler);
|
||||
|
||||
/**
|
||||
* Initialize the execution
|
||||
|
||||
@@ -66,6 +66,8 @@ void ViewerBaseOperation::initImage()
|
||||
|
||||
if (!ibuf) return;
|
||||
if (ibuf->x != (int)getWidth() || ibuf->y != (int)getHeight()) {
|
||||
BLI_lock_thread(LOCK_DRAW_IMAGE);
|
||||
|
||||
imb_freerectImBuf(ibuf);
|
||||
imb_freerectfloatImBuf(ibuf);
|
||||
IMB_freezbuffloatImBuf(ibuf);
|
||||
@@ -74,6 +76,8 @@ void ViewerBaseOperation::initImage()
|
||||
imb_addrectImBuf(ibuf);
|
||||
imb_addrectfloatImBuf(ibuf);
|
||||
anImage->ok = IMA_OK_LOADED;
|
||||
|
||||
BLI_unlock_thread(LOCK_DRAW_IMAGE);
|
||||
}
|
||||
|
||||
this->m_partialBufferUpdate = IMB_partial_buffer_update_context_new(ibuf);
|
||||
|
||||
@@ -82,12 +82,11 @@ 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[offset]), x, y, COM_PS_NEAREST, NULL);
|
||||
this->m_imageInput->read(&(buffer[offset]), x, y, COM_PS_NEAREST);
|
||||
if (this->m_alphaInput != NULL) {
|
||||
this->m_alphaInput->read(alpha, x, y, COM_PS_NEAREST, NULL);
|
||||
this->m_alphaInput->read(alpha, x, y, COM_PS_NEAREST);
|
||||
buffer[offset + 3] = alpha[0];
|
||||
}
|
||||
/// @todo: linear conversion only when scene color management is selected, also check predivide.
|
||||
if (this->m_doColorManagement) {
|
||||
if (this->m_doColorPredivide) {
|
||||
linearrgb_to_srgb_predivide_v4(srgb, buffer + offset);
|
||||
|
||||
@@ -40,9 +40,9 @@ WriteBufferOperation::~WriteBufferOperation()
|
||||
}
|
||||
}
|
||||
|
||||
void WriteBufferOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void WriteBufferOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
this->m_input->read(color, x, y, sampler, inputBuffers);
|
||||
this->m_input->read(color, x, y, sampler);
|
||||
}
|
||||
|
||||
void WriteBufferOperation::initExecution()
|
||||
@@ -62,7 +62,7 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber)
|
||||
MemoryBuffer *memoryBuffer = this->m_memoryProxy->getBuffer();
|
||||
float *buffer = memoryBuffer->getBuffer();
|
||||
if (this->m_input->isComplex()) {
|
||||
void *data = this->m_input->initializeTileData(rect, NULL);
|
||||
void *data = this->m_input->initializeTileData(rect);
|
||||
int x1 = rect->xmin;
|
||||
int y1 = rect->ymin;
|
||||
int x2 = rect->xmax;
|
||||
@@ -73,7 +73,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, NULL, data);
|
||||
this->m_input->read(&(buffer[offset4]), x, y, data);
|
||||
offset4 += COM_NUMBER_OF_CHANNELS;
|
||||
|
||||
}
|
||||
@@ -83,7 +83,7 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber)
|
||||
|
||||
}
|
||||
if (data) {
|
||||
this->m_input->deinitializeTileData(rect, NULL, data);
|
||||
this->m_input->deinitializeTileData(rect, data);
|
||||
data = NULL;
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,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, NULL);
|
||||
this->m_input->read(&(buffer[offset4]), x, y, COM_PS_NEAREST);
|
||||
offset4 += COM_NUMBER_OF_CHANNELS;
|
||||
}
|
||||
if (isBreaked()) {
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
~WriteBufferOperation();
|
||||
int isBufferOperation() { return true; }
|
||||
MemoryProxy *getMemoryProxy() { return this->m_memoryProxy; }
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
const bool isWriteBufferOperation() const { return true; }
|
||||
|
||||
void executeRegion(rcti *rect, unsigned int tileNumber);
|
||||
|
||||
@@ -46,36 +46,36 @@ void ZCombineOperation::initExecution()
|
||||
this->m_depth2Reader = this->getInputSocketReader(3);
|
||||
}
|
||||
|
||||
void ZCombineOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ZCombineOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
|
||||
{
|
||||
float depth1[4];
|
||||
float depth2[4];
|
||||
|
||||
this->m_depth1Reader->read(depth1, x, y, sampler, inputBuffers);
|
||||
this->m_depth2Reader->read(depth2, x, y, sampler, inputBuffers);
|
||||
this->m_depth1Reader->read(depth1, x, y, sampler);
|
||||
this->m_depth2Reader->read(depth2, x, y, sampler);
|
||||
if (depth1[0] < depth2[0]) {
|
||||
this->m_image1Reader->read(color, x, y, sampler, inputBuffers);
|
||||
this->m_image1Reader->read(color, x, y, sampler);
|
||||
}
|
||||
else {
|
||||
this->m_image2Reader->read(color, x, y, sampler, inputBuffers);
|
||||
this->m_image2Reader->read(color, x, y, sampler);
|
||||
}
|
||||
}
|
||||
void ZCombineAlphaOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
|
||||
void ZCombineAlphaOperation::executePixel(float *color, 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, inputBuffers);
|
||||
this->m_depth2Reader->read(depth2, x, y, sampler, inputBuffers);
|
||||
this->m_depth1Reader->read(depth1, x, y, sampler);
|
||||
this->m_depth2Reader->read(depth2, x, y, sampler);
|
||||
if (depth1[0] < depth2[0]) {
|
||||
this->m_image1Reader->read(color1, x, y, sampler, inputBuffers);
|
||||
this->m_image2Reader->read(color2, x, y, sampler, inputBuffers);
|
||||
this->m_image1Reader->read(color1, x, y, sampler);
|
||||
this->m_image2Reader->read(color2, x, y, sampler);
|
||||
}
|
||||
else {
|
||||
this->m_image1Reader->read(color2, x, y, sampler, inputBuffers);
|
||||
this->m_image2Reader->read(color1, x, y, sampler, inputBuffers);
|
||||
this->m_image1Reader->read(color2, x, y, sampler);
|
||||
this->m_image2Reader->read(color1, x, y, sampler);
|
||||
}
|
||||
float fac = color1[3];
|
||||
float ifac = 1.0f - fac;
|
||||
|
||||
@@ -47,11 +47,11 @@ public:
|
||||
/**
|
||||
* the inner loop of this program
|
||||
*/
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
|
||||
class ZCombineAlphaOperation : public ZCombineOperation {
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
|
||||
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -752,11 +752,21 @@ void draw_image_main(const bContext *C, ARegion *ar)
|
||||
/* retrieve the image and information about it */
|
||||
ima = ED_space_image(sima);
|
||||
ED_space_image_zoom(sima, ar, &zoomx, &zoomy);
|
||||
ibuf = ED_space_image_acquire_buffer(sima, &lock);
|
||||
|
||||
show_viewer = (ima && ima->source == IMA_SRC_VIEWER);
|
||||
show_render = (show_viewer && ima->type == IMA_TYPE_R_RESULT);
|
||||
|
||||
if (show_viewer) {
|
||||
/* use locked draw for drawing viewer image buffer since the conpositor
|
||||
* is running in separated thread and compositor could free this buffers.
|
||||
* other images are not modifying in such a way so they does not require
|
||||
* lock (sergey)
|
||||
*/
|
||||
BLI_lock_thread(LOCK_DRAW_IMAGE);
|
||||
}
|
||||
|
||||
ibuf = ED_space_image_acquire_buffer(sima, &lock);
|
||||
|
||||
/* draw the image or grid */
|
||||
if (ibuf == NULL)
|
||||
ED_region_grid_draw(ar, zoomx, zoomy);
|
||||
@@ -794,5 +804,8 @@ void draw_image_main(const bContext *C, ARegion *ar)
|
||||
/* render info */
|
||||
if (ima && show_render)
|
||||
draw_render_info(scene, ima, ar);
|
||||
}
|
||||
|
||||
if (show_viewer) {
|
||||
BLI_unlock_thread(LOCK_DRAW_IMAGE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,9 +335,6 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
|
||||
|
||||
/* preview rect? */
|
||||
if (node->flag & NODE_PREVIEW) {
|
||||
/* only recalculate size when there's a preview actually, otherwise we use stored result */
|
||||
BLI_lock_thread(LOCK_PREVIEW);
|
||||
|
||||
if (node->preview && node->preview->rect) {
|
||||
float aspect = 1.0f;
|
||||
|
||||
@@ -374,8 +371,6 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
|
||||
node->prvr.ymin = dy - oldh;
|
||||
dy = node->prvr.ymin - NODE_DYS / 2;
|
||||
}
|
||||
|
||||
BLI_unlock_thread(LOCK_PREVIEW);
|
||||
}
|
||||
|
||||
/* buttons rect? */
|
||||
@@ -861,10 +856,8 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
|
||||
|
||||
/* preview */
|
||||
if (node->flag & NODE_PREVIEW) {
|
||||
BLI_lock_thread(LOCK_PREVIEW);
|
||||
if (node->preview && node->preview->rect && !BLI_rctf_is_empty(&node->prvr))
|
||||
node_draw_preview(node->preview, &node->prvr);
|
||||
BLI_unlock_thread(LOCK_PREVIEW);
|
||||
}
|
||||
|
||||
UI_ThemeClearColor(color_id);
|
||||
|
||||
@@ -647,7 +647,7 @@ void generate_preview(void *data, bNode *node, CompBuf *stackbuf)
|
||||
if (stackbuf_use!=stackbuf)
|
||||
free_compbuf(stackbuf_use);
|
||||
|
||||
BLI_lock_thread(LOCK_PREVIEW);
|
||||
// BLI_lock_thread(LOCK_PREVIEW);
|
||||
|
||||
if (preview->rect)
|
||||
MEM_freeN(preview->rect);
|
||||
@@ -655,7 +655,7 @@ void generate_preview(void *data, bNode *node, CompBuf *stackbuf)
|
||||
preview->ysize= ysize;
|
||||
preview->rect= rect;
|
||||
|
||||
BLI_unlock_thread(LOCK_PREVIEW);
|
||||
// BLI_unlock_thread(LOCK_PREVIEW);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user