/usr/include/thunderbird/skia/SkCGUtils.h is in thunderbird-dev 1:38.6.0+build1-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | /*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkCGUtils_DEFINED
#define SkCGUtils_DEFINED
#include "SkSize.h"
#include "SkImageInfo.h"
#ifdef SK_BUILD_FOR_MAC
#include <ApplicationServices/ApplicationServices.h>
#endif
#ifdef SK_BUILD_FOR_IOS
#include <CoreGraphics/CoreGraphics.h>
#endif
class SkBitmap;
class SkData;
class SkStream;
/**
* Given a CGImage, allocate an SkBitmap and copy the image's pixels into it. If scaleToFit is not
* null, use it to determine the size of the bitmap, and scale the image to fill the bitmap.
* Otherwise use the image's width/height.
*
* On failure, return false, and leave bitmap unchanged.
*/
SK_API bool SkCreateBitmapFromCGImage(SkBitmap* dst, CGImageRef src, SkISize* scaleToFit = NULL);
/**
* Copy the pixels from src into the memory specified by info/rowBytes/dstPixels. On failure,
* return false (e.g. ImageInfo incompatible with src).
*/
SK_API bool SkCopyPixelsFromCGImage(const SkImageInfo& info, size_t rowBytes, void* dstPixels,
CGImageRef src);
/**
* Create an imageref from the specified bitmap using the specified colorspace.
* If space is NULL, then CGColorSpaceCreateDeviceRGB() is used.
*/
SK_API CGImageRef SkCreateCGImageRefWithColorspace(const SkBitmap& bm,
CGColorSpaceRef space);
/**
* Create an imageref from the specified bitmap using the colorspace returned
* by CGColorSpaceCreateDeviceRGB()
*/
static inline CGImageRef SkCreateCGImageRef(const SkBitmap& bm) {
return SkCreateCGImageRefWithColorspace(bm, NULL);
}
/**
* Draw the bitmap into the specified CG context. The bitmap will be converted
* to a CGImage using the generic RGB colorspace. (x,y) specifies the position
* of the top-left corner of the bitmap. The bitmap is converted using the
* colorspace returned by CGColorSpaceCreateDeviceRGB()
*/
void SkCGDrawBitmap(CGContextRef, const SkBitmap&, float x, float y);
bool SkPDFDocumentToBitmap(SkStream* stream, SkBitmap* output);
/**
* Return a provider that wraps the specified stream. It will become an
* owner of the stream, so the caller must still manage its ownership.
*
* To hand-off ownership of the stream to the provider, the caller must do
* something like the following:
*
* SkStream* stream = new ...;
* CGDataProviderRef provider = SkStreamToDataProvider(stream);
* stream->unref();
*
* Now when the provider is finally deleted, it will delete the stream.
*/
CGDataProviderRef SkCreateDataProviderFromStream(SkStream*);
CGDataProviderRef SkCreateDataProviderFromData(SkData*);
#endif
|