Mako 9.1.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
JawsMako::IObjectReplacerTransform Class Referenceabstract

A transform that provides a canned method to replace images, forms, or transparency groups with edited versions. More...

#include <jawsmako/transforms.h>

Inheritance diagram for JawsMako::IObjectReplacerTransform:
[legend]

Public Member Functions

virtual void setRecurse (bool recurse)=0
 Set whether or not the replacer should continue to recurse inside replaced objects. If true, after replacement, the transform will descend and perform any replacements required for the objects contained therein. The default is false. Please note that for the purposes of recursion determination, an object that is ultimately replaced with itself is still considered replaced.
virtual void replace (const IDOMImagePtr &image, const IDOMImagePtr &replacement)=0
 Inform the transform that the given image should be replaced with the given modified image wherever it is used.
virtual void replace (const IDOMTransparencyGroupPtr &group, const IDOMTransparencyGroupPtr &replacement)=0
 Inform the transform that the given transparency group should be replaced with the given modified transparency group wherever it is used.
virtual void replace (const IDOMFormPtr &form, const IDOMFormPtr &replacement)=0
 Inform the transform that the given form should be replaced with the given modified form wherever it is used.
Public Member Functions inherited from JawsMako::ITransform
virtual ~ITransform ()
virtual IDOMBrushPtr transform (const IDOMBrushPtr &brush, eBrushUsage usage=eBUGeneral, const CTransformState &state=CTransformState())=0
 Apply the transform to the given brush, if applicable. These transforms are thread safe.
virtual IDOMImagePtr transform (const IDOMImagePtr &image, const CTransformState &state=CTransformState())=0
 Apply the transform to the given image, if applicable. These transforms are thread safe.
virtual IDOMColorPtr transform (const IDOMColorPtr &color, const CTransformState &state=CTransformState())=0
 Apply the transform to the given color, if applicable. These transforms are thread safe.
virtual IDOMColorSpacePtr transform (const IDOMColorSpacePtr &colorSpace, const CTransformState &state=CTransformState())=0
 Apply the transform to the given color space, if applicable. These transforms are thread safe.
virtual IDOMNodePtr transform (const IDOMNodePtr &node, bool &changed, bool transformChildren=true, const CTransformState &state=CTransformState())=0
 Apply the transform to the given node, if applicable. These transforms are thread safe, providing no other transforms are being applied to the same nodes at the same time.
virtual void transformPage (const IPagePtr &page, bool transformContent=true, bool transformAnnotations=true)=0
 Apply the transform to the given page, if applicable. These transforms are thread safe, providing no other transforms are being applied to the same nodes at the same time. The transform will also apply to the annotations appearances.
virtual void flushCaches ()=0
 Flush the caches used by the transform. Most transforms cache recently transformed results to improve the performance of repeated transformations of equivalent results. However, it is possible that some cached results may point to entities that no longer exist, such as content inside an XPS file that no longer exists. If you are deleting or replacing files where transforms have been used, it is advisable to invoke this routine to clear the caches.
virtual uint64 getConfigurationHash () const =0
 Obtain a hash of the custom transform's configuration.
virtual void setProgressMonitor (const IProgressMonitorPtr &progressMonitor)=0
 Set the IProgressMonitor object for this transform to allow for monitoring the progress of the transform.
Public Member Functions inherited from IRCObject
virtual void addRef () const =0
 Increases the reference count of the actual object pointed to. This would take place during an assignment or copying.
virtual bool decRef () const =0
 Decreases the reference count of the actual object pointed to. When the reference count falls to Zero, it deletes the actual object pointed to.
virtual int32 getRefCount () const =0
 Retrieve the current reference count of the actual object pointed to.

Static Public Member Functions

static JAWSMAKO_API IObjectReplacerTransformPtr create (const IJawsMakoPtr &jawsMako, const IProgressMonitorPtr &progressMonitor=IProgressMonitorPtr())
 Create the transform.

Additional Inherited Members

Protected Member Functions inherited from IRCObject
virtual ~IRCObject ()
 Virtual destructor.

Detailed Description

