| 129 | } |
| 130 | |
| 131 | Valdi::Result<Valdi::BytesView> Image::encode(EncodedImageFormat format, double qualityRatio) const { |
| 132 | auto quality = static_cast<int>(round(100.0 * qualityRatio)); |
| 133 | |
| 134 | auto encoded = Image::encodeSKImageToSKData(*_skImage, format, quality); |
| 135 | if (encoded == nullptr) { |
| 136 | return Valdi::Error("Cannot encode image"); |
| 137 | } |
| 138 | |
| 139 | return bytesFromSkData(encoded); |
| 140 | } |
| 141 | |
| 142 | Ref<Image> Image::resized(int width, int height) const { |
| 143 | SkBitmap bitmap; |
nothing calls this directly
no test coverage detected