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

#include <IEdgeDetection.h>

Inheritance diagram for IEdgeDetection:
IPMUnknown

Public Types

enum  {
  kAllowHoles = 1 << 0, kIntersectWithFrame = 1 << 1, kDisplayMask = 1 << 2, kForceHighRes = 1 << 3,
  kForceProxy = 1 << 4
}
 

Public Member Functions

virtual ErrorCode MaskToPolygon (const UIDRef &itemRef, IPathGeometry *pNew, int16 channelIndex, int32 resolution, uint32 flags, uint8 threshold, PMReal tolerance, PMReal minPathSize, EdgeDetectionProcPtr progressPtr, ImagingTypes::ImageDataPtr imageMaskDataPtr=nullptr) 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

This interface is used by the kEdgeDetectionBoss to create an IPathGeometry by performing edge detection on an image. The image is converted to grayscale, then converted to 1-bit using the gray threshold, and edge detection is performed on this 1-bit image to create a polygonal path. The polygon is then smoothed to create a spline-based path.

Member Enumeration Documentation

anonymous enum

enumeration of flags which client can bitwise or together
Enumerator
kAllowHoles 

Allow subpaths within subpaths

kIntersectWithFrame 

Ignore portions of the image outside the containing frame

kDisplayMask 

Draw the 1-bit bitmap used to detect edges.

kForceHighRes 

Forces the full resolution image to be used as the source

kForceProxy 

Forces the proxy to be used if it exists

Member Function Documentation

virtual ErrorCode IEdgeDetection::MaskToPolygon (const UIDRefitemRef,
IPathGeometrypNew,
int16 channelIndex,
int32 resolution,
uint32 flags,
uint8 threshold,
PMReal tolerance,
PMReal minPathSize,
EdgeDetectionProcPtr progressPtr,
ImagingTypes::ImageDataPtr imageMaskDataPtr = nullptr 
) const
pure virtual

Perform edge detection on an image to create a path.

Parameters
itemRef- IN: the source image
pNew- OUT: resulting path
channelIndex- IN: 0 = Composite, n = alpha channel number n-1.
resolution- IN: The desired resolution of the path. Pass zero to indicate source resolution.
flags- IN: Combination of kAllowHoles, kIntersectWithFrame, kDisplayMask, kForceHighRes, kForceProxy.
threshold- IN: Gray threshold between 0 and 255 to determine which pixels become black and which become white in the 1-bit stage of the process.
tolerance- IN: How sloppy can we be. 0 will produce unsmoothed polygonal path
minPathSize- IN: Delete all paths with bounding box smaller than this size
progressPtr- IN: Pointer to a progress bar callback. Can be nil.
imageMaskDataPtr- IN: Optional. Required in case we want to apply edge detection to an image mask (for eg. Select Subject mask) rather than the original image. In case this parameter is provided, it will take precedence over original image for edge detection.