MCPcopy Create free account
hub / github.com/Tencent/libpag / ScalePixels

Function ScalePixels

exporter/src/utils/ImageData.cpp:82–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82void ScalePixels(uint8_t* dstRGBA, int dstStride, int dstWidth, int dstHeight, uint8_t* srcRGBA,
83 int srcStride, int srcWidth, int srcHeight) {
84 std::shared_ptr<tgfx::Data> data = tgfx::Data::MakeWithoutCopy(srcRGBA, srcStride * srcHeight);
85 auto imageInfo = tgfx::ImageInfo::Make(srcWidth, srcHeight, tgfx::ColorType::RGBA_8888,
86 tgfx::AlphaType::Premultiplied, srcStride);
87 auto codec = tgfx::ImageCodec::MakeFrom(imageInfo, data);
88 auto scaleImageInfo = tgfx::ImageInfo::Make(dstWidth, dstHeight, tgfx::ColorType::RGBA_8888,
89 tgfx::AlphaType::Premultiplied, dstStride);
90 codec->readPixels(scaleImageInfo, dstRGBA);
91}
92
93void GetImageDiffRect(ImageRect& rect, const uint8_t* preImage, const uint8_t* curImage, int width,
94 int height, int stride) {

Callers 3

GetVideoSequenceFunction · 0.85
GetBitmapSequenceFunction · 0.85
GetImageBytesFunction · 0.85

Calls 2

MakeFunction · 0.50
readPixelsMethod · 0.45

Tested by

no test coverage detected