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

#include <IGraphicsUtils.h>

Inheritance diagram for IGraphicsUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IGRAPHICSUTILS }
 

Public Member Functions

virtual void CopyPathToPort (const IPathData *srcPath, IGraphicsPort *gPort)=0
 
virtual PMReal AlignUserCoordToDevicePixelCenter (IRasterPort *rPort, const PMReal &userCoord)=0
 
virtual void CreateAnchorPointPath (IRasterPort *rPort, IGraphicsPort *gPort, const PMPoint &handleLocation, const PMReal &size=PMReal(4.0), bool16 doFloor=kTrue)=0
 
virtual void CreateAnchorRectPaths (IRasterPort *rPort, IGraphicsPort *gPort, const PMRect &theRect, const PMReal &size, bool16 doFloor)=0
 
virtual void CreateAnchorPointPath_UserCoords (IRasterPort *rPort, IGraphicsPort *gPort, const PMMatrix &sourceToUserMatrix, const PMPoint &handleLocation, const PMReal &size=PMReal(4.0), bool16 doFloor=kTrue)=0
 
virtual void CreateAnchorRectPaths_UserCoords (IRasterPort *rPort, IGraphicsPort *gPort, const PMMatrix &sourceToUserMatrix, const PMRect &sourceRect, const PMReal &size, bool16 doFloor=kTrue)=0
 
virtual void CreateDirectionPointPath (IRasterPort *rPort, IGraphicsPort *gPort, const PMPoint &handleLocation)=0
 
virtual void CreateDirectionPointPath_UserCoords (IRasterPort *rPort, IGraphicsPort *gPort, const PMMatrix &sourceToUserMatrix, const PMPoint &handleLocation)=0
 
virtual void CreateTextLinkPath (IRasterPort *rPort, IGraphicsPort *gPort, const PMPoint &handleLocation, bool16 bVerticalOrientation=kFalse, bool16 bRightToLeftOrientation=kFalse)=0
 
virtual void CreateTextOversetPath (IRasterPort *rPort, IGraphicsPort *gPort, const PMPoint &handleLocation, bool16 drawSelected=kTrue)=0
 
virtual PMPoint ComputeMitreAdjustPoint (const PMPoint &beforePt, const PMPoint &currentPt, const PMPoint &afterPt, const PMReal &strokeWeight, const PMReal &miterLimit)=0
 
virtual void ComputeLineBounds (const PMPointList &B, const PMReal &strokeWeight, const PMMatrix &xForm, const PMReal &miterLimit, int32 joinType, int32 lineCap, bool16 leftIsOpen, bool16 rightIsOpen, PMPoint *previousPt, PMReal *xMin, PMReal *xMax, PMReal *yMin, PMReal *yMax)=0
 
virtual IColorSpaceMgrQueryDefaultColorSpaceMgr ()=0
 
virtual bool8 SetupRasterPort (IRasterPort *rPort)=0
 
virtual PMRect GetUpdateClipRect (GraphicsData *gd)=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

An utility interface for graphic related operations.

Member Function Documentation

virtual PMReal IGraphicsUtils::AlignUserCoordToDevicePixelCenter (IRasterPortrPort,
const PMRealuserCoord 
)
pure virtual
Align the given user coordinate in the port to the center of the nearest device pixel.

Parameters
rPortspecifies raster port device (used to determine the device scale factor).
userCoordis the coordinate value to be aligned.
Returns
the pixel center aligned value
virtual void IGraphicsUtils::ComputeLineBounds (const PMPointListB,
const PMRealstrokeWeight,
const PMMatrixxForm,
const PMRealmiterLimit,
int32 joinType,
int32 lineCap,
bool16 leftIsOpen,
bool16 rightIsOpen,
PMPointpreviousPt,
PMRealxMin,
PMRealxMax,
PMRealyMin,
PMRealyMax 
)
pure virtual

Compute the line's bounds taking into account its stroke weight, miter limit, join type, and line cap.

Parameters
Bis the line specified by two points.
strokeWeightis the line weight.
xFormis the transformation matrix.
miterLimitis the miter limit.
joinTypeis the join type
lineCapis the line cap.
leftIsOpenis true if left end point of line is open.
rightIsOpenis true if right line end point is open.
previousPtis used to compute the miter if left end point is not open.
xMinis the minimum bound for the line along the x-axis.
xMaxis the maximum bound for the line along the x-axis.
yMinis the minimum bound for the line along the y-axis.
yMaxis the maximum bound for the line along the y-axis.
virtual PMPoint IGraphicsUtils::ComputeMitreAdjustPoint (const PMPointbeforePt,
const PMPointcurrentPt,
const PMPointafterPt,
const PMRealstrokeWeight,
const PMRealmiterLimit 
)
pure virtual

Compute the miter adjusted point for current point.

Parameters
beforePtspecifies the point before the current point.
currentPtis the current point.
afterPtspecifies the point after current point.
strokeWeightis the line weight.
miterLimitis the miter limit.
Returns
the miter adjusted point.
virtual void IGraphicsUtils::CopyPathToPort (const IPathData * srcPath,
IGraphicsPortgPort 
)
pure virtual

Copy the given path data into the graphics port.

