Image Class Reference
[ECMAScript/QtScript - Native Objects]

Qt Image type. More...

Inheritance diagram for Image:

Object List of all members.

Properties

Boolean alphaBuffer
Number depth
Number dotsPerMeterX
Number dotsPerMeterY
Number height
Number numColors
Point offset
Rect rect
Size size
Number width

Methods

Color color (Number index)
Image convertDepth (Number depth)
Image copy (Rect rect)
Image copy (Number x, Number y, Number w, Number h)
Image copy ()
void create (Size size, Number depth, Number numColors=0)
void create (Number w, Number h, Number depth, Number numColors=0)
void fill (Color color)
void invertPixels (Boolean invertAlpha=true)
Boolean isNull ()
void load (String filename)
Image mirror (bool horizontal, bool vertical)
Image mirror ()
Color pixel (Number x, Number y)
void save (String filename)
Image scale (Number width, Number height)
Image scale (Size size)
void setColor (Number index, Color color)
void setPixel (Number x, Number y, Color color)
Image smoothScale (Number width, Number height)
Image smoothScale (Size size)
Image swapRGB ()

Constructors

 Image (Image image)
 Image (String filename)
 Image ()

Detailed Description

Qt Image type.

This is the DAZ Script counterpart of the QImage type used in the DAZ Studio SDK.


Constructor & Destructor Documentation

Image::Image (  ) 

Default Constructor.

Image::Image ( String  filename  ) 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
filename The name of the file to load the image's data from

Image::Image ( Image  image  ) 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
image The image to copy


Member Function Documentation

Color Image::color ( Number  index  ) 

Gets a color value from the color table for the image only valid for

Parameters:
index The index of the color to look up in the table
Returns:
The RGB value of the color at the given index.

Image Image::convertDepth ( Number  depth  ) 

Creates a copy of the image with the given color depth

Parameters:
depth The color depth to convert the image to
Returns:
The image converted to the new color depth

Image Image::copy ( Rect  rect  ) 

Creates a copy of a portion of the image

Parameters:
rect The area to copy
Returns:
A new copy of the specified area of the image

Image Image::copy ( Number  x,
Number  y,
Number  w,
Number  h 
)

Creates a copy of a portion of the image

Parameters:
x The x position of the area to copy
y The y position of the area to copy
w The width of the area to copy
h The height of the area to copy
Returns:
A new copy of the specified area of the image

Image Image::copy (  ) 

Creates a copy of the image

Returns:
A new copy of the image

void Image::create ( Size  size,
Number  depth,
Number  numColors = 0 
)

Clears the image data and creates a new image with the given settings

Parameters:
size The new size for the image
depth The new color depth for the image
numColors The number of colors for the new image

void Image::create ( Number  w,
Number  h,
Number  depth,
Number  numColors = 0 
)

Clears the image data and creates a new image with the given settings

Parameters:
w The new width for the image
h The new height for the image
depth The new color depth for the image
numColors The number of colors for the new image

void Image::fill ( Color  color  ) 

Fills the image with color.

Parameters:
color The color to set the pixels of the image.

void Image::invertPixels ( Boolean  invertAlpha = true  ) 

Inverts all pixels in the image.

Parameters:
invertAlpha If the image has a 32 bit depth, and this is true, the alpha channel will also be inverted, otherwise the alpha channel is unaffected.

Boolean Image::isNull (  ) 

Gets whether or not the image is Null.

Returns:
true if the image is Null (empty), false if the image has data.

void Image::load ( String  filename  ) 

Loads data for the image from a file

Parameters:
filename The name of the file to load into the image

Image Image::mirror ( bool  horizontal,
bool  vertical 
)

Creates a copy of this image that has been mirrored

Parameters:
horizontal If true, the image will be mirrored horizontally
vertical If true, the image will be mirrored vertically
Returns:
The mirrored copy of the image

Image Image::mirror (  ) 

Creates a copy of this image that has been mirrored vertically

Returns:
The mirrored copy of the image

Color Image::pixel ( Number  x,
Number  y 
)

Gets the color value of an individual pixel

Parameters:
x The x position of the pixel
y The y position of the pixel
Returns:
The value of the pixel at the given location

void Image::save ( String  filename  ) 

Saves the image to a file.

Parameters:
filename The name of the file to save the image to.

Image Image::scale ( Number  width,
Number  height 
)

Creates a new image that is a scaled version of this image

Parameters:
width The width of the new image
height The hieght of the new image
Returns:
The new scaled image

Image Image::scale ( Size  size  ) 

Creates a new image that is a scaled version of this image

Parameters:
size The size of the new image
Returns:
The new scaled image

void Image::setColor ( Number  index,
Color  color 
)

Sets the color value of a color in the color table.

Parameters:
index The index of the color in the color table to change
color The new value for the color.

void Image::setPixel ( Number  x,
Number  y,
Color  color 
)

Sets the color value of the given pixel

Parameters:
x The x position of the pixel to change
y The y position of the pixel to change
color The new value for the pixel

Image Image::smoothScale ( Number  width,
Number  height 
)

Creates a new image that is a scaled version of this image

Parameters:
width The width of the new image
height The hieght of the new image
Returns:
The new scaled image

Image Image::smoothScale ( Size  size  ) 

Creates a new image that is a scaled version of this image

Parameters:
size The size of the new image
Returns:
The new scaled image

Image Image::swapRGB (  ) 

Creates a copy of the image in which the Red and Blue values have been swapped

Returns:
A BGR version of the image.


Member Data Documentation

Boolean Image::alphaBuffer

Whether or not the image has an alpha channel

Number Image::depth

The color depth of the image (Read-Only)

Number Image::dotsPerMeterX

The X resolution of the image

Number Image::dotsPerMeterY

The Y resolution of the image

Number Image::height

The height of the image (Read-Only)

Number Image::numColors

The number of colors in the image

Point Image::offset

The number of pixels to offset the image when positioning it

Rect Image::rect

The enclosing rectangle of the image (Read-Only)

Size Image::size

The size of the image (Read-Only)

Number Image::width

The width of the image (Read-Only)


Generated on Thu Sep 24 12:21:16 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.