Public Member Functions
ImageClip2 Class Reference

## Detailed Description

An ImageClip2 object is an instance of an image Source and is used as the container for applying composited image effects.

You can get the Source object corresponding to the ImageClip2 using Clip::Source. Applications never create image clips explicitly. Instead, they are created by calling the AddImageClip command.

Note:
  In order to fix a class hierarchy problem, this class was introduced in v4.0. Although the class name is ImageClip2 it corresponds to the object model ImageClip object and its class id returned by CBase::GetClassID is siImageClipID.

See also:
  Source, Material::GetCurrentImageClip2

Since:
  4.0

Example:
  Illustrates how to get the file name, X and Y resolution from an ImageClip2 object by getting the Source corresponding to the image clip.

            using namespace XSI;
            Application app;
            CString strImagePath = app.GetInstallationPath(siFactoryPath) ;
            strImagePath += L"Data/XSI_SAMPLES/Pictures/circlelight3.tga" ;

            CValueArray args(1);
            CValue valImageClip2;
            args[0] = strImagePath ;

            app.ExecuteCommand( L"CreateImageClip", args, valImageClip2 );

            ImageClip2 clip( valImageClip2 );

            //retreiving the image source
            Source clipSource(clip.GetSource());

            CValue fileName = clipSource.GetParameterValue( L"path");
            CValue XRes = clipSource.GetParameterValue( L"XRes");
            CValue YRes = clipSource.GetParameterValue( L"YRes");

            app.LogMessage(L"The image file is : " + fileName.GetAsText());
            app.LogMessage(L"The image x resolution is : " + XRes.GetAsText());
            app.LogMessage(L"The image y resolution is : " + YRes.GetAsText());

`#include <xsi_imageclip2.h>`

Inheritance diagram for ImageClip2:
[legend]

List of all members.

## Public Member Functions
| ImageClip2 ()
| ~ImageClip2 ()
| ImageClip2 (const CRef &in_ref)
| ImageClip2 (const ImageClip2 &in_obj)
bool | IsA (siClassID in_ClassID) const
siClassID | GetClassID () const
ImageClip2 & | operator= (const ImageClip2 &in_obj)
ImageClip2 & | operator= (const CRef &in_ref)
Image | GetImage (double in_dblFrame=DBL_MAX)
Image | GetScaledDownImage (LONG in_Ratio, double in_dblFrame=DBL_MAX)
CString | GetFileName (double in_dblFrame)
CRefArray | GetShaderParameterTargets () const
HardwareSurface | GetHardwareSurface (HardwareSurface::Options &in_options) const

## Constructor & Destructor Documentation

ImageClip2 | ( |  | ) |

Default constructor.

~ImageClip2 | ( |  | ) |

Default destructor.

ImageClip2 | ( | const CRef & | in_ref | ) |

Constructor.

Parameters:

  in_ref | constant reference object.

ImageClip2 | ( | const ImageClip2 & | in_obj | ) |

Copy constructor.

Parameters:

  in_obj | constant class object.

## Member Function Documentation

bool IsA | ( | siClassID | in_ClassID | ) | const`[virtual]`

Returns true if a given class type is compatible with this API class.

Parameters:

  in_ClassID | class type.

Returns:
  true if the class is compatible, false otherwise.

Reimplemented from Clip.

siClassID GetClassID | ( |  | ) | const`[virtual]`

Returns the type of the API class.

Returns:
  The class type.

Reimplemented from Clip.

ImageClip2& operator= | ( | const ImageClip2 & | in_obj | ) |

Creates an object from another object. The newly created object is set to empty if the input object is not compatible.

Parameters:

  in_obj | constant class object.

Returns:
  The new ImageClip object.

ImageClip2& operator= | ( | const CRef & | in_ref | ) |

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:

  in_ref | constant class object.

Returns:
  The new ImageClip2 object.

Reimplemented from Clip.

Image GetImage | ( | double | in_dblFrame = `DBL_MAX` | ) |

Provides access to the image data.

Note:
  For performance considerations you should only call this function when the plug-in intends to read actual pixel values. The resolution can be determined more quickly via the Source object, as demonstrated in the example above.

Parameters:

  in_dblFrame | This optional argument permits retrieval of any frame within an image sequence or movie file. If not specified, the frame pulled is the frame corresponding to the current play position at the time the ImageClip2 object was instantiated.

Returns:
  The requested Image data

Image GetScaledDownImage | ( | LONG | in_Ratio,
|  | double | in_dblFrame = `DBL_MAX`
| ) |  |

Returns a smaller version of the Image. For circumstances where the full resolution of an image is not necessary, you can improve performance by requesting a reduced image. If you are only generating a thumbnail it is overkill to read millions of pixels from a film resolution image.

Note:
  The user preferences `preferences.rendering.maximum_proxy_level` and `preferences.rendering.minimum_proxy_size` can influence the results of this call. The image returned may be larger than requested.

Parameters:

  in_Ratio | Requested ratio for reduction. Based on the siImageRatio enum.
  in_dblFrame | This optional argument permits retrieval of any frame within an image sequence or movie file. If not specified, the frame pulled is the frame corresponding to the current play position at the time the ImageClip2 object was instantiated.

Returns:
  Image representing the reduced image

CString GetFileName | ( | double | in_dblFrame | ) |

Returns the image file name for this clip.

Parameters:

  in_dblFrame | This optional argument permits retrieval of any frame within an image sequence or movie file. If not specified, the frame pulled is the frame corresponding to the current play position at the time the ImageClip2 object was instantiated.

Returns:
  The requested image file name.

Since:
  5.0

CRefArray GetShaderParameterTargets | ( |  | ) | const

Returns the shader input parameters connected to the image clip.

Returns:
  An array of references to Parameter objects.

Since:
  7.0

HardwareSurface GetHardwareSurface | ( | HardwareSurface::Options & | in_options | ) | const

Returns a hardware surface version of this image clip

Returns:
  The HardwareSurface object

Since:
  9.0 (2011)

The documentation for this class was generated from the following file:

- xsi_imageclip2.h