User Tools

Site Tools


DzImageMgr

Manager class for all loaded images.

More...

Inherits :

Static Methods

DAZ Script
SizegetImageSize ( String imagePath )

Methods

Signals

Detailed Description

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().

Static Methods


Size : getImageSize( String imagePath )

Parameter(s):

  • imagePath - The full path of an image file to get the size of.

Return Value:

  • The size of the image, without actually reading the image contents. If the image format does not support this feature, this function returns an invalid size.

Since:

  • 4.9.3.82

Methods


void : beginEditingImage()

Called prior to editing an image; pauses image preparation.


DzLayeredTexture : createLayeredTexture( String name )

Parameter(s):

  • name - The name of the layered texture to create.

Return Value:

  • A sharable object that stores information for a layered texture (image map) that is used in OpenGL.

void : 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 : findImage( String fullPath )

Parameter(s):

  • path - The full path of the image file to find a DzTexture instance for.

Return Value:

  • A currently loaded image object whose source matches the given image filename (if any), otherwise NULL.

DzTexture : findImageByName( String name )

Parameter(s):

  • name - The name of the image to find.

Return Value:

  • The image with the given name (if any), otherwise NULL.

DzLayeredTexture : findLayeredTexture( DzUri uri )

Parameter(s):

  • uri - The URI of the layered texture to find.

Return Value:

  • The found layered texture (if any), otherwise null.

DzTexture : findTexture( DzUri uri )

Parameter(s):

  • uri - The URI of the texture to find.

Return Value:

  • The found texture (if any), otherwise null.

void : finishedEditingImage( DzTexture img )

Called after editing an image; restarts image preparation.

Parameter(s):

  • img - The image to add to the preparation list.

DzTexture : getImage( Number which )

Parameter(s):

  • which - The index of the image to return.

Return Value:

  • The image at the given index (if valid), otherwise NULL.

DzTexture : getImage( String fullPath, Number creationGamma )

Parameter(s):

  • fullPath - The full path of the image file to get a DzTexture instance for.
  • creationGamma - The gamma to set on this DzTexture instance if this function creates it.

Return Value:

  • 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 : getImage( String fullPath )

Parameter(s):

  • fullPath - The full path of the image file to get a DzTexture instance for.

Return Value:

  • 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 : getImage( String fullPath, Number creationGamma, Number creationType )

Parameter(s):

  • fullPath - The full path of the image file to get a DzTexture instance for.
  • creationGamma - The gamma to set on this DzTexture instance if this function creates it.
  • creationType - The texture type to set on this DzTexture instance if this function creates it.

Return Value:

  • 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.

String : getImageOpenPath()

Return Value:

  • The path of the last directory that images were loaded from.

String : getImageSavePath()

Return Value:

  • The path of the last directory that images were saved to.

Number : getNumImages()

Return Value:

  • The number of currently available images.

String : getUniqueImageName( String name )

Creates a modified version of the given name if necessary to make it unique.

Parameter(s):

  • name - The image name to make unique.

Return Value:

  • The given name if it is already unique, otherwise a modified copy of the name that is unique.

void : imagePrepared( DzTexture img, String tempName )

Called by the framework to notify the manager that the image has been prepared for the off-line renderer.

Parameter(s):

  • img - The image that has been prepared.
  • tempName - The new temporary name for the image.

Image : loadImage( String filename )

Reads an image from a file.

Parameter(s):

  • filename - The name of the image file to load.

Return Value:

  • The loaded image.

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

Reads an image from a file.

Parameter(s):

  • filename - The 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.

Return Value:

  • DZ_NO_ERROR if the file was loaded successfully, otherwise an appropriate error code.

void : prepareAllImages( DzRenderer r )

Forces a flush of the background image processing buffer.

Parameter(s):

  • r - The renderer that is about to render the scene.

void : refresh()

Reloads any images whose source files have changed.


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

Writes an image to a file.

Parameter(s):

  • filename - The name of the image file to save.
  • image - The image to save.
  • exporterIdx - The index of the exporter to use to save the image. If less than zero, the manager will attempt to find an appropriate exporter based on the filename extension.

Return Value:

  • DZ_NO_ERROR if the file was saved successfully, otherwise an appropriate error code.

void : setImageOpenPath( String path )

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

Parameter(s):

  • path - The folder path that the open image dialogs will default to.

void : setImageSavePath( String path )

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

Parameter(s):

  • path - The folder path that the save image dialogs will default to.

Signals


void : autoRefreshChanged( Boolean onOff )

Signature:“autoRefreshChanged(bool)”

Emitted when the auto refresh state changes.


void : imageListChanged()

Signature:“imageListChanged()”

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