Mako 8.2.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
xamlgenerator.h
Go to the documentation of this file.
1/*
2* Copyright (C) 2013-2025 Global Graphics Software Ltd. All rights reserved.
3*/
4
5#ifndef _XAMLGENERATOR_H_
6#define _XAMLGENERATOR_H_
7
8#include <jawsmako/jawsmako.h>
10#include <jawsmako/transforms.h>
11#include <edl/idomcatalog.h>
12
13namespace JawsMako
14{
15 using namespace EDL;
16
17 class IXAMLGenerator;
19
32 {
33 public:
34 virtual ~IXAMLGenerator() {}
35
45 static JAWSMAKO_API IXAMLGeneratorPtr create(const IJawsMakoPtr &jawsMako, const U8String &resourcePrefix = U8String(), const IProgressMonitorPtr &progressMonitor = IProgressMonitorPtr ());
46
56 virtual IRAInputStreamPtr generateXAML(const IDOMNodePtr &node, const IDOMCatalogPtr &catalog = IDOMCatalogPtr()) = 0;
57
67 virtual void generateXAML(const IDOMNodePtr &node, const IOutputStreamPtr &outputStream, const IDOMCatalogPtr &catalog = IDOMCatalogPtr()) = 0;
68
74 {
75 public:
76 IAnnotationPtr annotation;
77 IAnnotationAppearancePtr appearance;
78 IRAInputStreamPtr stream;
79
80 bool operator== (const CAnnotationXAML &other) const
81 {
82 return (other.annotation == annotation)
83 && (other.appearance == appearance)
84 && (other.stream == stream);
85 }
86
87 bool operator!= (const CAnnotationXAML &other) const
88 {
89 return ! (*this == other);
90 }
91
92 };
94
106 virtual IRAInputStreamPtr generateXAMLForPageAndAnnotationAppearances(const IPagePtr &page, CAnnotationXAMLVect &appearanceXAMLs) = 0;
107
122 virtual IRAInputStreamPtr generateXAMLForAppearance(const IAnnotationAppearancePtr &appearance, const IAnnotationPtr &annotation, const IPagePtr &page) = 0;
123
139 virtual void generateXAMLForAppearance(const IAnnotationAppearancePtr &appearance, const IAnnotationPtr &annotation, const IPagePtr &page, const IOutputStreamPtr &outputStream) = 0;
140
141
151 virtual void generateXAMLForPageAnnotationAppearances(const IPagePtr &page, CAnnotationXAMLVect &appearanceXAMLs) = 0;
152
159 virtual IInputStreamPtr getResource(const U8String &name) = 0;
160
166 {
167 public:
169 IInputStreamPtr resource;
170
171 bool operator== (const CResourceEntry &other) const
172 {
173 return (other.name == name)
174 && (other.resource == resource);
175 }
176
177 bool operator!= (const CResourceEntry &other) const
178 {
179 return ! (*this == other);
180 }
181
182 };
183
188 virtual void getResources(CEDLVector<CResourceEntry> &resources) = 0;
189
190 /*
191 * Configuration.
192 */
193
204 virtual void setSubsetFonts(bool subset) = 0;
205
223 virtual void setMergeFonts(bool merge) = 0;
224
230 virtual void setMergeImages(bool merge = true) = 0;
231
245
259
274
281 virtual void setTargetColorSpace(const IDOMColorSpacePtr &targetSpace) = 0;
282
289 virtual void setTargetProfile(const IDOMICCProfilePtr &profile) = 0;
290
298 virtual void applyColorConverterTransform(const IColorConverterTransformPtr &transform) = 0;
299
307 virtual void setRenderResolution(uint32 resolution) = 0;
308
316 virtual void applyRendererTransform(const IRendererTransformPtr &transform) = 0;
317
327
337
347
355 virtual void setJPEGQuality(uint8 quality) = 0;
356
364 virtual void applyEncoderTransform(const IImageEncoderTransformPtr &transform) = 0;
365
366 };
367}
368
369#endif
Definition edlvector.h:30
eDownsamplingMethod
The type of downsampling to be performed.
Definition idomimageresource.h:1937
@ eBicubic
Definition idomimageresource.h:1940
@ eSubsample
Definition idomimageresource.h:1938
Base class Interface for all Reference Counted objects.
Definition ircobject.h:35
eEncodeFormat
Available target image formats.
Definition transforms.h:397
Class for receiving XAML generated for annotation appearances in a bulk fashion.
Definition xamlgenerator.h:74
IRAInputStreamPtr stream
The generated XAML stream.
Definition xamlgenerator.h:78
bool operator!=(const CAnnotationXAML &other) const
Definition xamlgenerator.h:87
IAnnotationPtr annotation
The annotation for which the XAML was generated.
Definition xamlgenerator.h:76
IAnnotationAppearancePtr appearance
The appearance for which the XAML was generated.
Definition xamlgenerator.h:77
bool operator==(const CAnnotationXAML &other) const
Definition xamlgenerator.h:80
Resource entry.
Definition xamlgenerator.h:166
bool operator!=(const CResourceEntry &other) const
Definition xamlgenerator.h:177
IInputStreamPtr resource
Definition xamlgenerator.h:169
U8String name
Definition xamlgenerator.h:168
bool operator==(const CResourceEntry &other) const
Definition xamlgenerator.h:171
A XAML generator for Mako, allowing simple generation of XAML fragments for individual DOM nodes or e...
Definition xamlgenerator.h:32
virtual void setMergeImages(bool merge=true)=0
Set if the XAML writer should attempt to merge adjacent images. The default is true.
virtual void generateXAMLForAppearance(const IAnnotationAppearancePtr &appearance, const IAnnotationPtr &annotation, const IPagePtr &page, const IOutputStreamPtr &outputStream)=0
Alternate form of generateXAMLForAppearance() where an existing stream should be used....
virtual void setMonoImageMaxResolution(float resolution, float threshold=0.0f, IDOMImageDownsamplerFilter::eDownsamplingMethod method=IDOMImageDownsamplerFilter::eSubsample)=0
Set the desired maximum resolution, threshold and downsampling method for monochrome images.
virtual void generateXAML(const IDOMNodePtr &node, const IOutputStreamPtr &outputStream, const IDOMCatalogPtr &catalog=IDOMCatalogPtr())=0
Alternate form of generateXAML() when an existing stream should be used.
virtual void applyEncoderTransform(const IImageEncoderTransformPtr &transform)=0
Apply the given image encoder transform to the contents before writing to XAML. This supersedes the i...
virtual IInputStreamPtr getResource(const U8String &name)=0
Get the stream for a named resource. An exception will be thrown if the resource cannot be found.
virtual IRAInputStreamPtr generateXAMLForAppearance(const IAnnotationAppearancePtr &appearance, const IAnnotationPtr &annotation, const IPagePtr &page)=0
Generate XAML for a given annotation appearance. Provide the annotation and page from which the appea...
virtual void setSubsetFonts(bool subset)=0
Set whether fonts should be subset in the output.
virtual IRAInputStreamPtr generateXAML(const IDOMNodePtr &node, const IDOMCatalogPtr &catalog=IDOMCatalogPtr())=0
Generate XAML for the given DOM Node, returning the result in a stream.
virtual void setRenderResolution(uint32 resolution)=0
Set the resolution to use if page content requires rendering in order to be output as XAML....
virtual void setPreferredMonoImageFormat(IImageEncoderTransform::eEncodeFormat format)=0
Set the desired image format for monochrome images that need to be re-encoded for XAML output....
virtual void setJPEGQuality(uint8 quality)=0
Set the JPEG quality to use when encoding images in JPEG format. Equivalent to calling setParameter()...
virtual void setColorImageMaxResolution(float resolution, float threshold=0.0f, IDOMImageDownsamplerFilter::eDownsamplingMethod method=IDOMImageDownsamplerFilter::eBicubic)=0
Set the desired maximum resolution, threshold and downsampling method for color images for XAML outpu...
virtual IRAInputStreamPtr generateXAMLForPageAndAnnotationAppearances(const IPagePtr &page, CAnnotationXAMLVect &appearanceXAMLs)=0
Generate XAML for the given IPage and all the annotation appearances present on the page....
virtual void setGrayImageMaxResolution(float resolution, float threshold=0.0f, IDOMImageDownsamplerFilter::eDownsamplingMethod method=IDOMImageDownsamplerFilter::eBicubic)=0
Set the desired maximum resolution, threshold and downsampling method for gray images.
CEDLVector< CAnnotationXAML > CAnnotationXAMLVect
Definition xamlgenerator.h:93
virtual void setTargetProfile(const IDOMICCProfilePtr &profile)=0
Set the target color space for the output using an ICC profile. The default behaviour is to,...
virtual void applyColorConverterTransform(const IColorConverterTransformPtr &transform)=0
Apply the given color converter transform to the contents before writing XAML. This supersedes the ta...
virtual void applyRendererTransform(const IRendererTransformPtr &transform)=0
Apply the given renderer transform to the contents before writing XAML. This supersedes the target co...
static JAWSMAKO_API IXAMLGeneratorPtr create(const IJawsMakoPtr &jawsMako, const U8String &resourcePrefix=U8String(), const IProgressMonitorPtr &progressMonitor=IProgressMonitorPtr())
Create a XAML generator instance.
virtual void setMergeFonts(bool merge)=0
Set whether an attempt will be made to merge disparate subsets of a font into a single font.
virtual void setPreferredGrayImageFormat(IImageEncoderTransform::eEncodeFormat format)=0
Set the desired image format for gray images that need to be re-encoded for XAML output....
virtual ~IXAMLGenerator()
Definition xamlgenerator.h:34
virtual void generateXAMLForPageAnnotationAppearances(const IPagePtr &page, CAnnotationXAMLVect &appearanceXAMLs)=0
Generate XAML for all the annotation appearances on the given page. This is generally more efficient ...
virtual void getResources(CEDLVector< CResourceEntry > &resources)=0
Get all the resources in a vector.
virtual void setPreferredColorImageFormat(IImageEncoderTransform::eEncodeFormat format)=0
Set the desired image format for color images that need to be re-encoded for XAML output....
virtual void setTargetColorSpace(const IDOMColorSpacePtr &targetSpace)=0
Set the target color space for the output. The default behaviour is to, where possible,...
unsigned int uint32
Definition edltypes.h:34
unsigned char uint8
Definition edltypes.h:32
EDLSysString U8String
A UTF-8 String.
Definition types.h:144
JawsMako interactive features.
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