uint mHeight{0};
uint mStride{0};
uint mBytes{0};
+ uint mDepth{0};
VBitmap::Format mFormat{VBitmap::Format::Invalid};
bool mOwnData;
bool mRoData;
mOwnData(true),
mRoData(false)
{
- uint depth = Impl::depth(format);
- uint stride = ((width * depth + 31) >> 5) << 2; // bytes per scanline (must be multiple of 4)
+ mDepth = depth(format);
+ uint stride = ((width * mDepth + 31) >> 5) << 2; // bytes per scanline (must be multiple of 4)
mWidth = width;
mHeight = height;
mStride = bytesPerLine;
mBytes = mStride * mHeight;
mData = data;
+ mDepth = depth(format);
}
~Impl()
return mImpl ? mImpl->height() : 0;
}
+uint VBitmap::depth() const
+{
+ return mImpl ? mImpl->mDepth : 0;
+}
+
uchar *VBitmap::data()
{
return mImpl ? mImpl->data() : nullptr;
}
+uchar *VBitmap::data() const
+{
+ return mImpl ? mImpl->data() : nullptr;
+}
+
bool VBitmap::valid() const
{
return mImpl ? true : false;