| 449 | } |
| 450 | |
| 451 | Bitmap::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 | |
| 468 | Bitmap::Bitmap(uint32_t width, uint32_t height, ResourceFormat format, const uint8_t* pData) : Bitmap(width, height, format) |
| 469 | { |
nothing calls this directly
no test coverage detected