A transform that provides a canned method to replace images, forms, or transparency groups with edited versions.

Please note that for all replace() methods, chaining is allowed. For example, it is possible to replace formA with formB, and then immediately replace formB with formC. In order to do this, the replacement from formB to formC must be defined after the replacement from formA to formB. No earlier-defined replacement will occur after a later-defined replacement.

For example, if the transform is configured with the sequence:

transform->replace(formA, formB);
transform->replace(formB, formC);
virtual IDOMBrushPtr transform(const IDOMBrushPtr &brush, eBrushUsage usage=eBUGeneral, const CTransformState &state=CTransformState())=0
Apply the transform to the given brush, if applicable. These transforms are thread safe.

Then:

  • If formB is encountered, formB will be replaced with formC (replace(formB, formC)).
  • If formA is encountered, formA will be replaced with formB (replace(formA, formB)) and then immediately replaced with formC (replace(formB, formC)).

However, if the order of the replacements are swapped:

transform->replace(formB, formC);
transform->replace(formA, formB);

Then:

  • If formB is encountered, formB will be replaced with formC (replace(formB, formC)). This is the same as the previous example.
  • If formA is encountered, formA will be replaced with formB as per the directive replace(formA, formB). However that replacement formB will not in turn be immediately replaced with formC, as replace(formB, formC) that would do so was specified before replace(formA, formB) and will not apply.

Circular replacements are also allowed, such as:

transform->replace(formA, formB);
transform->replace(formB, formC);
transform->replace(formC, formA);

This can be used to perform an undo style operation. The same results about earlier replace() rules not following later replace() rules apply:

  • If formA is encountered, it is replaced formA -> formB -> formC -> formA, which does effectively nothing.
  • If formB is encountered is is replaced formB -> formC -> formA.
  • If formC is encountered, it will be replaced with formA.

For the above example, all replacements result in formA being chosen.

Member Function Documentation

◆ create()

JAWSMAKO_API IObjectReplacerTransformPtr JawsMako::IObjectReplacerTransform::create ( const IJawsMakoPtr & jawsMako,
const IProgressMonitorPtr & progressMonitor = IProgressMonitorPtr() )
static

Create the transform.

Parameters
jawsMakoThe JawsMako instance.
progressMonitorA progress monitor for cancelling, and monitoring the job progress.
Returns
IObjectReplacerTransformPtr The new instance.

◆ replace() [1/3]

virtual void JawsMako::IObjectReplacerTransform::replace ( const IDOMFormPtr & form,
const IDOMFormPtr & replacement )
pure virtual

Inform the transform that the given form should be replaced with the given modified form wherever it is used.

Parameters
formThe form to replace.
replacementThe replacement form.

◆ replace() [2/3]

virtual void JawsMako::IObjectReplacerTransform::replace ( const IDOMImagePtr & image,
const IDOMImagePtr & replacement )
pure virtual

Inform the transform that the given image should be replaced with the given modified image wherever it is used.

Parameters
imageThe image to replace.
replacementThe replacement image.

◆ replace() [3/3]

virtual void JawsMako::IObjectReplacerTransform::replace ( const IDOMTransparencyGroupPtr & group,
const IDOMTransparencyGroupPtr & replacement )
pure virtual

Inform the transform that the given transparency group should be replaced with the given modified transparency group wherever it is used.

Please note that the following attributes from replacement are ignored, and replaced with the given attributes from the group being replaced:

  • render transform
  • clip
  • rendering intent
  • black point compensation
  • opacity
  • blend mode
  • opacity/soft mask
Parameters
groupThe group to replace.
replacementThe replacement group.

◆ setRecurse()

virtual void JawsMako::IObjectReplacerTransform::setRecurse ( bool recurse)
pure virtual

Set whether or not the replacer should continue to recurse inside replaced objects. If true, after replacement, the transform will descend and perform any replacements required for the objects contained therein. The default is false. Please note that for the purposes of recursion determination, an object that is ultimately replaced with itself is still considered replaced.

Parameters
recursetrue if the transform should recursive into replaced objects, false otherwise.

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