MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / Bitmap

Method Bitmap

Source/Falcor/Utils/Image/Bitmap.cpp:451–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451Bitmap::Bitmap(uint32_t width, uint32_t height, ResourceFormat format)
452 : mWidth(width), mHeight(height), mRowPitch(getFormatRowPitch(format, width)), mFormat(format)
453{
454 if (isCompressedFormat(format))
455 {
456 uint32_t blockSizeY = getFormatHeightCompressionRatio(format);
457 FALCOR_ASSERT(height % blockSizeY == 0); // Should divide evenly
458 mSize = size_t(mRowPitch) * (height / blockSizeY);
459 }
460 else
461 {
462 mSize = height * size_t(mRowPitch);
463 }
464
465 mpData = std::unique_ptr<uint8_t[]>(new uint8_t[mSize]);
466}
467
468Bitmap::Bitmap(uint32_t width, uint32_t height, ResourceFormat format, const uint8_t* pData) : Bitmap(width, height, format)
469{

Callers

nothing calls this directly

Calls 4

getFormatRowPitchFunction · 0.85
isCompressedFormatFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected