Image

class HPS.Image : public IDisposable

The Image class contains objects for importing image files and enumerations used when defining images in Visualize.

Public Types

enum Format

Enumerates the various image formats that Visualize supports.

Values:

RGB

Uncompressed, one unsigned byte per channel, three unsigned bytes per pixel, RGB order.

RGBA

Uncompressed, one unsigned byte per channel, four unsigned bytes per pixel, RGBA order.

ARGB

Uncompressed, one unsigned byte per channel, four unsigned bytes per pixel, ARGB order.

Mapped8

Uncompressed, one unsigned byte per pixel, each unsigned byte is an index into a material palette.

Grayscale

Uncompressed, one unsigned byte per pixel.

Bmp

Uncompressed, 1bpp (Mono), 8 bpp (Greyscale), 16 bpp (ARGB/RGB), 24bpp (RGB), 32bpp (ARGB).

Jpeg

Compressed, JPEG format.

Png

Compressed, PNG format.

Targa

Compressed, TARGA Format.

DXT1

Compressed, DXT1 Format.

DXT3

Compressed, DXT3 Format.

DXT5

Compressed, DXT5 Format.

Public Functions

void Dispose ()
Image (HPS.Image in_that)
class ExportOptionsKit : public HPS.Kit

The HPS.Image.ExportOptionsKit class contains options that will be used to export image files. Calling HPS.Image.ExportOptionsKit.GetDefault() will return an options kit with values found in this table.

Public Functions

override void Dispose ()
override bool Empty ()

Indicates whether this ExportOptionsKit has any values set on it.

Return

true if no values are set on this ExportOptionsKit, false otherwise.

bool Equals (HPS.Image.ExportOptionsKit in_kit)

Check if the source ExportOptionsKit is equivalent to this ExportOptionsKit.

Param in_kit

The source ExportOptionsKit to compare to this ExportOptionsKit.

Return

true if the objects are equivalent, false otherwise.

override bool Equals (Object obj)
ExportOptionsKit ()

The default constructor creates an empty ExportOptionsKit object.

ExportOptionsKit (HPS.Image.ExportOptionsKit in_kit)

The copy constructor creates a new ExportOptionsKit object that contains the same settings as the source ExportOptionsKit.

Param in_kit

The source ExportOptionsKit to copy.

override int GetHashCode ()
override HPS.Type ObjectType ()

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Return

The declared type of the object in question, which may differ from the true, underlying type.

void Set (HPS.Image.ExportOptionsKit in_kit)

Copies the source ExportOptionsKit into this ExportOptionsKit.

Param in_kit

The source ExportOptionsKit to copy.

HPS.Image.ExportOptionsKit SetFormat (HPS.Image.Format in_format)

Sets the format of the image. This must be specified when exporting any image.

See

Export format default value

Param in_format

The format of the image.

Return

A reference to this ExportOptionsKit.

HPS.Image.ExportOptionsKit SetSize (uint in_width, uint in_height)

Sets the width and height (in pixels) of the image. If this is not specified , an exception will be thrown on export.

Param in_width

The width (in pixels) of the image.

Param in_height

The height (in pixels) of the image.

Return

A reference to this ExportOptionsKit.

HPS.Image.ExportOptionsKit SetTransparentBackground (bool in_state)

Sets whether the image background will be transparent. This setting is only valid when exporting a PNG image.

Param in_state

Whether the image background will be transparent.

Return

A reference to this ExportOptionsKit.

void Show (out HPS.Image.ExportOptionsKit out_kit)

Copies this ExportOptionsKit into the given ExportOptionsKit.

Param out_kit

The ExportOptionsKit to populate with the contents of this ExportOptionsKit.

bool ShowFormat (out HPS.Image.Format out_format)

Shows the format of the image.

Param out_format

The format of the image.

Return

true if the format is valid, false otherwise.

bool ShowSize (out uint out_width, out uint out_height)

Shows the width and height (in pixels) of the image.

Param out_width

The width (in pixels) of the image.

Param out_height

The height (in pixels) of the image.

Return

true if the width and height are valid, false otherwise.

bool ShowTransparentBackground (out bool out_state)

Shows transparent background setting for this image

Param out_state

The transparent background setting for this image.

Return

true if a background preference was specified, false otherwise.

