void ImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { if ((this->m_imageFloatBuffer == NULL && this->m_imageByteBuffer == NULL) || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) { zero_v4(output); } else { sampleImageAtLocation(this->m_buffer, x, y, sampler, true, output); } }
void ImageAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float tempcolor[4]; if ((this->m_imageFloatBuffer == NULL && this->m_imageByteBuffer == NULL) || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) { output[0] = 0.0f; } else { tempcolor[3] = 1.0f; sampleImageAtLocation(this->m_buffer, x, y, sampler, false, tempcolor); output[0] = tempcolor[3]; } }
void ImageOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) { int ix = x, iy = y; if (this->m_imageFloatBuffer == NULL && this->m_imageByteBuffer == NULL) { zero_v4(output); } else if (ix < 0 || iy < 0 || ix >= this->m_buffer->x || iy >= this->m_buffer->y) { zero_v4(output); } else { sampleImageAtLocation(this->m_buffer, x, y, sampler, true, output); } }