MCPcopy Create free account
hub / github.com/Prograda/Skybolt / sampleImage

Function sampleImage

src/Skybolt/TileMapGenerator/TileMapGenerator.cpp:24–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22using namespace vis;
23
24static osg::Vec4f sampleImage(const osg::Image& image, const osg::Vec2d& point, Filtering filtering)
25{
26 switch (filtering)
27 {
28 case Filtering::NearestNeighbor:
29 return image.getColor(point);
30 break;
31 case Filtering::Bilinear:
32 return vis::getColorBilinear(image, osg::Vec2f(point.x() * image.s(), point.y() * image.t()));
33 break;
34 default:
35 assert(!"Not implemented");
36 }
37 return osg::Vec4f();
38}
39
40struct TileGeneratorConfig
41{

Callers 1

generateImageMethod · 0.85

Calls 1

getColorBilinearFunction · 0.85

Tested by

no test coverage detected