HPS.Image.ExportOptionsKit UnsetEverything ()

Removes all settings from this ExportOptionsKit.

Return

A reference to this ExportOptionsKit.

HPS.Image.ExportOptionsKit UnsetFormat ()

Removes the format of the image.

Return

A reference to this ExportOptionsKit.

HPS.Image.ExportOptionsKit UnsetSize ()

Removes the width and height of the image.

Return

A reference to this ExportOptionsKit.

HPS.Image.ExportOptionsKit UnsetTransparentBackground ()

Removes the transparent background setting of the image.

Return

A reference to this ExportOptionsKit.

Public Static Functions

HPS.Image.ExportOptionsKit GetDefault ()

Creates a ExportOptionsKit which contains the default settings. The returned object will not necessarily have values set for every option, but it will have settings for those options where it is reasonable to have a default.

Return

A ExportOptionsKit with the default settings.

bool operator!= (HPS.Image.ExportOptionsKit a, HPS.Image.ExportOptionsKit b)
bool operator== (HPS.Image.ExportOptionsKit a, HPS.Image.ExportOptionsKit b)
class File : public IDisposable

The File class provides a function to import and export image files.

Public Functions

void Dispose ()
File (HPS.Image.File in_that)

Public Static Functions

void Export (string in_file_name, HPS.ImageKit in_image_kit)

Performs a synchronous export to an image from the specified ImageKit May throw an exception if a problem occurs during export, or if the image kit provided is incomplete

Param in_file_name

Name of image file to which to save the data.

Param in_image_kit

ImageKit containing the data, size and format of the image to be exported

void Export (string in_file_name, HPS.WindowKey in_window, HPS.Image.ExportOptionsKit in_options)

Performs a synchronous export to an image of the specified window. May throw an IOException if a problem occurs during export.

Param in_file_name

Name of image file to which to save the data.

Param in_window

The WindowKey where the screen-shot will be taken

Param in_options

Options to use during export. If the option does not have size defined the size of in_window is used.

void Export (string in_file_name, HPS.WindowKey in_window, uint in_width, uint in_height)

Performs a synchronous export to an image of the specified window. May throw an IOException if a problem occurs during export.

Param in_file_name

Name of image file to which to save the data.

Param in_window

The WindowKey where the screen-shot will be taken

Param in_width

The width of the exported image, in pixels

Param in_height

The height of the exported image, in pixels

void Export (string in_file_name, HPS.WindowKey in_window, uint in_width, uint in_height, HPS.Image.Format in_format)

Performs a synchronous export to an image of the specified window. May throw an IOException if a problem occurs during export.

Param in_file_name

Name of image file to which to save the data.

Param in_window

The WindowKey where the screen-shot will be taken

Param in_width

The width of the exported image, in pixels

Param in_height

The height of the exported image, in pixels

Param in_format

The format of the exported image, defaults to PNG

void Export (string in_file_name, HPS.WindowKey in_window, uint in_width, uint in_height, HPS.Image.Format in_format, bool in_transparent_background)

Performs a synchronous export to an image of the specified window. May throw an IOException if a problem occurs during export.

Param in_file_name

Name of image file to which to save the data.

Param in_window

The WindowKey where the screen-shot will be taken

Param in_width

The width of the exported image, in pixels

Param in_height

The height of the exported image, in pixels

Param in_format

The format of the exported image, defaults to PNG

Param in_transparent_background

Whether to render the background as transparent. Only valid if in_format is PNG. Defaults to false.

HPS.ImageKit Import (string in_file_name, HPS.Image.ImportOptionsKit in_options)

Performs a synchronous import of the specified image file. The function returns an ImageKit with the data from the image file and with the specified options. May throw an IOException if a problem occurs during import.

Param in_file_name

Name of image file from which to get the data.

Param in_options

Options to use during import and to set on the ImageKit returned by this function.

Return

An ImageKit containing the data from the specified file and with the specified options.

class ImportOptionsKit : public HPS.Kit

The ImportOptionsKit class contains options that will be used to import image files and will be set on the ImageKit returned by File.Import.

Public Functions

override void Dispose ()
override bool Empty ()

Indicates whether this ImportOptionsKit has any values set on it.

Return

true if no values are set on this ImportOptionsKit, false otherwise.

