Lines Matching refs:bitmap

28 static size_t get_uncompressed_size(const SkBitmap& bitmap,
30 switch (bitmap.colorType()) {
48 static SkStream* extract_index8_image(const SkBitmap& bitmap,
52 (get_uncompressed_size(bitmap, srcRect)));
56 memcpy(dst, bitmap.getAddr8(srcRect.fLeft, y), rowBytes);
62 static SkStream* extract_argb4444_data(const SkBitmap& bitmap,
75 (get_uncompressed_size(bitmap, srcRect)));
80 uint16_t* src = bitmap.getAddr16(0, y);
117 static SkStream* extract_rgb565_image(const SkBitmap& bitmap,
120 (get_uncompressed_size(bitmap,
124 uint16_t* src = bitmap.getAddr16(0, y);
135 static SkStream* extract_argb8888_data(const SkBitmap& bitmap,
146 (get_uncompressed_size(bitmap, srcRect)));
151 uint32_t* src = bitmap.getAddr32(0, y);
169 static SkStream* extract_a8_alpha(const SkBitmap& bitmap,
179 uint8_t* src = bitmap.getAddr8(0, y);
198 * @param bitmap Bitmap to extract data from.
199 * @param srcRect Region in the bitmap to extract.
209 static SkStream* extract_image_data(const SkBitmap& bitmap,
212 SkColorType colorType = bitmap.colorType();
224 bitmap.lockPixels();
228 stream = extract_index8_image(bitmap, srcRect);
232 stream = extract_argb4444_data(bitmap, srcRect, extractAlpha,
237 stream = extract_rgb565_image(bitmap, srcRect);
241 stream = extract_argb8888_data(bitmap, srcRect, extractAlpha,
248 stream = extract_a8_alpha(bitmap, srcRect,
255 bitmap.unlockPixels();
306 static uint32_t get_argb8888_neighbor_avg_color(const SkBitmap& bitmap,
314 if (y < 0 || y >= bitmap.height()) {
317 uint32_t* src = bitmap.getAddr32(0, y);
319 if (x < 0 || x >= bitmap.width()) {
340 static uint16_t get_argb4444_neighbor_avg_color(const SkBitmap& bitmap,
348 if (y < 0 || y >= bitmap.height()) {
351 uint16_t* src = bitmap.getAddr16(0, y);
353 if (x < 0 || x >= bitmap.width()) {
374 static SkBitmap unpremultiply_bitmap(const SkBitmap& bitmap,
377 outBitmap.allocPixels(bitmap.info().makeWH(srcRect.width(), srcRect.height()));
381 bitmap.lockPixels();
382 switch (bitmap.colorType()) {
386 uint16_t* src = bitmap.getAddr16(0, y);
401 *dst = get_argb4444_neighbor_avg_color(bitmap, x, y);
414 uint32_t* src = bitmap.getAddr32(0, y);
418 *dst = get_argb8888_neighbor_avg_color(bitmap, x, y);
431 bitmap.unlockPixels();
440 SkPDFImage* SkPDFImage::CreateImage(const SkBitmap& bitmap,
443 if (bitmap.colorType() == kUnknown_SkColorType) {
449 if (!bitmap.isOpaque()) {
453 // (or transparent) bitmap.
455 extract_image_data(bitmap, srcRect, true, &isTransparent));
462 SkColorType colorType = bitmap.colorType();
465 SkBitmap unpremulBitmap = unpremultiply_bitmap(bitmap, srcRect);
470 image = SkNEW_ARGS(SkPDFImage, (NULL, bitmap, false, srcRect, encoder));
474 SkNEW_ARGS(SkPDFImage, (alphaData.get(), bitmap,
499 const SkBitmap& bitmap,
507 if (bitmap.isImmutable()) {
508 fBitmap = bitmap;
510 bitmap.deepCopyTo(&fBitmap);
582 // constructor, and the bitmap will be regenerated and encoded in