MCPcopy Create free account
hub / github.com/baldurk/renderdoc / DecodeFormattedComponents

Function DecodeFormattedComponents

renderdoc/maths/formatpacking.cpp:322–351  ·  view source on GitHub ↗

Similar to DecodePixelData() but it casts the results to float for all component types

Source from the content-addressed store, hash-verified

320
321// Similar to DecodePixelData() but it casts the results to float for all component types
322FloatVector DecodeFormattedComponents(const ResourceFormat &fmt, const byte *data, bool *success)
323{
324 PixelValue val;
325 DecodePixelData(fmt, data, val, success);
326
327 FloatVector ret;
328 if(fmt.compType == CompType::UInt)
329 {
330 ret.x = (float)val.uintValue[0];
331 ret.y = (float)val.uintValue[1];
332 ret.z = (float)val.uintValue[2];
333 ret.w = (float)val.uintValue[3];
334 }
335 else if(fmt.compType == CompType::SInt)
336 {
337 ret.x = (float)val.intValue[0];
338 ret.y = (float)val.intValue[1];
339 ret.z = (float)val.intValue[2];
340 ret.w = (float)val.intValue[3];
341 }
342 else
343 {
344 ret.x = val.floatValue[0];
345 ret.y = val.floatValue[1];
346 ret.z = val.floatValue[2];
347 ret.w = val.floatValue[3];
348 }
349
350 return ret;
351}
352
353void EncodeFormattedComponents(const ResourceFormat &fmt, FloatVector v, byte *data, bool *success)
354{

Callers 12

GetThumbnailMethod · 0.85
CreateProxyTextureMethod · 0.85
formatpacking.cppFile · 0.85
ReadTexelMethod · 0.85
_glGetTexImageFunction · 0.85
GetDepthValueFunction · 0.85
ReadTexelMethod · 0.85
DebugVertexMethod · 0.85
ConvertAndFillInColorFunction · 0.85
GetDepthValueFunction · 0.85
InterpretVertexMethod · 0.85
SaveTextureMethod · 0.85

Calls 1

DecodePixelDataFunction · 0.70

Tested by

no test coverage detected