DzLayeredImage Class Reference

Class that implements multi-layered images. More...

Inheritance diagram for DzLayeredImage:

DzBase QObject Object List of all members.

Methods

void addLayer (DzImageLayer layer)
Image getFlattenedImage (Boolean freeMem)
Image getFlattenedImage ()
DzImageLayer getLayer (Number which)
Number getLayerCount ()
Size getSize ()
void insertLayer (DzImageLayer layer, int idx)
void moveLayer (Number from, Number to)
Boolean removeLayer (DzImageLayer layer)
Boolean replaceLayer (DzImageLayer oldLayer, DzImageLayer newLayer)
void setSize (Size size)

Constructors

 DzLayeredImage (DzLayeredImage img)
 DzLayeredImage (Size size)
 DzLayeredImage ()

Signals

void layerListChanged ()
 Signature: "layerListChanged()"
void sizeChanged (Size size)
 Signature: "sizeChanged(const QSize&)"

Detailed Description

Class that implements multi-layered images.

This class uses explicit sharing to make it very efficient to copy. This does, however, mean that modifying one copy of the image modifies all copies. DzLayeredImage does not currently support detach() or copy() functions for creating unique instances or deep copies.


Constructor & Destructor Documentation

DzLayeredImage::DzLayeredImage (  ) 

Constructor.

DzLayeredImage::DzLayeredImage ( Size  size  ) 

Constructor.

Parameters:
size The size of the canvas for the image.

DzLayeredImage::DzLayeredImage ( DzLayeredImage  img  ) 

Copy Constructor. This class uses explicit sharing to make it very efficient to copy. This does, however, mean that modifying one copy of the image modifies all copies.

Parameters:
img The image to create a copy of.


Member Function Documentation

void DzLayeredImage::addLayer ( DzImageLayer  layer  ) 

Add a layer to the image.

Parameters:
layer A pointer to the layer to add to the image. The image takes ownership of this object and deletes it when it is no longer needed.

Image DzLayeredImage::getFlattenedImage ( Boolean  freeMem  ) 

Parameters:
freeMem If true, any image layers loaded from file will be unloaded immediately after flattening. They will have to be re-loaded again for future flattening operations.
Returns:
An image that is the final result of merging all the visible layers in the image.

Image DzLayeredImage::getFlattenedImage (  ) 

Returns:
An image that is the final result of merging all the visible layers in the image.

DzImageLayer DzLayeredImage::getLayer ( Number  which  ) 

Returns:
A pointer to the layer at index which. This object is owned by the image.

int DzLayeredImage::getLayerCount (  ) 

Returns:
The number of layers in this image.

QSize DzLayeredImage::getSize (  ) 

Returns:
The size of the canvas for this image.

void DzLayeredImage::insertLayer ( DzImageLayer  layer,
int  idx 
)

Insert a layer at a specific index.

Parameters:
layer A pointer to the layer to add to the image. The image takes ownership of this object and deletes it when it is no longer needed.
idx The index in the list to insert the layer at.

void DzLayeredImage::layerListChanged (  )  [signal]

Signature: "layerListChanged()"

Emits a signal that list of layers has changed.

void DzLayeredImage::moveLayer ( Number  from,
Number  to 
)

Adjust layer order.

Parameters:
from The index of the layer to move.
to The index in the list to move the layer to.

bool DzLayeredImage::removeLayer ( DzImageLayer  layer  ) 

Remove specified layer.

Parameters:
layer The layer to remove from the image. The layer will be deleted if it is owned by the image.
Returns:
true if the layer was removed from the image, otherwise false.

DzLayeredImage::replaceLayer ( DzImageLayer  oldLayer,
DzImageLayer  newLayer 
)

Replace a layer with a new layer.

Parameters:
oldLayer A pointer to the layer to remove from the image. The layer will be deleted if it is owned by the image.
newLayer The new layer to add to the image in place of the old layer. The image takes ownership of this object and deletes it when it is no longer used.
Returns:
true if the layer was successfully replaced, otherwise false.

void DzLayeredImage::setSize ( Size  size  ) 

Sets the size of the image's canvas

Parameters:
size The new size for the image's canvas

void DzLayeredImage::sizeChanged ( Size  size  )  [signal]

Signature: "sizeChanged(const QSize&)"

Emits a signal that the size of canvas has changed.


Generated on Thu Sep 24 12:21:13 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.