| 168 | } |
| 169 | |
| 170 | std::vector<float> CornerPinEffect::computeVertices(const BackendTexture& source, |
| 171 | const BackendRenderTarget& target, |
| 172 | const Point& offset) const { |
| 173 | std::vector<float> vertices = {}; |
| 174 | auto textureWidth = static_cast<float>(source.width()); |
| 175 | auto textureHeight = static_cast<float>(source.height()); |
| 176 | Point texturePoints[4] = {{0.0f, textureHeight}, |
| 177 | {textureWidth, textureHeight}, |
| 178 | {0.0f, 0.0f}, |
| 179 | {textureWidth, 0.0f}}; |
| 180 | for (size_t i = 0; i < 4; i++) { |
| 181 | auto vertexPoint = ToGLVertexPoint(cornerPoints[i] + offset, target); |
| 182 | vertices.push_back(vertexPoint.x); |
| 183 | vertices.push_back(vertexPoint.y); |
| 184 | auto texturePoint = ToGLTexturePoint(texturePoints[i], source); |
| 185 | vertices.push_back(texturePoint.x * vertexQs[i]); |
| 186 | vertices.push_back(texturePoint.y * vertexQs[i]); |
| 187 | vertices.push_back(vertexQs[i]); |
| 188 | } |
| 189 | return vertices; |
| 190 | } |
| 191 | |
| 192 | static float calculateDistance(const Point& intersection, const Point& vertexPoint) { |
| 193 | return std::sqrtf(std::powf(fabsf(intersection.x - vertexPoint.x), 2) + |
nothing calls this directly
no test coverage detected