#include <SkImageRef.h>
Inherits SkPixelRef.
Inherited by SkImageRef_GlobalPool.
Public Member Functions | |
SkImageRef (SkStream *, SkBitmap::Config config, int sampleSize=1) | |
virtual | ~SkImageRef () |
void | setDitherImage (bool dither) |
bool | getInfo (SkBitmap *bm) |
SkImageDecoderFactory * | getDecoderFactory () const |
SkImageDecoderFactory * | setDecoderFactory (SkImageDecoderFactory *) |
virtual void | flatten (SkFlattenableWriteBuffer &) const |
Protected Member Functions | |
virtual bool | onDecode (SkImageDecoder *codec, SkStream *, SkBitmap *, SkBitmap::Config, SkImageDecoder::Mode) |
virtual void * | onLockPixels (SkColorTable **) |
virtual void | onUnlockPixels () |
SkImageRef (SkFlattenableReadBuffer &) | |
Protected Attributes | |
SkBitmap | fBitmap |
Friends | |
class | SkImageRefPool |
Definition at line 31 of file SkImageRef.h.
SkImageRef::SkImageRef | ( | SkStream * | , | |
SkBitmap::Config | config, | |||
int | sampleSize = 1 | |||
) |
Create a new imageref from a stream. NOTE: the stream is not copied, but since it may be accessed from another thread, the caller must ensure that this imageref is the only owner of the stream. i.e. - sole ownership of the stream object is transferred to this imageref object.
stream | The stream containing the encoded image data. This may be retained (by calling ref()), so the caller should not explicitly delete it. | |
config | The preferred config of the decoded bitmap. | |
sampleSize | Requested sampleSize for decoding. Defaults to 1. |
virtual SkImageRef::~SkImageRef | ( | ) | [virtual] |
SkImageRef::SkImageRef | ( | SkFlattenableReadBuffer & | ) | [protected] |
virtual void SkImageRef::flatten | ( | SkFlattenableWriteBuffer & | ) | const [virtual] |
Reimplemented from SkPixelRef.
SkImageDecoderFactory* SkImageRef::getDecoderFactory | ( | ) | const [inline] |
Definition at line 60 of file SkImageRef.h.
bool SkImageRef::getInfo | ( | SkBitmap * | bm | ) |
Return true if the image can be decoded. If so, and bitmap is non-null, call its setConfig() with the corresponding values, but explicitly will not set its pixels or colortable. Use SkPixelRef::lockPixels() for that.
If there has been an error decoding the bitmap, this will return false and ignore the bitmap parameter.
virtual bool SkImageRef::onDecode | ( | SkImageDecoder * | codec, | |
SkStream * | , | |||
SkBitmap * | , | |||
SkBitmap::Config | , | |||
SkImageDecoder::Mode | ||||
) | [protected, virtual] |
Override if you want to install a custom allocator. When this is called we will have already acquired the mutex!
Reimplemented in SkImageRef_GlobalPool.
virtual void* SkImageRef::onLockPixels | ( | SkColorTable ** | ) | [protected, virtual] |
Called when the lockCount goes from 0 to 1. The caller will have already acquire a mutex for thread safety, so this method need not do that.
Implements SkPixelRef.
virtual void SkImageRef::onUnlockPixels | ( | ) | [protected, virtual] |
Called when the lock count goes from 1 to 0. The caller will have already acquire a mutex for thread safety, so this method need not do that.
Implements SkPixelRef.
Reimplemented in SkImageRef_GlobalPool.
SkImageDecoderFactory* SkImageRef::setDecoderFactory | ( | SkImageDecoderFactory * | ) |
void SkImageRef::setDitherImage | ( | bool | dither | ) | [inline] |
this value is passed onto the decoder. Default is true
Definition at line 49 of file SkImageRef.h.
friend class SkImageRefPool [friend] |
Definition at line 99 of file SkImageRef.h.
SkBitmap SkImageRef::fBitmap [protected] |
Definition at line 84 of file SkImageRef.h.