bool encodeSkBitmapToPNG(const SkBitmap& image, Vector<unsigned char>* output) { if (image.config() != SkBitmap::kARGB_8888_Config) return false; // Only support ARGB at 8 bpp now. image.lockPixels(); bool result = encodeImpl(static_cast<unsigned char*>(image.getPixels()), image.width(), image.height(), image.rowBytes(), output, preMultipliedBGRAtoRGBA); image.unlockPixels(); return result; }
// static bool PNGImageEncoder::encode(const unsigned char* input, const IntSize& size, int bytesPerRow, Vector<unsigned char>* output) { return encodeImpl(input, size, bytesPerRow, output, convertBetweenBGRAandRGBA); }
BOOL callEncodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text) { return encodeImpl(base, raw_image, comment_text); }