Laxkit  0.0.7.1
Public Member Functions | Public Attributes
Laxkit::LaxImage Class Reference

Abstraction around images. More...

Inheritance diagram for Laxkit::LaxImage:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 LaxImage (const char *fname)
virtual ~LaxImage ()
virtual int imagetype ()=0
virtual unsigned int imagestate ()=0
 Return whether this is valid image, is whole image, etc.
virtual void doneForNow ()
 The file that the image is supposed to correspond to.
virtual int w ()=0
 Return the width of the actual image.
virtual int h ()=0
 Return the height of the actual image.
virtual int dataw ()=0
 Return the width of the image in memory (the actual or preview), or 0 if neither is in memory.
virtual int datah ()=0
 Return the height of the image in memory (the actual or preview), or 1 if neither is in memory.
virtual void clear ()=0
 Clear all data contained in this image.
virtual unsigned chargetImageBuffer ()=0
virtual int doneWithBuffer (unsigned char *buffer)=0
- Public Member Functions inherited from Laxkit::anObject
 anObject ()
 Set object_id=getUniqueNumber().
virtual ~anObject ()
 Empty virtual destructor.
virtual const charwhattype ()
 Returns the type of anObject.
virtual anObjectduplicate (anObject *ref=NULL)
virtual int inc_count ()
 Increment the data's count by 1. Returns count.
virtual int dec_count ()
 Decrement the count of the data, deleting if count is less than or equal to 0.
virtual int the_count ()

Public Attributes

char delpreview
 1 to unlink previewfile in the destructor, else 0.
charfilename
charpreviewfile
clock_t lastaccesstime
- Public Attributes inherited from Laxkit::anObject
int suppress_debug
DeleteRefCountedFunc deleteMe
 Called when the count is decremented to 0.
unsigned long object_id
charobject_idstr

Additional Inherited Members

- Protected Attributes inherited from Laxkit::anObject
int _count
 The reference count of the object.

Detailed Description

Abstraction around images.

The purpose of this class is to provide a relatively simple abstraction of images to make simple image loading easy, such as for icons. There is also a mechanism to allow a preview image to shadow the actual image. See previewfile for more.

If filename exists, but w()<=0, then the filename is invalid. Otherwise, the w() and h() refer to the actual width and height of the image. Same goes for previewfile, dataw(), and datah().

Todo:
dataw() and datah() should be renamed pw() and ph(), plus might be useful to have a imagew() and imageh() for the dims of the thing that image points to.

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

Mon Feb 17 2014 11:52:59, Laxkit