| 80 | } |
| 81 | |
| 82 | void 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 | |
| 93 | void GetImageDiffRect(ImageRect& rect, const uint8_t* preImage, const uint8_t* curImage, int width, |
| 94 | int height, int stride) { |
no test coverage detected