bool Equals (HPS.Image.ImportOptionsKit in_kit)

Check if the source ImportOptionsKit is equivalent to this ImportOptionsKit.

Param in_kit

The source ImportOptionsKit to compare to this ImportOptionsKit.

Return

true if the objects are equivalent, false otherwise.

override bool Equals (Object obj)
override int GetHashCode ()
ImportOptionsKit ()

The default constructor creates an empty ImportOptionsKit object.

ImportOptionsKit (HPS.Image.ImportOptionsKit in_kit)

The copy constructor creates a new ImportOptionsKit object that contains the same settings as the source ImportOptionsKit.

Param in_kit

The source ImportOptionsKit to copy.

override HPS.Type ObjectType ()

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Return

The declared type of the object in question, which may differ from the true, underlying type.

void Set (HPS.Image.ImportOptionsKit in_kit)

Copies the source ImportOptionsKit into this ImportOptionsKit.

Param in_kit

The source ImportOptionsKit to copy.

HPS.Image.ImportOptionsKit SetCompressionQuality (float in_quality)

Sets the compression quality for the image. This setting will be copied over to the ImageKit returned from File.Import. It doesn’t need to be set for the import to succeed.

Param in_quality

The compression quality for the image.

Return

A reference to this ImportOptionsKit.

HPS.Image.ImportOptionsKit SetDownSampling (bool in_state)

Sets whether to down-sample the image. This setting will be copied over to the ImageKit returned from File.Import. It doesn’t need to be set for the import to succeed.

Param in_state

Whether to down-sample the image.

Return

A reference to this ImportOptionsKit.

HPS.Image.ImportOptionsKit SetFormat (HPS.Image.Format in_format)

Sets the format of the image. This must be specified when importing any image.

Param in_format

The format of the image.

Return

A reference to this ImportOptionsKit.

HPS.Image.ImportOptionsKit SetSize (uint in_width, uint in_height)

Sets the width and height (in pixels) of the image. This does not need to be set when importing image files which contain this information (i.e., Image.Jpeg, Image.Png or Image.Targa). If this is not specified for images files which do not contain this information, an exception will be thrown on import.

Param in_width

The width (in pixels) of the image.

Param in_height

The height (in pixels) of the image.

Return

A reference to this ImportOptionsKit.

void Show (out HPS.Image.ImportOptionsKit out_kit)

Copies this ImportOptionsKit into the given ImportOptionsKit.

Param out_kit

The ImportOptionsKit to populate with the contents of this ImportOptionsKit.

bool ShowCompressionQuality (out float out_quality)

Shows the compression quality for the image.

Param out_quality

The compression quality for the image.

Return

true if the compression quality is valid, false otherwise.

bool ShowDownSampling (out bool out_state)

Shows whether to down-sample the image.

Param out_state

whether to down-sample the image.

Return

true if the flag is valid, false otherwise.

bool ShowFormat (out HPS.Image.Format out_format)

Shows the format of the image.

Param out_format

The format of the image.

Return

true if the format is valid, false otherwise.

bool ShowSize (out uint out_width, out uint out_height)

Shows the width and height (in pixels) of the image.

Param out_width

The width (in pixels) of the image.

Param out_height

The height (in pixels) of the image.

Return

true if the width and height are valid, false otherwise.

HPS.Image.ImportOptionsKit UnsetCompressionQuality ()

Removes the compression quality for the image.

Return

A reference to this ImportOptionsKit.

HPS.Image.ImportOptionsKit UnsetDownSampling ()

Removes whether to down-sample the image.

Return

A reference to this ImportOptionsKit.

HPS.Image.ImportOptionsKit UnsetEverything ()

Removes all settings from this ImportOptionsKit.

Return

A reference to this ImportOptionsKit.

HPS.Image.ImportOptionsKit UnsetFormat ()

Removes the format of the image.

Return

A reference to this ImportOptionsKit.

HPS.Image.ImportOptionsKit UnsetSize ()

Removes the width and height of the image.

Return

A reference to this ImportOptionsKit.

Public Static Functions

bool operator!= (HPS.Image.ImportOptionsKit a, HPS.Image.ImportOptionsKit b)
bool operator== (HPS.Image.ImportOptionsKit a, HPS.Image.ImportOptionsKit b)