Parameters
srcPathspecifies the path data to copy.
gPortis the graphic port.
virtual void IGraphicsUtils::CreateAnchorPointPath (IRasterPortrPort,
IGraphicsPortgPort,
const PMPointhandleLocation,
const PMRealsize = PMReal(4.0),
bool16 doFloor = kTrue 
)
pure virtual

Create an anchor point path marker in the port. The function converts to destination coords using rPort.

Parameters
rPortspecifies target raster port.
gPortis the target graphic port.
handleLocationis the location of the marker in source coordinates.
sizeis the pixel size of the marker.
doFlooris true if fractional pixel is clipped.
virtual void IGraphicsUtils::CreateAnchorPointPath_UserCoords (IRasterPortrPort,
IGraphicsPortgPort,
const PMMatrixsourceToUserMatrix,
const PMPointhandleLocation,
const PMRealsize = PMReal(4.0),
bool16 doFloor = kTrue 
)
pure virtual
Create an anchor point path marker in the port.

The function assumes rPort coords have already been set to it's native user coords (identity CTM), and will be reset by the caller. This allows more complex paths to built from a series of calls to methods like this one.

Parameters
rPortspecifies target raster port.
gPortis the target graphic port.
sourceToUserMatrix
handleLocationis the location of the marker in source coordinates.
sizeis the pixel size of the marker.
doFlooris true if fractional pixel is clipped.
virtual void IGraphicsUtils::CreateAnchorRectPaths (IRasterPortrPort,
IGraphicsPortgPort,
const PMRecttheRect,
const PMRealsize,
bool16 doFloor 
)
pure virtual

Create a path for a rectangle's 8 anchor points in the port. The function converts to destination coords using rPort and draws the path using gPort.

Parameters
rPortspecifies target raster port.
gPortis the target graphic port.
theRectis the rectangle for which the anchor points are to be generated.
sizeis the pixel size of the marker.
doFlooris true if fractional pixel is clipped.
virtual void IGraphicsUtils::CreateAnchorRectPaths_UserCoords (IRasterPortrPort,
IGraphicsPortgPort,
const PMMatrixsourceToUserMatrix,
const PMRectsourceRect,
const PMRealsize,
bool16 doFloor = kTrue 
)
pure virtual

Create a path for a rectangle's 8 anchor points in the port. The function assumes rPort coords have already been set to it's native user coords (identity CTM), and will be reset by the caller. This allows more complex paths to built from a series of calls to methods like this one.

Parameters
rPortspecifies target raster port.
gPortis the target graphic port.
sourceRectis the rectangle, in source coordinates, for which the anchor points are to be generated.
sizeis the pixel size of the marker.
doFlooris true if fractional pixel is clipped.
virtual void IGraphicsUtils::CreateDirectionPointPath (IRasterPortrPort,
IGraphicsPortgPort,
const PMPointhandleLocation 
)
pure virtual
Create a direction point path marker in the port.

The function converts to destination coords using rPort and draws the path using gPort.

Parameters
rPortspecifies target raster port.
gPortis the target graphic port.
handleLocationis the location of the marker in source coordinates.
virtual void IGraphicsUtils::CreateDirectionPointPath_UserCoords (IRasterPortrPort,
IGraphicsPortgPort,
const PMMatrixsourceToUserMatrix,
const PMPointhandleLocation 
)
pure virtual
Create a direction point path marker in the port.

The function assumes rPort coords have already been set to it's native user coords (identity CTM), and will be reset by the caller. This allows more complex paths to built from a series of calls to methods like this one.

Parameters
rPortspecifies target raster port.
gPortis the target graphic port.
handleLocationis the location of the marker in source coordinates.
virtual void IGraphicsUtils::CreateTextLinkPath (IRasterPortrPort,
IGraphicsPortgPort,
const PMPointhandleLocation,
bool16 bVerticalOrientation = kFalse,
bool16 bRightToLeftOrientation = kFalse 
)
pure virtual

Create a text link triangle marker. The function converts to destination coords using rPort and draws the path using gPort.

Parameters
rPortspecifies target raster port.
gPortis the target graphic port.
handleLocationis the location of the link marker in source coordinates.
bVerticalOrientationis true if drawn vertically.
virtual void IGraphicsUtils::CreateTextOversetPath (IRasterPortrPort,
IGraphicsPortgPort,
const PMPointhandleLocation,
bool16 drawSelected = kTrue 
)
pure virtual

Create an overset "plus" marker. The function converts to destination coords using rPort and draws the path using gPort.

Parameters
rPortspecifies target raster port.
gPortis the target graphic port.
handleLocationis the location of the overset marker in source coordiate.
drawSelectedis true if the overset marker is to be drawn.
virtual PMRect IGraphicsUtils::GetUpdateClipRect (GraphicsDatagd)
pure virtual

Return the bounding box of the clip/update rect for the specified GraphicsData.

Parameters
gdis the graphics data.
Returns
the bounding box of the clip or update rect.
virtual IColorSpaceMgr* IGraphicsUtils::QueryDefaultColorSpaceMgr ()
pure virtual

Return the default color space manager servic.

virtual bool8 IGraphicsUtils::SetupRasterPort (IRasterPortrPort)
pure virtual

Setup the rasterport by calling all RasterSetup service providers.

Parameters
rPortis the raster to setup.
Returns
kTrue is rasterport is setup successfully.