User Tools

Site Tools


DzImageMgr

Manager responsible for the importing/exporting of images/textures.

More...

Inherits :

Static Methods

Methods

Signals

Detailed Description

Responsible for the management of image (texture) importers/exporters, as well as the lifetime (loading/unloading) and preparation (for display/rendering) of images used as textures for scene items.

There is only one instance of this manager in an application. This instance is created and owned by DzApp. Request the instance via DzApp::getImageMgr().

See Also:

Static Methods


Object : getExporterInfo( Number i )

Gets exporter information.

Parameter(s):

  • i - The index of the image exporter to get information about.

Return Value:

  • The exporter information - i.e., description, extension.

Since:

  • 4.15.1.97

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

Object : getImporterInfo( Number i )

Gets importer information.

Parameter(s):

  • i - The index of the image importer to get information about.

Return Value:

  • The importer information - i.e., description, extensions.

Since:

  • 4.15.1.97

Number : getNumExporters()

Return Value:

  • The number of exporters currently supported.

Since:

  • 4.15.1.97

Number : getNumImporters()

Return Value:

  • The number of importers currently supported.

Since:

  • 4.15.1.97

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.