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

#include <IRasterPort.h>

Inheritance diagram for IRasterPort:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IRASTERPORT }
 

Public Member Functions

virtual void Setup ()=0
 
virtual int32 currentgstatelevel ()=0
 
virtual void initdevicescale (const PMReal scale=1.0)=0
 
virtual PMReal getdevicescale ()=0
 
virtual void setmatrix (const PMMatrix &m)=0
 
virtual int8 currentmatrix (PMMatrix *m)=0
 
virtual PMReal currentlinewidth ()=0
 
virtual void currentdash (int32 *numDash, Fixed **dashArray, Fixed *offset)=0
 
virtual int32 currentlinecap ()=0
 
virtual int32 currentlinejoin ()=0
 
virtual PMReal currentmiterlimit ()=0
 
virtual void currentfillbounds (PMRect *bounds)=0
 
virtual void currentstrokebounds (PMRect *bounds)=0
 
virtual void currentclipbounds (PMRect *bounds)=0
 
virtual AGMPaint * currentsrccolor ()=0
 
virtual void currentdstcolor (AGMRasterPort *dstDevice, AGMPaint *agmPaint)=0
 
virtual int8 infill (const PMRect &devRect)=0
 
virtual int8 ineofill (const PMRect &devRect)=0
 
virtual int8 instroke (const PMRect &devRect)=0
 
virtual void initclip ()=0
 
virtual int8 clipclass (const PMRect &rect)=0
 
virtual bool8 transform (PMReal *x, PMReal *y)=0
 
virtual bool8 itransform (PMReal *x, PMReal *y)=0
 
virtual void GetPathInfo (IOutlineInfo *callBack)=0
 
virtual bool8 GetError ()=0
 
virtual void SetXORMode (bool32 xorOn)=0
 
virtual void setantialiaspolicy (int32 *inOutPolicy)=0
 
virtual void setportoptions (uint32 portOptions)=0
 
virtual uint32 getportoptions ()=0
 
virtual bool8 SetDeviceProfile (AGMColorProfile *profile)=0
 
virtual bool8 IsHiDPI ()=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 is a viewport interface which is a shell over AGM's rasterport specific API Most of the methods work exactly or very similar to PostScript operators. See Postscript language reference manual for more info

IMPORTANT: You CANNOT use IRasterPort methods in any drawing code you expect to print

Note: Many of the methods exposed by IRasterPort use internal types and are intended for internal usage only.

Member Function Documentation

virtual int8 IRasterPort::clipclass (const PMRectrect)
pure virtual

Check to see if the provided rectangle is within the current clip path.

The rectangle provided is in user space and will be transformed to device space using the current CTM before comparing with device space clip in the gstate.

Parameters
rectIN The rect to test
Returns
0 if the rect is partially clipped, 1 if it's unclipped, 2 if it's totally clipped
virtual void IRasterPort::currentclipbounds (PMRectbounds)
pure virtual

Gets the backing port's current clip bounds in device coordinates (not user-coordinates). Note that even the device scale set by initdevicescale can be seen through currentclipbounds. So if you were to initdevicescale(2.0); then translate user space by (100, 100); then clip to L:0 T:0 R:10 B:10 and then asked for currentclipbounds, you would get L:200 T:200 R:220 B:220 – an answer in the coordinate system of the deep down unscaled device.

Also note that before a clip is ever set, AGM reports a wide open clip of +/- (2^30 - 2^7) of all the strange things. But the first clip will actually intersect the requested clip with the extent of the pixel bounds. For example:

gport->rectclip( -double(1UL<<29), -double(1UL<<29), double(1UL<<30), double(1UL<<30)); rport->currentclipbounds( &rect); //...we're now down to the pixel buffer.

