JWM Source Documentation
Data Structures | Typedefs | Functions
image.h File Reference

Functions to load images. More...

Go to the source code of this file.

Data Structures

struct  ImageNode
 Structure to represent an image. More...
 

Typedefs

typedef struct ImageNode ImageNode
 Structure to represent an image.
 

Functions

ImageNodeLoadImage (const char *fileName, int width, int height, char preserveAspect)
 Load an image from a file.
 
ImageNodeLoadImageFromDrawable (Drawable pmap, Pixmap mask)
 Load an image from a Drawable.
 
ImageNodeCreateImage (unsigned int width, unsigned int height, char bitmap)
 Create an image node.
 
void DestroyImage (ImageNode *image)
 Destroy an image node.
 

Detailed Description

Functions to load images.

Author
Joe Wingbermuehle
Date
2005-2014

Definition in file image.h.

Typedef Documentation

typedef struct ImageNode ImageNode

Structure to represent an image.

Function Documentation

ImageNode* CreateImage ( unsigned int  width,
unsigned int  height,
char  bitmap 
)

Create an image node.

Parameters
widthThe image width.
heightThe image height.
bitmap1 if a bitmap, 0 otherwise.
Returns
A newly allocated image node.
void DestroyImage ( ImageNode image)

Destroy an image node.

Parameters
imageThe image to destroy.

Definition at line 623 of file image.c.

References ImageNode::data, ImageNode::next, and Release.

Referenced by DoDestroyIcon(), GetScaledIcon(), LoadNamedIcon(), LoadNamedIconHelper(), and LoadPNGImage().

ImageNode* LoadImage ( const char *  fileName,
int  width,
int  height,
char  preserveAspect 
)

Load an image from a file.

Parameters
fileNameThe file containing the image.
widthThe preferred width.
heightThe preferred height.
preserveAspectSet to preserve image aspect when scaling.
Returns
A new image node (NULL if the image could not be loaded).

Definition at line 67 of file image.c.

References JUNLIKELY, LoadPNGImage(), LoadXPMImage(), and StrCmpNoCase().

Referenced by GetBestImage(), LoadNamedIcon(), and LoadNamedIconHelper().

ImageNode* LoadImageFromDrawable ( Drawable  pmap,
Pixmap  mask 
)

Load an image from a Drawable.

Parameters
pmapThe drawable.
maskThe mask (may be None).
Returns
a new image node (NULL if there were errors).

Definition at line 146 of file image.c.

References CreateImageFromXImages(), display, IconNode::height, JXDestroyImage, JXGetGeometry, JXGetImage, and IconNode::width.

Referenced by CreateIconFromDrawable().

joewing.net / Projects / JWM