diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-11-06 19:49:09 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-11-06 20:08:25 +0300 |
commit | 16732def37c5a66f3ea28dbe247b09cc6bca6677 (patch) | |
tree | 5d14f5c920a1411e336bd80b12becbb3f73de19a /source/blender/compositor/operations/COM_VectorBlurOperation.cpp | |
parent | 88926375a0e4e45f72c87b9e487c060ddd3c9216 (diff) |
Cleanup: Clang-Tidy modernize-use-nullptr
Replace `NULL` with `nullptr` in C++ code.
No functional changes.
Diffstat (limited to 'source/blender/compositor/operations/COM_VectorBlurOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_VectorBlurOperation.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp index 0f3a3172f15..0776c97563e 100644 --- a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp @@ -49,11 +49,11 @@ VectorBlurOperation::VectorBlurOperation() this->addInputSocket(COM_DT_VALUE); // ZBUF this->addInputSocket(COM_DT_COLOR); // SPEED this->addOutputSocket(COM_DT_COLOR); - this->m_settings = NULL; - this->m_cachedInstance = NULL; - this->m_inputImageProgram = NULL; - this->m_inputSpeedProgram = NULL; - this->m_inputZProgram = NULL; + this->m_settings = nullptr; + this->m_cachedInstance = nullptr; + this->m_inputImageProgram = nullptr; + this->m_inputSpeedProgram = nullptr; + this->m_inputZProgram = nullptr; setComplex(true); } void VectorBlurOperation::initExecution() @@ -62,7 +62,7 @@ void VectorBlurOperation::initExecution() this->m_inputImageProgram = getInputSocketReader(0); this->m_inputZProgram = getInputSocketReader(1); this->m_inputSpeedProgram = getInputSocketReader(2); - this->m_cachedInstance = NULL; + this->m_cachedInstance = nullptr; QualityStepHelper::initExecution(COM_QH_INCREASE); } @@ -76,12 +76,12 @@ void VectorBlurOperation::executePixel(float output[4], int x, int y, void *data void VectorBlurOperation::deinitExecution() { deinitMutex(); - this->m_inputImageProgram = NULL; - this->m_inputSpeedProgram = NULL; - this->m_inputZProgram = NULL; + this->m_inputImageProgram = nullptr; + this->m_inputSpeedProgram = nullptr; + this->m_inputZProgram = nullptr; if (this->m_cachedInstance) { MEM_freeN(this->m_cachedInstance); - this->m_cachedInstance = NULL; + this->m_cachedInstance = nullptr; } } void *VectorBlurOperation::initializeTileData(rcti *rect) @@ -91,7 +91,7 @@ void *VectorBlurOperation::initializeTileData(rcti *rect) } lockMutex(); - if (this->m_cachedInstance == NULL) { + if (this->m_cachedInstance == nullptr) { MemoryBuffer *tile = (MemoryBuffer *)this->m_inputImageProgram->initializeTileData(rect); MemoryBuffer *speed = (MemoryBuffer *)this->m_inputSpeedProgram->initializeTileData(rect); MemoryBuffer *z = (MemoryBuffer *)this->m_inputZProgram->initializeTileData(rect); @@ -107,7 +107,7 @@ bool VectorBlurOperation::determineDependingAreaOfInterest(rcti * /*input*/, ReadBufferOperation *readOperation, rcti *output) { - if (this->m_cachedInstance == NULL) { + if (this->m_cachedInstance == nullptr) { rcti newInput; newInput.xmax = this->getWidth(); newInput.xmin = 0; @@ -183,7 +183,7 @@ void zbuf_free_span(ZSpan *zspan) if (zspan->span2) { MEM_freeN(zspan->span2); } - zspan->span1 = zspan->span2 = NULL; + zspan->span1 = zspan->span2 = nullptr; } } @@ -192,7 +192,7 @@ static void zbuf_init_span(ZSpan *zspan) { zspan->miny1 = zspan->miny2 = zspan->recty + 1; zspan->maxy1 = zspan->maxy2 = -1; - zspan->minp1 = zspan->maxp1 = zspan->minp2 = zspan->maxp2 = NULL; + zspan->minp1 = zspan->maxp1 = zspan->minp2 = zspan->maxp2 = nullptr; } static void zbuf_add_to_span(ZSpan *zspan, const float v1[2], const float v2[2]) @@ -243,7 +243,7 @@ static void zbuf_add_to_span(ZSpan *zspan, const float v1[2], const float v2[2]) } /* empty span */ - if (zspan->maxp1 == NULL) { + if (zspan->maxp1 == nullptr) { span = zspan->span1; } else { /* does it complete left span? */ @@ -257,10 +257,10 @@ static void zbuf_add_to_span(ZSpan *zspan, const float v1[2], const float v2[2]) if (span == zspan->span1) { // printf("left span my0 %d my2 %d\n", my0, my2); - if (zspan->minp1 == NULL || zspan->minp1[1] > minv[1]) { + if (zspan->minp1 == nullptr || zspan->minp1[1] > minv[1]) { zspan->minp1 = minv; } - if (zspan->maxp1 == NULL || zspan->maxp1[1] < maxv[1]) { + if (zspan->maxp1 == nullptr || zspan->maxp1[1] < maxv[1]) { zspan->maxp1 = maxv; } if (my0 < zspan->miny1) { @@ -272,10 +272,10 @@ static void zbuf_add_to_span(ZSpan *zspan, const float v1[2], const float v2[2]) } else { // printf("right span my0 %d my2 %d\n", my0, my2); - if (zspan->minp2 == NULL || zspan->minp2[1] > minv[1]) { + if (zspan->minp2 == nullptr || zspan->minp2[1] > minv[1]) { zspan->minp2 = minv; } - if (zspan->maxp2 == NULL || zspan->maxp2[1] < maxv[1]) { + if (zspan->maxp2 == nullptr || zspan->maxp2[1] < maxv[1]) { zspan->maxp2 = maxv; } if (my0 < zspan->miny2) { @@ -321,7 +321,7 @@ static void zbuf_fill_in_rgba( zbuf_add_to_span(zspan, v4, v1); /* clipped */ - if (zspan->minp2 == NULL || zspan->maxp2 == NULL) { + if (zspan->minp2 == nullptr || zspan->maxp2 == nullptr) { return; } @@ -554,7 +554,7 @@ void zbuf_accumulate_vecblur(NodeBlurData *nbd, float v1[3], v2[3], v3[3], v4[3], fx, fy; const float *dimg, *dz, *ro; float *rectvz, *dvz, *dvec1, *dvec2, *dz1, *dz2, *rectz; - float *minvecbufrect = NULL, *rectweight, *rw, *rectmax, *rm; + float *minvecbufrect = nullptr, *rectweight, *rw, *rectmax, *rm; float maxspeedsq = (float)nbd->maxspeed * nbd->maxspeed; int y, x, step, maxspeed = nbd->maxspeed, samples = nbd->samples; int tsktsk = 0; @@ -765,7 +765,7 @@ void zbuf_accumulate_vecblur(NodeBlurData *nbd, /* clear drawing buffer */ for (x = xsize * ysize - 1; x >= 0; x--) { - rectdraw[x].colpoin = NULL; + rectdraw[x].colpoin = nullptr; } dimg = imgrect; |