InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IClippingPathSuite Class Referenceabstract

#include <IClippingPathSuite.h>

Inheritance diagram for IClippingPathSuite:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ICLIPPINGPATHSUITE }
 
enum  { kInvertFlag = 1 << 0, kUseHighResFlag = 1 << 1, kAllowHolesFlag = 1 << 2, kRestrictToFrameFlag = 1 << 3 }
 

Public Member Functions

virtual bool16 CanHaveClippingPath (void) const =0
 
virtual bool16 HasAlphaChannels (void) const =0
 
virtual bool16 HasPhotoshopPaths (void) const =0
 
virtual bool16 HasHighResRaster (void) const =0
 
virtual bool16 CanConvertClippingToFrame (void) const =0
 
virtual IClipSettingsQueryActiveClipSettings (void) const =0
 
virtual IPathGeometryQueryActiveClippingPath (void) const =0
 
virtual ErrorCode ApplyEmbeddedPath (uint16 index, const PMString *pathName, const PMReal &tolerance, const PMReal &minPathSize, const PMReal &inset, uint32 flags) const =0
 
virtual ErrorCode ApplyAlphaChannel (uint16 index, const PMReal &tolerance, const PMReal &minPathSize, const PMReal &inset, uint32 flags, uint8 threshhold) const =0
 
virtual ErrorCode DoDetectEdges (const PMReal &tolerance, const PMReal &minPathSize, const PMReal &inset, uint32 flags, uint8 threshhold) const =0
 
virtual ErrorCode RemoveClipping (void) const =0
 
virtual ErrorCode DoConvertClippingToFrame (void) const =0
 
virtual ErrorCode ApplyUserPathOptions (bool8 bInvert, const PMReal &inset) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

The IClippingPathSuite is used to obtain clipping path information about the current selection and to apply clipping paths to the current selection. As an alternative to clipping paths, you might consider creating a soft mask in Photoshop because InDesign supports native transparency within Photoshop images.

Member Enumeration Documentation

anonymous enum

Default IID

anonymous enum

Flags

Member Function Documentation

virtual ErrorCode IClippingPathSuite::ApplyAlphaChannel (uint16 index,
const PMRealtolerance,
const PMRealminPathSize,
const PMRealinset,
uint32 flags,
uint8 threshhold 
) const
pure virtual

Perform edge detection on a given alpha channel.

Parameters
index
tolerance- a tolerance value specifying how close to the original path we must be if we smooth the path. 0.0 indicates a perfect match. Smoothing may simplify the path, reducing the number of points.
minPathSize- subpaths smaller than the minPathSize will be deleted.
inset- how far to inset the path. Negative values cause an outset.
flags- see the enum at the top of this class.
threshhold- The threshhold is a value between 0 and 255. Any gray value greater than or equal to the threshold will be mapped to white. All other pixels will be mapped to black.
Returns
ErrorCode - kSuccess if successful.
virtual ErrorCode IClippingPathSuite::ApplyEmbeddedPath (uint16 index,
const PMStringpathName,
const PMRealtolerance,
const PMRealminPathSize,
const PMRealinset,
uint32 flags 
) const
pure virtual

–— ManipulatorsProcess commands to clip the selection.Apply an embedded photoshop clipping path

Parameters
index
*pathNameIN - the name of the clipping path
tolerance- a tolerance value specifying how close to the original path we must be if we smooth the path. 0.0 indicates a perfect match. Smoothing may simplify the path, reducing the number of points.
minPathSize- subpaths smaller than the minPathSize will be deleted.
inset- how far to inset the path. Negative values cause an outset.
flags- see the enum at the top of this class.
Returns
ErrorCode - kSuccess if successful.
virtual ErrorCode IClippingPathSuite::ApplyUserPathOptions (bool8 bInvert,
const PMRealinset 
) const
pure virtual

Invert or un-invert the current clipping. Change the inset amount.

Parameters
bInvert- If true, then invert the current clipping. Otherwise, remove any inversion if it exists.
inset- how far to inset the path. Negative values cause an outset.
Returns
ErrorCode - kSuccess if successful.
virtual bool16 IClippingPathSuite::CanConvertClippingToFrame (void ) const
pure virtual

Does the selection have a clipping path and a containing frame such that the points on the frame can be made to match the clipping path?

Parameters
void
Returns
CanConvertClippingToFrame
virtual bool16 IClippingPathSuite::CanHaveClippingPath (void ) const
pure virtual

–— AbilitiesDoes the selection support clipping paths? Return kTrue or kFalse.

Parameters
void
Returns
CanHaveClippingPath
virtual ErrorCode IClippingPathSuite::DoConvertClippingToFrame (void ) const
pure virtual

Process commands to convert the clipping path to the frame – and delete the original clipping path. The result matches the behavior of InDesign 1.5, which did not have separate clipping paths.

Parameters
void
Returns
ErrorCode - kSuccess if successful.
virtual ErrorCode IClippingPathSuite::DoDetectEdges (const PMRealtolerance,
const PMRealminPathSize,
const PMRealinset,
uint32 flags,
uint8 threshhold 
) const
pure virtual

Convert the image to grayscale and then to 1-bit using the threshhold to determine which gray values will be black and which gray values will be white. Then perform edge detection on the resulting 1-bit image to create a clipping path.

Parameters
tolerance- a tolerance value specifying how close to the original path we must be if we smooth the path. 0.0 indicates a perfect match. Smoothing may simplify the path, reducing the number of points.
minPathSize- subpaths smaller than the minPathSize will be deleted.
inset- how far to inset the path. Negative values cause an outset.
flags- see the enum at the top of this class.
threshhold
Returns
ErrorCode - kSuccess if successful.
virtual bool16 IClippingPathSuite::HasAlphaChannels (void ) const
pure virtual

Does the selection have any alpha channels?

Parameters
void
Returns
HasAlphaChannels
virtual bool16 IClippingPathSuite::HasHighResRaster (void ) const
pure virtual

Vector graphics, such as EPS and PDF, do not have a high res raster from which to perform edge detection. Hence, if performing edge detection, the proxy must be used.

Parameters
void
Returns
HasHighResRaster
virtual bool16 IClippingPathSuite::HasPhotoshopPaths (void ) const
pure virtual

Does the selection have any embedded Photoshop paths?

Parameters
void
Returns
HasPhotoshopPaths
virtual IPathGeometry* IClippingPathSuite::QueryActiveClippingPath (void ) const
pure virtual

Return an AddRefed pointer to the IPathGeometry representing the current clipping path. If no clipping currently exists, then nil is returned.

Parameters
void
Returns
IPathGeometry*
virtual IClipSettings* IClippingPathSuite::QueryActiveClipSettings (void ) const
pure virtual

–— AccessorsReturn a pointer to the active IClipSettings. If a clippable page item is selected, return its IClipSettings. Else if a document is open, return its IClipSettings. Else return the Session's IClipSettings.

Parameters
void
Returns
IClipSettings*
virtual ErrorCode IClippingPathSuite::RemoveClipping (void ) const
pure virtual

Remove any existing clipping path such that the image's graphic frame is the only thing which could be clipping the image.

Parameters
void
Returns
ErrorCode - kSuccess if successful.