SkImageRef Class Reference

#include <SkImageRef.h>

Inherits SkPixelRef.

Inherited by SkImageRef_GlobalPool.

Collaboration diagram for SkImageRef:
[legend]

List of all members.

Public Member Functions

 SkImageRef (SkStream *, SkBitmap::Config config, int sampleSize=1)
virtual ~SkImageRef ()
void setDitherImage (bool dither)
bool getInfo (SkBitmap *bm)
SkImageDecoderFactorygetDecoderFactory () const
SkImageDecoderFactorysetDecoderFactory (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

Detailed Description

Definition at line 31 of file SkImageRef.h.


Constructor & Destructor Documentation

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.

Parameters:
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]

Member Function Documentation

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.


Friends And Related Function Documentation

friend class SkImageRefPool [friend]

Definition at line 99 of file SkImageRef.h.


Member Data Documentation

Definition at line 84 of file SkImageRef.h.


The documentation for this class was generated from the following file:

Generated on Tue Oct 20 10:33:04 2009 for Skia by  doxygen 1.6.1