DzImageMgr Class Reference
[Manager ObjectsFile Input and Output Objects]

Manager class for all loaded images. More...

Inheritance diagram for DzImageMgr:

QObject Object List of all members.

Methods

void deleteUnusedTextureObjects ()
DzTexture findImage (String fullPath)
String findLayerImageFile (String path, Boolean askUser)
Boolean findLayerImageFiles (String filename)
DzTexture getImage (String fullPath)
DzTexture getImage (Number which)
String getImageOpenPath ()
String getImageSavePath ()
Number getNumImages ()
void imagePrepared (DzTexture img, String tempName)
DzError loadImage (String filename, Image img, Number importerIdx=-1)
DzError loadLayeredImage (String filename, DzLayeredImage img, Number importerIdx=-1)
void prepareAllImages (DzRenderer r)
void refresh ()
DzError saveImage (String filename, Image image, Number exporterIdx=-1)
DzError saveLayeredImage (String filename, DzLayeredImage image, Number exporterIdx=-1)
void setImageOpenPath (String path)
void setImageSavePath (String path)

Signals

void autoRefreshChanged (Boolean onOff)
 Signature: "autoRefreshChanged(bool)"
void imageListChanged ()
 Signature: "imageListChanged()"

Detailed Description

Manager class for all loaded images.

There is only one instance of this manager in an application. This instance is created and owned by DzApp. Don't create an instance of this class, but rather request a pointer to it from DzApp via DzApp::getImageMgr().


Member Function Documentation

DzImageMgr::autoRefreshChanged ( Boolean  onOff  )  [signal]

Signature: "autoRefreshChanged(bool)"

Emitted when the auto refresh state changes

void DzImageMgr::deleteUnusedTextureObjects (  ) 

This method is called from the 3D viewports to clear out any texture objects that are no longer being used. It has to be called only when a Studio OGL context is current.

DzTexture DzImageMgr::findImage ( String  fullPath  ) 

Parameters:
path The full path of the image file to find a DzTexture instance for.
Returns:
A currently loaded image object whose source matches the given image filename. NULL if no match is found.

String DzImageMgr::findLayerImageFile ( String  path,
Boolean  askUser 
)

Attempts to locate a file referenced by a layered image.

Parameters:
path The path of the file referenced by a layered image.
askUser If true, the user will be prompted to locate the file if it is not found in a mapped directory. If false, the user will not be prompted.
Returns:
The path of the file that was found, or an empty string if the file could not be located.

String DzImageMgr::findLayerImageFiles ( String  filename  ) 

Attempts to locate all the files referenced by a layered image.

Parameters:
filename The layered image to locate files for.
Returns:
true if all the referenced files were found, otherwise, false.

DzTexture DzImageMgr::getImage ( String  fullPath  ) 

Parameters:
fullPath The full path of the image file to get a DzTexture instance for.
Returns:
A currently loaded image object whose source matches the given image filename. If the image is not already loaded, it is loaded and the new image is returned.

DzTexture DzImageMgr::getImage ( Number  which  ) 

Parameters:
which The index of the image to return.
Returns:
The image at the given index, NULL if the index is not valid.

String DzImageMgr::getImageOpenPath (  ) 

Returns:
Last directory that images were loaded from.

String DzImageMgr::getImageSavePath (  ) 

Returns:
Last directory that images were saved to.

Number DzImageMgr::getNumImages (  ) 

Returns:
Number of currently available images.

void DzImageMgr::imageListChanged (  )  [signal]

Signature: "imageListChanged()"

Emitted when an image is added to or removed from the list.

void DzImageMgr::imagePrepared ( DzTexture  img,
String  tempName 
)

Called by the framework to notify the manager that the image has been prepared for the offline renderer.

Parameters:
img A pointer to the image that has been prepared.
tempName The new temporary name for the image.

DzError DzImageMgr::loadImage ( String  filename,
Image  img,
Number  importerIdx = -1 
)

Reads an image from a file.

Parameters:
filename Name of the image file to load.
img The image that the file will be loaded into.
importerIdx The index of the importer to use to load the image. If less than zero, the manager will attempt to find an importer that can load the file.
Returns:
DZ_NO_ERROR on success.

DzError DzImageMgr::loadLayeredImage ( String  filename,
DzLayeredImage  img,
Number  importerIdx = -1 
)

Reads an image from a file.

Parameters:
filename Name of the image file to load.
img The image that the file will be loaded into.
importerIdx The index of the importer to use to load the image. If less than zero, the manager will attempt to find an importer that can load the file.
Returns:
DZ_NO_ERROR on success.

void DzImageMgr::prepareAllImages ( DzRenderer  r  ) 

Forces a flush of the background image processing buffer. A renderer should call this function before rendering to ensure that prepareImage() has been called for all the images in use.

Parameters:
r A pointer to the renderer that is about to render the scene.

void DzImageMgr::refresh (  ) 

Reloads any images whose source files have changed

DzError DzImageMgr::saveImage ( String  filename,
Image  image,
Number  exporterIdx = -1 
)

Writes an image to a file.

Parameters:
filename Name of the image file to save.
image The image to save.
exporterIdx The index of the exmporter to use to save the image. If less than zero, the manager will attempt to find an appropriate exporter based on the filename extension.
Returns:
DZ_NO_ERROR if the file was saved successfully.

DzError DzImageMgr::saveLayeredImage ( String  filename,
DzLayeredImage  image,
Number  exporterIdx = -1 
)

Writes an image to a file.

Parameters:
filename Name of the image file to save.
image The image to save.
exporterIdx The index of the exmporter to use to save the image. If less than zero, the manager will attempt to find an appropriate exporter based on the filename extension.
Returns:
DZ_NO_ERROR if the file was saved successfully.

void DzImageMgr::setImageOpenPath ( String  path  ) 

Sets the file path that a file open dialog will point to for images.

Parameters:
path The folder path that the open image dialogs will default to.

void DzImageMgr::setImageSavePath ( String  path  ) 

Sets the file path that a file save dialog will point to for images.

Parameters:
path The folder path that the save image dialogs will default to.


Generated on Thu Sep 24 12:21:12 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.