MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / SamplePoint

Method SamplePoint

Source/Engine/Graphics/PixelFormatExtensions.cpp:1518–1524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1516}
1517
1518Color PixelFormatSampler::SamplePoint(const void* data, const Float2& uv, const Int2& size, int32 rowPitch) const
1519{
1520 const Int2 end = size - 1;
1521 const Int2 uvFloor(Math::Min(Math::FloorToInt(uv.X * size.X), end.X), Math::Min(Math::FloorToInt(uv.Y * size.Y), end.Y));
1522 Float4 result = Read((const byte*)data + rowPitch * uvFloor.Y + PixelSize * uvFloor.X);
1523 return *(Color*)&result;
1524}
1525
1526Color PixelFormatSampler::SamplePoint(const void* data, int32 x, int32 y, int32 rowPitch) const
1527{

Callers 7

GetPixelsMethod · 0.80
UpdateTextureMethod · 0.80
TransformMethod · 0.80
ExportTextureStbMethod · 0.80
ConvertStbMethod · 0.80
ResizeStbMethod · 0.80

Calls 3

MinFunction · 0.50
FloorToIntFunction · 0.50
ReadFunction · 0.50

Tested by

no test coverage detected