will reveal the actual size of the pixel buffer (sneaking past the device scale factor set by initdevicescale.

Parameters
boundsOUT The clip bounds
virtual void IRasterPort::currentdash (int32 * numDash,
Fixed ** dashArray,
Fixed * offset 
)
pure virtual

Gets the backing port's current dash pattern

Parameters
numDashOUT The number of dashes
dashArrayOUT The current dash array
offsetOUT The dash offset
virtual void IRasterPort::currentdstcolor (AGMRasterPort * dstDevice,
AGMPaint * agmPaint 
)
pure virtual

This method intentionally uncommented

virtual void IRasterPort::currentfillbounds (PMRectbounds)
pure virtual

Gets the backing port's current fill bounds

Parameters
boundsOUT The fill bounds
virtual int32 IRasterPort::currentgstatelevel ()
pure virtual

Returns the current gsave level in the backing port

Returns
the port's gsave level
virtual int32 IRasterPort::currentlinecap ()
pure virtual

Gets the backing port's current line cap. See GraphicTypes.h for possible return values

Returns
the current line cap
virtual int32 IRasterPort::currentlinejoin ()
pure virtual

Gets the backing port's current line join. See GraphicTypes.h for possible return values

Returns
the current line join
virtual PMReal IRasterPort::currentlinewidth ()
pure virtual

Gets the backing port's current line width

Returns
the current line width
virtual int8 IRasterPort::currentmatrix (PMMatrixm)
pure virtual

Gets the backing port's current user coord CTM if there is a device scale factor, the returned matrix will not include it

Parameters
mOUT The current matrix
Returns
non-zero if the call succeeds, else zero
virtual PMReal IRasterPort::currentmiterlimit ()
pure virtual

Gets the backing port's current miter limit

Returns
the current miter limit
virtual AGMPaint* IRasterPort::currentsrccolor ()
pure virtual

Gets the backing port's current source color

Returns
the current source color
virtual void IRasterPort::currentstrokebounds (PMRectbounds)
pure virtual

Gets the backing port's current stroke bounds

Parameters
boundsOUT The stroke bounds
virtual PMReal IRasterPort::getdevicescale ()
pure virtual

Gets the backing port's device coord scale factor

Returns
The device coord scale factor
virtual bool8 IRasterPort::GetError ()
pure virtual

Gets backing port's error state

Returns
kTrue if the backing port is in an error state, else kFalse
virtual void IRasterPort::GetPathInfo (IOutlineInfocallBack)
pure virtual

Gets the backing port's current path

Parameters
callBackOUT The outline info to store the path
See Also
IOutlineInfo
virtual uint32 IRasterPort::getportoptions ()
pure virtual

This method intentionally uncommented

virtual int8 IRasterPort::ineofill (const PMRectdevRect)
pure virtual

Tests whether the rectangle in device space would be painted by eofill, taking current clip into account

Parameters
devRectIN The rect to test, in device coordinates
Returns
0 if doesn't intersect, 1 if fully intersects, or 2 if partially intersects
virtual int8 IRasterPort::infill (const PMRectdevRect)
pure virtual

Tests whether the rectangle in device space would be painted by fill, taking current clip into account

Parameters
devRectIN The rect to test, in device coordinates
Returns
0 if doesn't intersect, 1 if fully intersects, or 2 if partially intersects
virtual void IRasterPort::initclip ()
pure virtual

Initializes the backing port's clipping

virtual void IRasterPort::initdevicescale (const PMReal scale = 1.0)
pure virtual

Sets the backing port's device coord scale factor. Note: For HiDPI offscreens set the device scale before setting the user matrix

What this does is make every currentmatrix, setmatrix call pass through this scale factor. With setmatrix, first the scale factor is put into the port, then the passed in matrix. With currentmatrix, the real CTM is post-unscaled before returning. That essentially means that there is a scale-factor stuck on the device that you can't see (except with currentclipbounds) or get rid of. So for example, if you create a double-size pixelbuffer for AGM and call initdevicescale(2.) on the raster port, all the existing AGM drawing code that uses setmatrix, currentmatrix will be drawing double-resolution pictures without knowing it.

Parameters
scaleIN The device coord scale factor (implicitly 1:1 unless an HiDPI mode is in effect)
virtual int8 IRasterPort::instroke (const PMRectdevRect)
pure virtual

Tests whether the rectangle in device space would be painted by stroke, taking current clip into account

Parameters
devRectIN The rect to test, in device coordinates
Returns
0 if doesn't intersect, 1 if fully intersects, or 2 if partially intersects
virtual bool8 IRasterPort::IsHiDPI ()
pure virtual

Determines if the backing port is in high DPI mode (device scale == 2.0)

Returns
kTrue if the backing port's device scale is 2.0, else kFalse
virtual bool8 IRasterPort::itransform (PMRealx,
PMRealy 
)
pure virtual

Transforms the given point by the inverse of the backing port's CTM (i.e. from device space to CTM space)

Parameters
xIN/OUT The x component of the point
yIN/OUT The y component of the point
Returns
kTrue if succeeds, else kFalse
virtual void IRasterPort::setantialiaspolicy (int32 * inOutPolicy)
pure virtual
     Sets the anti-aliasing policy for the backing port. 



     Returns previous policy. Allows use like this:



     <pre>

     int32 options = 1;

     rasterport->setantialiaspolicy(&options);

use the port... rasterport->setantialiaspolicy(&options); // Restore previous value

inOutPolicy is a bit mask that can take one or more of the following: 1 to antialias text 2 to antialias graphics 4 prevents linearized blending for non-AGM alpha

Parameters
inOutPolicyIN/OUT The new policy on input, the old policy on output
virtual bool8 IRasterPort::SetDeviceProfile (AGMColorProfile * profile)
pure virtual

Sets the device profile for the current raster port.

Parameters
profileIN The profile to set
See Also
IColorSpaceMgr
virtual void IRasterPort::setmatrix (const PMMatrixm)
pure virtual

Sets the backing port's user coord CTM to m if there is a device scale factor in effect, the matrix m should not include it

Parameters
mIN The new matrix
virtual void IRasterPort::setportoptions (uint32 portOptions)
pure virtual

This method intentionally uncommented

virtual void IRasterPort::Setup ()
pure virtual

Initializes the port. May be called multiple times to re-initialize the port if the backing port changes

See Also
IAGMPortData
virtual void IRasterPort::SetXORMode (bool32 xorOn)
pure virtual

Sets XOR mode on the backing port

Parameters
xorOnIN The new xor mode
virtual bool8 IRasterPort::transform (PMRealx,
PMRealy 
)
pure virtual

Transforms the given point by the backing port's CTM to a point in device space

Parameters
xIN/OUT The x component of the point
yIN/OUT The y component of the point
Returns
kTrue if succeeds, else kFalse