Function Bitmap

Summary

#include <Source/Falcor/Utils/Image/Bitmap.h>

(1) Bitmap()=default

(2) Bitmap(uint32_t width, uint32_t height, ResourceFormat format)

(3) Bitmap(uint32_t width, uint32_t height, ResourceFormat format, const uint8_t *pData)

Function overload

Synopsis

#include <Source/Falcor/Utils/Image/Bitmap.h>

Bitmap()=default

Description

No description yet.

Source

Line 134 in Source/Falcor/Utils/Image/Bitmap.h.

Synopsis

#include <Source/Falcor/Utils/Image/Bitmap.h>

Bitmap(uint32_t width, uint32_t height, ResourceFormat format)

Description

No description yet.

Source

Lines 310-328 in Source/Falcor/Utils/Image/Bitmap.cpp. Line 135 in Source/Falcor/Utils/Image/Bitmap.h.

Bitmap::Bitmap(uint32_t width, uint32_t height, ResourceFormat format)
    : mWidth(width)
    , mHeight(height)
    , mFormat(format)
    , mRowPitch(getFormatRowPitch(format, width))
{
    if (isCompressedFormat(format))
    {
        uint32_t blockSizeY = getFormatHeightCompressionRatio(format);
        assert(height % blockSizeY == 0); // Should divide evenly
        mSize = mRowPitch * (height / blockSizeY);
    }
    else
    {
        mSize = height * mRowPitch;
    }
    mpData = std::unique_ptr<uint8_t[]>(new uint8_t[mSize]);
}

Synopsis

#include <Source/Falcor/Utils/Image/Bitmap.h>

Bitmap(uint32_t width, uint32_t height, ResourceFormat format, const uint8_t *pData)

Description

No description yet.

Source

Lines 330-334 in Source/Falcor/Utils/Image/Bitmap.cpp. Line 136 in Source/Falcor/Utils/Image/Bitmap.h.

Bitmap::Bitmap(uint32_t width, uint32_t height, ResourceFormat format, const uint8_t* pData)
    : Bitmap(width, height, format)
{
    std::memcpy(mpData.get(), pData, mSize);
}





Add Discussion as Guest

Log in