MCPcopy Create free account
hub / github.com/Tencent/tgfx / RadialCode

Function RadialCode

src/pdf/PDFGradientShader.cpp:366–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366void RadialCode(const GradientInfo& info, const Matrix& /*perspectiveRemover*/,
367 const std::shared_ptr<MemoryWriteStream>& function) {
368 function->writeText("{");
369
370 // Find the distance from the origin.
371 function->writeText(
372 "dup " // x y y
373 "mul " // x y^2
374 "exch " // y^2 x
375 "dup " // y^2 x x
376 "mul " // y^2 x^2
377 "add " // y^2+x^2
378 "sqrt\n"); // sqrt(y^2+x^2)
379
380 TileModeCode(TileMode::Clamp, function);
381 GradientFunctionCode(info, function);
382 function->writeText("}");
383}
384
385/**
386 * Conical gradient shader, based on the Canvas spec for radial gradients

Callers 1

MakeFunctionShaderFunction · 0.85

Calls 3

TileModeCodeFunction · 0.85
GradientFunctionCodeFunction · 0.85
writeTextMethod · 0.80

Tested by

no test coverage detected