Mako 8.2.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
customtransform.h
Go to the documentation of this file.
1/*
2* Copyright (C) 2017-2025 Global Graphics Software Ltd. All rights reserved.
3*/
4
5#ifndef JAWSMAKO_CUSTOMTRANSFORM_H
6#define JAWSMAKO_CUSTOMTRANSFORM_H
7
12
13#include <jawsmako/transforms.h>
15#include <edl/idomcanvas.h>
16
17namespace JawsMako
18{
19 using namespace EDL;
20
21 class ICustomTransform;
23
24#ifdef SWIG
25#ifdef SWIGPYTHON
26 %apply bool & DIRECTOROUT { bool &changed };
27 %apply unsigned int & DIRECTOROUT { uint32 &index };
28#else
29 %apply bool &INOUT { bool &changed };
30 %apply uint32_t &OUTPUT { uint32 &index };
31#endif
32#endif
64 {
65 public:
66 virtual ~ICustomTransform() {}
67
90 {
91 public:
92 virtual ~IImplementation() {}
93
100 virtual void transformAnnotation(IImplementation *genericImplementation, const IAnnotationPtr &annotation)
101 {
102 if (!genericImplementation)
103 {
105 return;
106 }
107 genericImplementation->transformAnnotation(nullptr, annotation);
108 }
109
121 virtual IAnnotationAppearancePtr transformAnnotationAppearance(IImplementation *genericImplementation, const IAnnotationAppearancePtr &appearance, const FRect &annotationRect)
122 {
123 if (!genericImplementation)
124 {
126 return nullptr;
127 }
128 return genericImplementation->transformAnnotationAppearance(nullptr, appearance, annotationRect);
129 }
130
143 virtual IDOMColorPtr transformColor(IImplementation *genericImplementation, const IDOMColorPtr &color, const CTransformState &state)
144 {
145 if (!genericImplementation)
146 {
148 return nullptr;
149 }
150 return genericImplementation->transformColor(nullptr, color, state);
151 }
152
166 virtual IDOMColorSpacePtr transformColorSpace(IImplementation *genericImplementation, const IDOMColorSpacePtr &colorSpace, const CTransformState &state)
167 {
168 if (!genericImplementation)
169 {
171 return nullptr;
172 }
173 return genericImplementation->transformColorSpace(nullptr, colorSpace, state);
174 }
175
187 virtual IDOMImagePtr transformImage(IImplementation *genericImplementation, const IDOMImagePtr &image, const CTransformState &state)
188 {
189 if (!genericImplementation)
190 {
192 return nullptr;
193 }
194 return genericImplementation->transformImage(nullptr, image, state);
195 }
196
211 virtual IDOMNodePtr transformNode(IImplementation *genericImplementation, const IDOMNodePtr &node, bool &changed, bool transformChildren, const CTransformState &state)
212 {
213 if (!genericImplementation)
214 {
216 return nullptr;
217 }
218 return genericImplementation->transformNode(nullptr, node, changed, transformChildren, state);
219 }
220
234 virtual IDOMNodePtr transformFixedPage(IImplementation *genericImplementation, const IDOMFixedPagePtr &page, bool &changed, bool transformChildren, const CTransformState &state)
235 {
236 if (!genericImplementation)
237 {
239 return nullptr;
240 }
241 return genericImplementation->transformFixedPage(nullptr, page, changed, transformChildren, state);
242 }
243
259 virtual IDOMNodePtr transformGroup(IImplementation *genericImplementation, const IDOMGroupPtr &group, bool &changed, bool transformChildren, const CTransformState &state)
260 {
261 if (!genericImplementation)
262 {
264 return nullptr;
265 }
266 return genericImplementation->transformGroup(nullptr, group, changed, transformChildren, state);
267 }
268
284 virtual IDOMNodePtr transformCharPathGroup(IImplementation *genericImplementation, const IDOMCharPathGroupPtr &group, bool &changed, bool transformChildren, const CTransformState &state)
285 {
286 if (!genericImplementation)
287 {
289 return nullptr;
290 }
291 return genericImplementation->transformCharPathGroup(nullptr, group, changed, transformChildren, state);
292 }
293
309 virtual IDOMNodePtr transformTransparencyGroup(IImplementation *genericImplementation, const IDOMTransparencyGroupPtr &group, bool &changed, bool transformChildren, const CTransformState &state)
310 {
311 if (!genericImplementation)
312 {
314 return nullptr;
315 }
316 return genericImplementation->transformTransparencyGroup(nullptr, group, changed, transformChildren, state);
317 }
318
334 virtual IDOMNodePtr transformCanvas(IImplementation *genericImplementation, const IDOMCanvasPtr &canvas, bool &changed, bool transformChildren, const CTransformState &state)
335 {
336 if (!genericImplementation)
337 {
339 return nullptr;
340 }
341 return genericImplementation->transformCanvas(nullptr, canvas, changed, transformChildren, state);
342 }
343
358 virtual IDOMNodePtr transformGlyphs(IImplementation *genericImplementation, const IDOMGlyphsPtr &glyphs, bool &changed, const CTransformState &state)
359 {
360 if (!genericImplementation)
361 {
363 return nullptr;
364 }
365 return genericImplementation->transformGlyphs(nullptr, glyphs, changed, state);
366 }
367
380 virtual IDOMFontPtr transformFont(IImplementation *genericImplementation, const IDOMFontPtr &font, uint32 &index, const CTransformState &state)
381 {
382 if (!genericImplementation)
383 {
385 return nullptr;
386 }
387 return genericImplementation->transformFont(nullptr, font, index, state);
388 }
389
404 virtual IDOMNodePtr transformPath(IImplementation *genericImplementation, const IDOMPathNodePtr &path, bool &changed, const CTransformState &state)
405 {
406 if (!genericImplementation)
407 {
409 return nullptr;
410 }
411 return genericImplementation->transformPath(nullptr, path, changed, state);
412 }
413
429 virtual IDOMNodePtr transformVisualRoot(IImplementation *genericImplementation, const IDOMVisualRootPtr &root, bool &changed, bool transformChildren, const CTransformState &state)
430 {
431 if (!genericImplementation)
432 {
434 return nullptr;
435 }
436 return genericImplementation->transformVisualRoot(nullptr, root, changed, transformChildren, state);
437 }
438
452 virtual IDOMNodePtr transformForm(IImplementation *genericImplementation, const IDOMFormPtr &form, bool &changed, bool transformChildren, const CTransformState &state)
453 {
454 if (!genericImplementation)
455 {
457 return nullptr;
458 }
459 return genericImplementation->transformForm(nullptr, form, changed, transformChildren, state);
460 }
461
475 virtual IDOMNodePtr transformFormInstance(IImplementation *genericImplementation, const IDOMFormInstancePtr &instance, bool &changed, bool transformChildren, const CTransformState &state)
476 {
477 if (!genericImplementation)
478 {
480 return nullptr;
481 }
482 return genericImplementation->transformFormInstance(nullptr, instance, changed, transformChildren, state);
483 }
484
495 virtual IDOMBrushPtr transformBrush(IImplementation *genericImplementation, const IDOMBrushPtr &brush, eBrushUsage usage, const CTransformState &state)
496 {
497 if (!genericImplementation)
498 {
500 return nullptr;
501 }
502 return genericImplementation->transformBrush(nullptr, brush, usage, state);
503 }
504
515 virtual IDOMBrushPtr transformSolidColorBrush(IImplementation *genericImplementation, const IDOMSolidColorBrushPtr &brush, const CTransformState &state)
516 {
517 if (!genericImplementation)
518 {
520 return nullptr;
521 }
522 return genericImplementation->transformSolidColorBrush(nullptr, brush, state);
523 }
524
536 virtual IDOMBrushPtr transformGradientBrush(IImplementation *genericImplementation, const IDOMGradientBrushPtr &gradient, const CTransformState &state)
537 {
538 if (!genericImplementation)
539 {
541 return nullptr;
542 }
543 return genericImplementation->transformGradientBrush(nullptr, gradient, state);
544 }
545
557 virtual IDOMBrushPtr transformLinearGradientBrush(IImplementation *genericImplementation, const IDOMLinearGradientBrushPtr &gradient, const CTransformState &state)
558 {
559 if (!genericImplementation)
560 {
562 return nullptr;
563 }
564 return genericImplementation->transformLinearGradientBrush(nullptr, gradient, state);
565 }
566
578 virtual IDOMBrushPtr transformRadialGradientBrush(IImplementation *genericImplementation, const IDOMRadialGradientBrushPtr &gradient, const CTransformState &state)
579 {
580 if (!genericImplementation)
581 {
583 return nullptr;
584 }
585 return genericImplementation->transformRadialGradientBrush(nullptr, gradient, state);
586 }
587
599 virtual IDOMBrushPtr transformVisualBrush(IImplementation *genericImplementation, const IDOMVisualBrushPtr &brush, const CTransformState &state)
600 {
601 if (!genericImplementation)
602 {
604 return nullptr;
605 }
606 return genericImplementation->transformVisualBrush(nullptr, brush, state);
607 }
608
620 virtual IDOMBrushPtr transformImageBrush(IImplementation *genericImplementation, const IDOMImageBrushPtr &brush, const CTransformState &state)
621 {
622 if (!genericImplementation)
623 {
625 return nullptr;
626 }
627 return genericImplementation->transformImageBrush(nullptr, brush, state);
628 }
629
641 virtual IDOMBrushPtr transformTilingPatternBrush(IImplementation *genericImplementation, const IDOMTilingPatternBrushPtr &brush, const CTransformState &state)
642 {
643 if (!genericImplementation)
644 {
646 return nullptr;
647 }
648 return genericImplementation->transformTilingPatternBrush(nullptr, brush, state);
649 }
650
662 virtual IDOMBrushPtr transformShadingPatternBrush(IImplementation *genericImplementation, const IDOMShadingPatternBrushPtr &brush, const CTransformState &state)
663 {
664 if (!genericImplementation)
665 {
667 return nullptr;
668 }
669 return genericImplementation->transformShadingPatternBrush(nullptr, brush, state);
670 }
671
683 virtual IDOMBrushPtr transformSoftMaskBrush(IImplementation *genericImplementation, const IDOMSoftMaskBrushPtr &brush, const CTransformState &state)
684 {
685 if (!genericImplementation)
686 {
688 return nullptr;
689 }
690 return genericImplementation->transformSoftMaskBrush(nullptr, brush, state);
691 }
692
706 virtual IDOMBrushPtr transformMaskedBrush(IImplementation *genericImplementation, const IDOMMaskedBrushPtr &brush, const CTransformState &state)
707 {
708 if (!genericImplementation)
709 {
711 return nullptr;
712 }
713 return genericImplementation->transformMaskedBrush(nullptr, brush, state);
714 }
715
727 virtual IDOMBrushPtr transformNullBrush(IImplementation *genericImplementation, const IDOMNullBrushPtr &brush, const CTransformState &state)
728 {
729 if (!genericImplementation)
730 {
732 return nullptr;
733 }
734 return genericImplementation->transformNullBrush(nullptr, brush, state);
735 }
736
737 };
738#ifdef SWIG
739 %clear bool &changed;
740 %clear uint32 &index;
741#endif
742
782 static JAWSMAKO_API ICustomTransformPtr create(const IJawsMakoPtr &jawsMako,
783 IImplementation *implementation,
784 const IProgressMonitorPtr &progressMonitor = IProgressMonitorPtr (),
785 bool dependsOnClipBounds = true,
786 bool dependsOnGroupSpace = true,
787 bool dependsOnRenderingIntent = true,
788 bool dependsOnTransform = true,
789 bool dependsOnBrushUsage = true,
790 bool dependsOnEdgeMode = true,
791 bool dependsOnUncoloredTilingBrush = true)
792 {
793 return ICustomTransform::create(jawsMako, implementation, progressMonitor,
794 dependsOnClipBounds, dependsOnGroupSpace, dependsOnRenderingIntent,
795 dependsOnTransform, dependsOnTransform, dependsOnBrushUsage,
796 dependsOnEdgeMode, dependsOnUncoloredTilingBrush);
797 }
798
799
843 static JAWSMAKO_API ICustomTransformPtr create(const IJawsMakoPtr &jawsMako,
844 IImplementation *implementation,
845 const IProgressMonitorPtr &progressMonitor,
846 bool dependsOnClipBounds,
847 bool dependsOnGroupSpace,
848 bool dependsOnRenderingIntent,
849 bool dependsOnTransformScale,
850 bool dependsOnTransformOffset,
851 bool dependsOnBrushUsage,
852 bool dependsOnEdgeMode,
853 bool dependsOnUncoloredTilingBrush);
854
855 };
856}
857
858#endif
Class for tracking the graphics state leading to the point where a transform is applied.
Definition transforms.h:65
Callback interface that provides methods for actually doing the work. Override the cases for the obje...
Definition customtransform.h:90
virtual void transformAnnotation(IImplementation *genericImplementation, const IAnnotationPtr &annotation)
Callback to process an annotation.
Definition customtransform.h:100
virtual IDOMBrushPtr transformMaskedBrush(IImplementation *genericImplementation, const IDOMMaskedBrushPtr &brush, const CTransformState &state)
Callback to process an IDOMMaskedBrush.
Definition customtransform.h:706
virtual IDOMColorSpacePtr transformColorSpace(IImplementation *genericImplementation, const IDOMColorSpacePtr &colorSpace, const CTransformState &state)
Callback to process a color space. This will be invoked for any color anywhere in the DOM,...
Definition customtransform.h:166
virtual IDOMNodePtr transformCanvas(IImplementation *genericImplementation, const IDOMCanvasPtr &canvas, bool &changed, bool transformChildren, const CTransformState &state)
Callback to process an IDOMCanvas.
Definition customtransform.h:334
virtual IDOMNodePtr transformVisualRoot(IImplementation *genericImplementation, const IDOMVisualRootPtr &root, bool &changed, bool transformChildren, const CTransformState &state)
Callback to process an IDOMVisualRoot node.
Definition customtransform.h:429
virtual IDOMNodePtr transformFormInstance(IImplementation *genericImplementation, const IDOMFormInstancePtr &instance, bool &changed, bool transformChildren, const CTransformState &state)
Callback to process an IDOMFormInstance node.
Definition customtransform.h:475
virtual IDOMNodePtr transformForm(IImplementation *genericImplementation, const IDOMFormPtr &form, bool &changed, bool transformChildren, const CTransformState &state)
Callback to process an IDOMForm node.
Definition customtransform.h:452
virtual ~IImplementation()
Definition customtransform.h:92
virtual IDOMNodePtr transformNode(IImplementation *genericImplementation, const IDOMNodePtr &node, bool &changed, bool transformChildren, const CTransformState &state)
Callback to process an IDOMNode (of any type).
Definition customtransform.h:211
virtual IDOMColorPtr transformColor(IImplementation *genericImplementation, const IDOMColorPtr &color, const CTransformState &state)
Callback to process a color. This will be invoked for any color anywhere in the DOM,...
Definition customtransform.h:143
virtual IDOMNodePtr transformGlyphs(IImplementation *genericImplementation, const IDOMGlyphsPtr &glyphs, bool &changed, const CTransformState &state)
Callback to process an IDOMGlyphs node.
Definition customtransform.h:358
virtual IDOMBrushPtr transformLinearGradientBrush(IImplementation *genericImplementation, const IDOMLinearGradientBrushPtr &gradient, const CTransformState &state)
Callback to process an IDOMLinearGradientBrush.
Definition customtransform.h:557
virtual IDOMNodePtr transformCharPathGroup(IImplementation *genericImplementation, const IDOMCharPathGroupPtr &group, bool &changed, bool transformChildren, const CTransformState &state)
Callback to process an IDOMCharPathGroup.
Definition customtransform.h:284
virtual IDOMBrushPtr transformVisualBrush(IImplementation *genericImplementation, const IDOMVisualBrushPtr &brush, const CTransformState &state)
Callback to process an IDOMVisualBrush.
Definition customtransform.h:599
virtual IDOMNodePtr transformFixedPage(IImplementation *genericImplementation, const IDOMFixedPagePtr &page, bool &changed, bool transformChildren, const CTransformState &state)
Callback to process an IDOMFixedPage.
Definition customtransform.h:234
virtual IDOMNodePtr transformPath(IImplementation *genericImplementation, const IDOMPathNodePtr &path, bool &changed, const CTransformState &state)
Callback to process an IDOMPathNode.
Definition customtransform.h:404
virtual IDOMBrushPtr transformRadialGradientBrush(IImplementation *genericImplementation, const IDOMRadialGradientBrushPtr &gradient, const CTransformState &state)
Callback to process an IDOMRadialGradientBrush.
Definition customtransform.h:578
virtual IAnnotationAppearancePtr transformAnnotationAppearance(IImplementation *genericImplementation, const IAnnotationAppearancePtr &appearance, const FRect &annotationRect)
Callback to process an annotation appearance.
Definition customtransform.h:121
virtual IDOMImagePtr transformImage(IImplementation *genericImplementation, const IDOMImagePtr &image, const CTransformState &state)
Callback to process an image.
Definition customtransform.h:187
virtual IDOMBrushPtr transformShadingPatternBrush(IImplementation *genericImplementation, const IDOMShadingPatternBrushPtr &brush, const CTransformState &state)
Callback to process an IDOMShadingPatternBrush.
Definition customtransform.h:662
virtual IDOMBrushPtr transformSoftMaskBrush(IImplementation *genericImplementation, const IDOMSoftMaskBrushPtr &brush, const CTransformState &state)
Callback to process an IDOMSoftMaskBrush.
Definition customtransform.h:683
virtual IDOMBrushPtr transformBrush(IImplementation *genericImplementation, const IDOMBrushPtr &brush, eBrushUsage usage, const CTransformState &state)
Callback to process any kind of brush.
Definition customtransform.h:495
virtual IDOMNodePtr transformTransparencyGroup(IImplementation *genericImplementation, const IDOMTransparencyGroupPtr &group, bool &changed, bool transformChildren, const CTransformState &state)
Callback to process an IDOMTransparencyGroup.
Definition customtransform.h:309
virtual IDOMBrushPtr transformSolidColorBrush(IImplementation *genericImplementation, const IDOMSolidColorBrushPtr &brush, const CTransformState &state)
Callback to process an IDOMSolidColorBrush.
Definition customtransform.h:515
virtual IDOMBrushPtr transformNullBrush(IImplementation *genericImplementation, const IDOMNullBrushPtr &brush, const CTransformState &state)
Callback to process an IDOMNullBrush.
Definition customtransform.h:727
virtual IDOMBrushPtr transformImageBrush(IImplementation *genericImplementation, const IDOMImageBrushPtr &brush, const CTransformState &state)
Callback to process an IDOMImageBrush.
Definition customtransform.h:620
virtual IDOMNodePtr transformGroup(IImplementation *genericImplementation, const IDOMGroupPtr &group, bool &changed, bool transformChildren, const CTransformState &state)
Callback to process an IDOMGroup.
Definition customtransform.h:259
virtual IDOMBrushPtr transformGradientBrush(IImplementation *genericImplementation, const IDOMGradientBrushPtr &gradient, const CTransformState &state)
Callback to process an IDOMGradientBrush.
Definition customtransform.h:536
virtual IDOMBrushPtr transformTilingPatternBrush(IImplementation *genericImplementation, const IDOMTilingPatternBrushPtr &brush, const CTransformState &state)
Callback to process an IDOMTilingPatternBrush.
Definition customtransform.h:641
virtual IDOMFontPtr transformFont(IImplementation *genericImplementation, const IDOMFontPtr &font, uint32 &index, const CTransformState &state)
Callback to process an IDOMFont.
Definition customtransform.h:380
A transform that allows the implementation to be provided externally.
Definition customtransform.h:64
virtual ~ICustomTransform()
Definition customtransform.h:66
ITransforms provide a method of applying common operations on DOM objects such as brushes,...
Definition transforms.h:135
EDL_API void throwEDLError(uint32 errorcode)
Utility - Throw an IEDLError exception with the given error code.
RectTmpl< double > FRect
Definition edlgeom.h:338
unsigned int uint32
Definition edltypes.h:34
@ EDL_ERR_BAD_ARGUMENTS
General error for bad arguments passed to an API function.
Definition edlerrors.h:42
eBrushUsage
When a CTransformState has been pushed for a brush, this indicates the usage of that brush....
Definition transforms.h:37
static JAWSMAKO_API ICustomTransformPtr create(const IJawsMakoPtr &jawsMako, IImplementation *implementation, const IProgressMonitorPtr &progressMonitor, bool dependsOnClipBounds, bool dependsOnGroupSpace, bool dependsOnRenderingIntent, bool dependsOnTransformScale, bool dependsOnTransformOffset, bool dependsOnBrushUsage, bool dependsOnEdgeMode, bool dependsOnUncoloredTilingBrush)
Create an ICustomTransform object whose underlying methods are supported by the implementation object...
static JAWSMAKO_API ICustomTransformPtr create(const IJawsMakoPtr &jawsMako, IImplementation *implementation, const IProgressMonitorPtr &progressMonitor=IProgressMonitorPtr(), bool dependsOnClipBounds=true, bool dependsOnGroupSpace=true, bool dependsOnRenderingIntent=true, bool dependsOnTransform=true, bool dependsOnBrushUsage=true, bool dependsOnEdgeMode=true, bool dependsOnUncoloredTilingBrush=true)
Create an ICustomTransform object whose underlying methods are supported by the implementation object...
Definition customtransform.h:782
Definition apexcustompostprocess.h:17
EDL::IProgressMonitorPtr IProgressMonitorPtr
Definition types.h:85
#define DECL_SMART_PTR(cls)
Definition smartptr.h:211
Transforms for JawsMako, allowing direct modification of individual brushes, nodes,...
#define JAWSMAKO_API
Definition types.h:29