Mako 8.4.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
renderspec.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2026 Hybrid Software Helix Ltd. All rights reserved.
3 */
4
5#ifndef JAWSMAKO_RENDERSPEC_H
6#define JAWSMAKO_RENDERSPEC_H
7
12#include <memory>
13#include <jawsmako/types.h>
14#include <edl/icolormanager.h>
15
16namespace JawsMako
17{
18 using namespace EDL;
19
20 //====================================================================================================
21
44 {
45 public:
46 CSpotColorAlias() = default;
53 CSpotColorAlias(const RawString &_spotName, const RawString &_remappedColorant)
54 {
55 spotName = _spotName;
56 remappedColorant = _remappedColorant;
57 }
60 };
61
66
67 //====================================================================================================
68
77 {
78 public:
79 virtual ~IHalftone() = default;
80 };
81
88 class CSpotHalftone : public IHalftone
89 {
90 public:
91
92 // The frequency must be greater than 0.
93 CSpotHalftone(float freq, bool useFullResForFlattening = false)
94 {
95 frequency = freq;
96 useFullResolutionForFlattening = useFullResForFlattening;
97 }
98 float frequency;
103 };
104
122 {
123 public:
124 // Default is CMYK. Resize and set angles to suit
125 CColorSpotHalftone(float freq, bool useFullResForFlattening = false,
126 float cyanAngle = 15.0, float magentaAngle = 75.0f, float yellowAngle = 0.0f, float blackAngle = 45.0f)
127 {
128 frequency = freq;
129 useFullResolutionForFlattening = useFullResForFlattening;
130 angles.resize(4);
131 angles[0] = cyanAngle;
132 angles[1] = magentaAngle;
133 angles[2] = yellowAngle;
134 angles[3] = blackAngle;
135 }
136 float frequency;
142 };
143
153 {
154 public:
156 const float cyanAngle = 15.0,
157 const float magentaAngle = 75.0f,
158 const float yellowAngle = 0.0f,
159 const float blackAngle = 45.0f,
160 const float defaultAngle = 45.0f) : CColorSpotHalftone(freq, false, cyanAngle, magentaAngle, yellowAngle, blackAngle)
161 {
162 angles.resize(5);
163 angles[4] = defaultAngle;
164 }
165 };
166
187
212
219 {
220 public:
222 {
223 threshold = thresh;
224 }
225
227 };
228
229
256 class CEDSHalftone : public IHalftone
257 {
258 public:
260 {
261 // Default is a simple Atkinson monochrome error diffusion screen
262 dropSizes = 1;
263 rows = 3;
264 columns = 4;
265 pixelColumn = 1;
266 denominator = 6;
267 weights[0] = 0;
268 weights[1] = 0;
269 weights[2] = 1;
270 weights[3] = 1;
271 weights[4] = 0;
272 weights[5] = 1;
273 weights[6] = 1;
274 weights[7] = 1;
275 weights[8] = 0;
276 weights[9] = 0;
277 weights[10] = 0;
278 weights[11] = 1;
279 weights[12] = 0;
280 weights[13] = 0;
281 weights[14] = 0;
282 weights[15] = 0;
283 weights[16] = 0;
284 weights[17] = 0;
285 weights[18] = 0;
286 weights[19] = 0;
287 useSerpentine = false;
288 perturbation = 0.0f;
289 }
290
299 };
300
301 //====================================================================================================
302
342
345
375 {
376 public:
385 static JAWSMAKO_API CColorConversionPostProcessSpecPtr create(const IDOMColorSpacePtr &targetSpace,
388
399 static JAWSMAKO_API CColorConversionPostProcessSpecPtr create(const IDOMICCProfilePtr &deviceLink,
400 const IDOMColorSpacePtr &targetSpace,
403
405 {
406 public:
412 IDOMColorSpacePtr targetSpace;
413 IDOMICCProfilePtr deviceLink;
416
417 bool operator== (const CLogicalStep &other) const
418 {
419 return (other.targetSpace == targetSpace)
420 && (other.deviceLink == deviceLink)
421 && (other.intent == intent)
422 && (other.bpc == bpc);
423 }
424
425 bool operator!= (const CLogicalStep &other) const
426 {
427 return ! (*this == other);
428 }
429 };
431
437 static JAWSMAKO_API CColorConversionPostProcessSpecPtr create(const CLogicalSteps &steps);
438
439 ePostProcessType getType() const override
440 {
441 return ePPTColorConversion;
442 }
443
444 public:
446 };
447 #define obj2CColorConversionPostProcessSpec(obj) CColorConversionPostProcessSpecPtr(dynamic_cast<CColorConversionPostProcessSpec *>((IRCObject *) (obj)), true)
448
449 class CToneCurvesPostProcessSpec;
451
463 {
464 public:
499 static JAWSMAKO_API CToneCurvesPostProcessSpecPtr create(const CEDLVector<CFloatVect> &_toneCurves);
500
501 ePostProcessType getType() const override
502 {
503 return ePPTToneCurves;
504 }
505
506 public:
508 };
509 #define obj2CToneCurvesPostProcessSpec(obj) CToneCurvesPostProcessSpecPtr(dynamic_cast<CToneCurvesPostProcessSpec *>((IRCObject *) (obj)), true)
510
511 class CSpotMergePostProcessSpec;
513
548 {
549 public:
561 static JAWSMAKO_API CSpotMergePostProcessSpecPtr create(const IDOMColorSpaceDeviceN::CColorantInfoVect &_mergeSpotColors,
562 const CEDLVector<CFloatVect> &_toneCurves = CEDLVector<CFloatVect>());
563
564 ePostProcessType getType() const override
565 {
566 return ePPTSpotMerge;
567 }
568
569 public:
572 };
573 #define obj2CSpotMergePostProcessSpec(obj) CSpotMergePostProcessSpecPtr(dynamic_cast<CSpotMergePostProcessSpec *>((IRCObject *) (obj)), true)
574
575 class CInkLimitPostProcessSpec;
577
588 {
589 public:
600 static JAWSMAKO_API CInkLimitPostProcessSpecPtr create(float _maxTotalInk,
601 bool _keepBlack = true);
602
603 ePostProcessType getType() const override
604 {
605 return ePPTInkLimit;
606 }
607
608 public:
611 };
612 #define obj2CInkLimitPostProcessSpec(obj) CInkLimitPostProcessSpecPtr(dynamic_cast<CInkLimitPostProcessSpec *>((IRCObject *) (obj)), true)
613
614 class CHalftonePostProcessSpec;
616
626 {
627 public:
628
630
642 static JAWSMAKO_API CHalftonePostProcessSpecPtr create(const IHalftone *halftone, float dpi);
643
644 ePostProcessType getType() const override
645 {
646 return ePPTHalftone;
647 }
648
649 public:
651 float dpi;
652 };
653 #define obj2CHalftonePostProcessSpec(obj) CHalftonePostProcessSpecPtr(dynamic_cast<CHalftonePostProcessSpec *>((IRCObject *) (obj)), true)
654
655 //====================================================================================================
656
665 {
666 public:
684 virtual ~CRenderSpec() = default;
685
686 // Assign base settings from another render spec
713
714 IDOMColorSpacePtr processSpace;
721 bool alpha;
722
726
747
753
754 IOptionalContentPtr optionalContent;
757
762
765 CColorManagerConfigPtr overrideCmmConfig;
774
815 typedef enum
816 {
818 eBPOn = 1,
819 eBPOff = 2,
821
824
826 };
827
836 {
837 public:
839 {
840 compress = true;
841 }
842
843 IDOMImagePtr result;
844 bool compress;
845 };
846 #define renderSpecToCImageRenderSpec(rs) (dynamic_cast<CImageRenderSpec *>(rs))
847
854 {
855 public:
857 {
858 compress = true;
859 }
860
862 bool compress;
863 };
864 #define renderSpecToCImagesRenderSpec(rs) (dynamic_cast<CImagesRenderSpec *>(rs))
865
876 {
877 public:
879 {
880 buffer = nullptr;
881 rowStride = 0;
882 hostEndian = true;
883 }
884
885 void *buffer;
889 };
890 #define renderSpecToCFrameBufferRenderSpec(rs) (dynamic_cast<CFrameBufferRenderSpec *>(rs))
891
920 {
921 public:
922 void *buffer;
939
941 {
942 buffer = nullptr;
943 bufferOfs = 0;
944 bufferOfsBits = 0;
945 rowStride = 0;
946 pixelStride = 0;
947 pixelStrideBits = 0;
948 }
949
950 bool operator== (const CFrameBufferInfo &other) const
951 {
952 return (other.buffer == buffer)
953 && (other.bufferOfs == bufferOfs)
954 && (other.bufferOfsBits == bufferOfsBits)
955 && (other.rowStride == rowStride)
956 && (other.pixelStride == pixelStride)
957 && (other.pixelStrideBits == pixelStrideBits)
958 ;
959 }
960
961 bool operator!= (const CFrameBufferInfo &other) const
962 {
963 return ! (*this == other);
964 }
965 };
967
992 #define renderSpecToCFrameBuffersRenderSpec(rs) (dynamic_cast<CFrameBuffersRenderSpec *>(rs))
993
994 //====================================================================================================
995
1001 class IRenderer : public IRCObject
1002 {
1003 public:
1004
1005 virtual ~IRenderer() = default;
1006
1022 virtual void render(const IDOMNodePtr &node,
1023 CRenderSpec *renderSpec) = 0;
1024 };
1025}
1026
1027#endif /* JAWSMAKO_RENDERSPEC_H */
Definition edlvector.h:30
CEDLVector< CColorantInfo > CColorantInfoVect
Definition idomcolorspace.h:845
Base class Interface for all Reference Counted objects.
Definition ircobject.h:35
bool operator!=(const CLogicalStep &other) const
Definition renderspec.h:425
eRenderingIntent intent
The rendering intent to use.
Definition renderspec.h:414
IDOMColorSpacePtr targetSpace
The target space. Not used for conversion if a device link is supplied.
Definition renderspec.h:412
CLogicalStep()
Definition renderspec.h:407
IDOMICCProfilePtr deviceLink
The device link, if provided.
Definition renderspec.h:413
eBlackPointCompensation bpc
The black point compensation to use.
Definition renderspec.h:415
bool operator==(const CLogicalStep &other) const
Definition renderspec.h:417
This class describes a post-processing step whereby the previous result is color converted to a new c...
Definition renderspec.h:375
CEDLVector< CLogicalStep > CLogicalSteps
Definition renderspec.h:430
ePostProcessType getType() const override
Get the type of post processing this spec represents.
Definition renderspec.h:439
static JAWSMAKO_API CColorConversionPostProcessSpecPtr create(const CLogicalSteps &steps)
Create a color-conversion post process through multiple color spaces and/or links.
static JAWSMAKO_API CColorConversionPostProcessSpecPtr create(const IDOMICCProfilePtr &deviceLink, const IDOMColorSpacePtr &targetSpace, eRenderingIntent intent=eRelativeColorimetric, eBlackPointCompensation bpc=eBPCDefault)
Create a color-conversion post process using a device link profile.
CLogicalSteps conversionSteps
Definition renderspec.h:445
static JAWSMAKO_API CColorConversionPostProcessSpecPtr create(const IDOMColorSpacePtr &targetSpace, eRenderingIntent intent=eRelativeColorimetric, eBlackPointCompensation bpc=eBPCDefault)
Create a color-conversion post process.
CColorSpotHalftone(float freq, bool useFullResForFlattening=false, float cyanAngle=15.0, float magentaAngle=75.0f, float yellowAngle=0.0f, float blackAngle=45.0f)
Definition renderspec.h:125
float frequency
The halftone frequency in LPI to be used.
Definition renderspec.h:136
bool useFullResolutionForFlattening
Definition renderspec.h:137
CEDLVector< float > angles
The vector of angles to use.
Definition renderspec.h:141
CEDLVector< CEDLVector< uint8 > > thresholdArrays
The threshold arrays. Must be width x height bytes in size, and no larger than 65535 bytes.
Definition renderspec.h:210
uint32 height
the height of the halftone cell in pixels
Definition renderspec.h:209
uint32 width
The width of the halftone cell in pixels.
Definition renderspec.h:208
CColorThresholdArrayHalftone()
Definition renderspec.h:202
float perturbation
The weight of random perturbation to apply to each pre-screened pixel which may reduce pattern artifa...
Definition renderspec.h:298
uint32 denominator
The denominator parameter, set to the sum of the weights.
Definition renderspec.h:295
bool useSerpentine
If true, the algorithm reverses scanning direction with each alternate scanline to reduce pattern art...
Definition renderspec.h:297
uint8 rows
The number of rows in the error weighting matrix - 5 maximum.
Definition renderspec.h:292
CEDSHalftone()
Definition renderspec.h:259
uint8 weights[20]
The weight matrix; maximum of 20 entries (5 x 4)
Definition renderspec.h:296
uint8 pixelColumn
The pixel column.
Definition renderspec.h:294
uint8 dropSizes
The number of distinct drop sizes to produce (not including white). Please refer to the class descrip...
Definition renderspec.h:291
uint8 columns
The number of columns in the error weighting matrix - 4 maximum.
Definition renderspec.h:293
int32 pixelStride
Definition renderspec.h:930
uint32 bufferOfs
Offset to the byte containing the first first pixel to be written to.
Definition renderspec.h:923
uint8 bufferOfsBits
Definition renderspec.h:924
void * buffer
Pointer to the frame buffer.
Definition renderspec.h:922
CFrameBufferInfo()
Definition renderspec.h:940
int32 rowStride
Definition renderspec.h:928
int8 pixelStrideBits
Definition renderspec.h:935
bool operator!=(const CFrameBufferInfo &other) const
Definition renderspec.h:961
bool operator==(const CFrameBufferInfo &other) const
Definition renderspec.h:950
int32 rowStride
The distance, in bytes, from one scanline to the next. May be negative.
Definition renderspec.h:886
bool hostEndian
Definition renderspec.h:887
CFrameBufferRenderSpec()
Definition renderspec.h:878
void * buffer
A pointer to the frame buffer memory where the first pixel will be written.
Definition renderspec.h:885
CFrameBufferInfoVect bufferInfo
Definition renderspec.h:982
CFrameBuffersRenderSpec()
Definition renderspec.h:977
bool hostEndian
Definition renderspec.h:989
This class describes a post-processing step whereby halftoning is performed.
Definition renderspec.h:626
JawsMako::CSeparatedColorSpotHalftone CSeparatedColorSpotHalftone
Definition renderspec.h:629
float dpi
Definition renderspec.h:651
static JAWSMAKO_API CHalftonePostProcessSpecPtr create(const IHalftone *halftone, float dpi)
Create a halftone post process.
ePostProcessType getType() const override
Get the type of post processing this spec represents.
Definition renderspec.h:644
const IHalftone * halftone
Definition renderspec.h:650
IDOMImagePtr result
On render completion, this will be populated with the rendered result.
Definition renderspec.h:843
bool compress
If true, the image data will be lightly compressed during render.
Definition renderspec.h:844
CImageRenderSpec()
Definition renderspec.h:838
CDOMImageVect result
On render completion, this will be populated with the rendered result images.
Definition renderspec.h:861
CImagesRenderSpec()
Definition renderspec.h:856
bool compress
If true, the image data will be lightly compressed during render.
Definition renderspec.h:862
This class describes a post-processing step whereby ink limiting via scaling is performed.
Definition renderspec.h:588
static JAWSMAKO_API CInkLimitPostProcessSpecPtr create(float _maxTotalInk, bool _keepBlack=true)
Create an ink-limiting post process.
ePostProcessType getType() const override
Get the type of post processing this spec represents.
Definition renderspec.h:603
bool keepBlack
Definition renderspec.h:610
float maxTotalInk
Definition renderspec.h:609
A base class that describes base rendering properties common to all rendering operations....
Definition renderspec.h:665
CSpotColorNames ignoredSpotColors
Spot components to ignore.
Definition renderspec.h:724
CSpotColorAliasVect aliasedSpotColors
Spot colorant aliases. Please see CSpotColorAlias for further information.
Definition renderspec.h:725
uint32 width
The width, in pixels, of the result.
Definition renderspec.h:716
uint8 depth
The depth, in bits (8 or 16), of the result.
Definition renderspec.h:718
CRenderSpec()
Definition renderspec.h:667
IOptionalContentPtr optionalContent
The optional content object for the document.
Definition renderspec.h:754
CColorManagerConfigPtr overrideCmmConfig
An optional CMM configuration override to apply to the given render.
Definition renderspec.h:765
bool alpha
Whether or not alpha information should be produced.
Definition renderspec.h:721
IDOMColorSpaceDeviceN::CColorantInfoVect replacementSpotColors
Definition renderspec.h:743
bool decomposeDeviceN
Definition renderspec.h:727
IDOMColorSpacePtr processSpace
Definition renderspec.h:714
bool ignoreInputIccProfiles
Definition renderspec.h:763
void assignCommon(const CRenderSpec &other)
Definition renderspec.h:687
CSpotColorNames retainedSpotColors
Spot components to generate as distinct separations/channels.
Definition renderspec.h:723
eBlackPreservation preserveBlackForOther
Whether or not to apply black preservation for non-text objects.
Definition renderspec.h:823
virtual ~CRenderSpec()=default
CRenderPostProcessVect postProcesses
Definition renderspec.h:748
eOptionalContentEvent optionalContentEvent
Definition renderspec.h:755
eBlackPreservation preserveBlackForText
Whether or not to apply black preservation for text.
Definition renderspec.h:822
FRect sourceRect
The source area of the DOM that will be mapped to the output width and height.
Definition renderspec.h:719
bool use16BitInternalRendering
Definition renderspec.h:766
uint32 height
The height, in pixels, of the result.
Definition renderspec.h:717
eBlackPreservation
The possible types for enabling/controlling 100% black preservation.
Definition renderspec.h:816
@ eBPDefault
Default behavior.
Definition renderspec.h:817
@ eBPOn
Use black point compensation if applicable during color conversion.
Definition renderspec.h:818
@ eBPOff
Do not use black point compensation during color conversion.
Definition renderspec.h:819
uint8 aaFactor
The aaFactor to be used. 1 means no anti-aliasing. The maximum value is 4.
Definition renderspec.h:720
eRenderingIntent cmykImageRenderingIntent
Definition renderspec.h:760
bool ditherShadingPatterns
Whether or not to apply dithering to shading patterns.
Definition renderspec.h:825
eRenderingIntent rgbImageRenderingIntent
Definition renderspec.h:758
Description of spot halftones, used for color halftoned rendering. Analogous to a PostScript Type 2 H...
Definition renderspec.h:153
CSeparatedColorSpotHalftone(const float freq, const float cyanAngle=15.0, const float magentaAngle=75.0f, const float yellowAngle=0.0f, const float blackAngle=45.0f, const float defaultAngle=45.0f)
Definition renderspec.h:155
RawString remappedColorant
The colorant to which occurrences of spotName will be mapped.
Definition renderspec.h:59
RawString spotName
The name of the spot to map.
Definition renderspec.h:58
CSpotColorAlias(const RawString &_spotName, const RawString &_remappedColorant)
Construct a new CSpotColorAlias object.
Definition renderspec.h:53
bool useFullResolutionForFlattening
Definition renderspec.h:99
float frequency
The frequency of the spot function, in lines per inch.
Definition renderspec.h:98
CSpotHalftone(float freq, bool useFullResForFlattening=false)
Definition renderspec.h:93
This class describes a post-processing step whereby one or more spot colorants folded into the proces...
Definition renderspec.h:548
static JAWSMAKO_API CSpotMergePostProcessSpecPtr create(const IDOMColorSpaceDeviceN::CColorantInfoVect &_mergeSpotColors, const CEDLVector< CFloatVect > &_toneCurves=CEDLVector< CFloatVect >())
Create a tone-mapping post process.
CEDLVector< CFloatVect > toneCurves
Definition renderspec.h:571
IDOMColorSpaceDeviceN::CColorantInfoVect mergeSpotColors
Definition renderspec.h:570
ePostProcessType getType() const override
Get the type of post processing this spec represents.
Definition renderspec.h:564
uint32 width
The width of the halftone cell in pixels.
Definition renderspec.h:183
CEDLVector< uint8 > thresholdArray
The threshold array. Must be width x height bytes in size, and no larger than 65535 bytes.
Definition renderspec.h:185
uint32 height
the height of the halftone cell in pixels
Definition renderspec.h:184
CThresholdArrayHalftone()
Definition renderspec.h:177
uint8 threshold
Range is 8 bits, 1 to 254 inclusive.
Definition renderspec.h:226
CThresholdHalftone(uint8 thresh=127)
Definition renderspec.h:221
This class describes a post-processing step whereby one or more tone curves (aka calibration curves) ...
Definition renderspec.h:463
CEDLVector< CFloatVect > toneCurves
Definition renderspec.h:507
static JAWSMAKO_API CToneCurvesPostProcessSpecPtr create(const CEDLVector< CFloatVect > &_toneCurves)
Create a tone-mapping post process.
ePostProcessType getType() const override
Get the type of post processing this spec represents.
Definition renderspec.h:501
An abstract base class for communicating halftone information to the Jaws renderer,...
Definition renderspec.h:77
virtual ~IHalftone()=default
A class that describes a post process operation to be (logically) performed after an initial render t...
Definition renderspec.h:315
virtual ePostProcessType getType() const =0
Get the type of post processing this spec represents.
@ ePPTColorConversion
Color convert to a new color space.
Definition renderspec.h:324
@ ePPTCustomSpot
Custom spot color manipulation on the GPU with a specially made shader.
Definition renderspec.h:330
@ ePPTInkLimit
Ink limiting via scaling.
Definition renderspec.h:327
@ ePPTCustomSpotMerge
Custom spot merging on the GPU with a specially made shader.
Definition renderspec.h:331
@ ePPTCustomColor
Custom color manipulation on the GPU with a specially made shader.
Definition renderspec.h:329
@ ePPTHalftone
Apply halftone.
Definition renderspec.h:328
@ ePPTSpotMerge
Merge spots.
Definition renderspec.h:326
@ ePPTToneCurves
Apply tone curves.
Definition renderspec.h:325
A generic renderer interface.
Definition renderspec.h:1002
virtual void render(const IDOMNodePtr &node, CRenderSpec *renderSpec)=0
Render a node, targeting the given render specification. Any gray, RGB (except sRGB),...
virtual ~IRenderer()=default
CEDLVector< IDOMImagePtr > CDOMImageVect
Definition edlfwd.h:57
RectTmpl< double > FRect
Definition edlgeom.h:340
unsigned int uint32
Definition edltypes.h:34
_BEGIN_HQN_NAMESPACE typedef signed char int8
Definition edltypes.h:27
signed int int32
Definition edltypes.h:29
unsigned char uint8
Definition edltypes.h:32
eBlackPointCompensation
Black point compensation enumeration.
Definition edlblackpointcompensation.h:17
eRenderingIntent
Rendering intent enumeration.
Definition edlrenderingintent.h:17
@ eBPCDefault
Default behavior.
Definition edlblackpointcompensation.h:19
@ eRenderingIntentUnset
No rendering intent was set.
Definition edlrenderingintent.h:18
@ eRelativeColorimetric
Relative colorimetric rendering intent.
Definition edlrenderingintent.h:20
ePostProcessType
The possible types of post processing operations.
Definition renderspec.h:323
EDLSysString RawString
A raw, 8 bit string. Encoding depends on context.
Definition types.h:152
Definition apexcustompostprocess.h:17
eOptionalContentEvent
Optional content Event types.
Definition types.h:195
@ eOCEView
View.
Definition types.h:197
CEDLVector< U8String > CSpotColorNames
Definition types.h:171
CEDLVector< IPostProcessSpecPtr > CRenderPostProcessVect
Definition renderspec.h:341
CEDLVector< CFrameBufferInfo > CFrameBufferInfoVect
Definition renderspec.h:966
CEDLVector< CSpotColorAlias > CSpotColorAliasVect
An alias for a vector of CSpotColorAlias.
Definition renderspec.h:65
#define DECL_SMART_PTR(cls)
Definition smartptr.h:211
#define JAWSMAKO_API
Definition types.h:29