more get rid of data type converting warnings on windows.
struct {
unsigned char *data;
- int width;
- int height;
+ size_t width;
+ size_t height;
struct {
float m11; float m12; float m13;
float m21; float m22; float m23;
if (frameNo < mModel->startFrame()) frameNo = mModel->startFrame();
mCompItem->resize(size);
- return mCompItem->update(frameNo);
+ return mCompItem->update(int(frameNo));
}
Surface AnimationImpl::render(size_t frameNo, const Surface &surface)
mRenderInProgress.store(true);
update(frameNo,
- VSize(surface.drawRegionWidth(), surface.drawRegionHeight()));
+ VSize(int(surface.drawRegionWidth()), int(surface.drawRegionHeight())));
mCompItem->render(surface);
mRenderInProgress.store(false);
const LOTLayerNode *Animation::renderTree(size_t frameNo, size_t width,
size_t height) const
{
- return d->renderTree(frameNo, VSize(width, height));
+ return d->renderTree(frameNo, VSize(int(width), int(height)));
}
std::future<Surface> Animation::render(size_t frameNo, Surface surface)
bool LOTCompItem::render(const rlottie::Surface &surface)
{
- VBitmap bitmap(reinterpret_cast<uchar *>(surface.buffer()), surface.width(),
- surface.height(), surface.bytesPerLine(),
+ VBitmap bitmap(reinterpret_cast<uchar *>(surface.buffer()),
+ uint(surface.width()), uint(surface.height()), uint(surface.bytesPerLine()),
VBitmap::Format::ARGB32_Premultiplied);
/* schedule all preprocess task for this frame at once.
*/
mDrawableList.clear();
mRootLayer->renderList(mDrawableList);
- VRect clip(0, 0, surface.drawRegionWidth(), surface.drawRegionHeight());
+ VRect clip(0, 0, int(surface.drawRegionWidth()), int(surface.drawRegionHeight()));
for (auto &e : mDrawableList) {
e->preprocess(clip);
}
VPainter painter(&bitmap);
// set sub surface area for drawing.
painter.setDrawRegion(
- VRect(surface.drawRegionPosX(), surface.drawRegionPosY(),
- surface.drawRegionWidth(), surface.drawRegionHeight()));
+ VRect(int(surface.drawRegionPosX()), int(surface.drawRegionPosY()),
+ int(surface.drawRegionWidth()), int(surface.drawRegionHeight())));
mRootLayer->render(&painter, {}, {});
return true;
void LOTGradient::populate(VGradientStops &stops, int frameNo)
{
LottieGradient gradData = mGradient.value(frameNo);
- int size = gradData.mGradient.size();
+ int size = int(gradData.mGradient.size());
float * ptr = gradData.mGradient.data();
int colorPoints = mColorPoints;
if (colorPoints == -1) { // for legacy bodymovin (ref: lottie-android)
colorPoints = size / 4;
}
- int opacityArraySize = size - colorPoints * 4;
+ int opacityArraySize = size - colorPoints * 4;
float *opacityPtr = ptr + (colorPoints * 4);
stops.clear();
int j = 0;
return size_t(pos * frameDuration());
}
long frameAtTime(double timeInSec) const {
- return frameAtPos(timeInSec / duration());
+ return long(frameAtPos(timeInSec / duration()));
}
size_t totalFrame() const {return mEndFrame - mStartFrame;}
long frameDuration() const {return mEndFrame - mStartFrame -1;}
return createBitmap(data, width, height, n);
}
- VBitmap load(const char *imageData, int len)
+ VBitmap load(const char *imageData, size_t len)
{
if (!imageFromData) return VBitmap();
int width, height, n;
unsigned char *data =
- imageFromData(imageData, len, &width, &height, &n, 4);
+ imageFromData(imageData, static_cast<int>(len), &width, &height, &n, 4);
if (!data) {
return VBitmap();
return mImpl->load(fileName);
}
-VBitmap VImageLoader::load(const char *data, int len)
+VBitmap VImageLoader::load(const char *data, size_t len)
{
return mImpl->load(data, len);
}
}
VBitmap load(const char *fileName);
- VBitmap load(const char *data, int len);
+ VBitmap load(const char *data, size_t len);
~VImageLoader();
private:
VImageLoader();