Mako 8.1.0 API
Loading...
Searching...
No Matches
JawsMako::IApexRenderer Class Referenceabstract

A renderer that uses the GPU-accelerated Apex RIP to create images from arbitrary DOM. More...

#include <apexrenderer.h>

Inheritance diagram for JawsMako::IApexRenderer:

Classes

class  CGpuDeviceInfo
 A class representing a GPU device discovered on the current host. More...
 

Public Member Functions

virtual void render (const IDOMNodePtr &node, CRenderSpec *renderSpec)=0
 Render a node, targeting the given render specification. Any gray, RGB (except sRGB), or CMYK space is currently supported for both the process space. Extended gamut (ie CMYKOV or CMYKOVG) ICC color spaces are supported as the final output space, achievable by the use of a color conversion post process. For best results, it is recommended that a wide gamut CMYK profile is used as the process space in order to preserve as much gamut as possible, while still affording normal PDF transparency and CMYK overprint semantics.
 
virtual ITexturePtr uploadImage (void *data, uint32 size, uint8 numComponents, uint32 width, uint32 height, uint32 depth, bool filtered=false)=0
 Upload an image to the GPU preparing for its use as a texture by a custom post processing step (see apexcustompostprocess.h).
 
virtual IFragmentShaderPtr createFragmentShader (void *data, uint32 size)=0
 Create a fragment shader ready to run on the GPU. These fragment shaders must be presented in SPIR-V format suitable for use with the Vulkan graphics API. These are typically written using GLSL and compiled to SPIR-V using glslc (included with the Vulkan SDK) or similar.
 
- 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 IApexRendererPtr create (const IJawsMakoPtr &jawsMako, int32 deviceIndex=-1)
 Create an Apex renderer instance.
 
static JAWSMAKO_API CGpuDeviceInfoVect enumerateGpus ()
 Enumerate all the available GPU devices.
 

Additional Inherited Members

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

Detailed Description

A renderer that uses the GPU-accelerated Apex RIP to create images from arbitrary DOM.

Member Function Documentation

◆ create()

static JAWSMAKO_API IApexRendererPtr JawsMako::IApexRenderer::create ( const IJawsMakoPtr & jawsMako,
int32 deviceIndex = -1 )
static

Create an Apex renderer instance.

Parameters
jawsMakoThe Mako instance.
deviceIndexThe index of the device to use, or -1 for automatic. Device indexes may be discovered with enumerateGpus below; the index passed here is the index within the resulting enumerated GPUs.
Returns
IApexRendererPtr The new renderer instance.

◆ createFragmentShader()

virtual IFragmentShaderPtr JawsMako::IApexRenderer::createFragmentShader ( void * data,
uint32 size )
pure virtual

Create a fragment shader ready to run on the GPU. These fragment shaders must be presented in SPIR-V format suitable for use with the Vulkan graphics API. These are typically written using GLSL and compiled to SPIR-V using glslc (included with the Vulkan SDK) or similar.

Parameters
dataA pointer to the fragment shader data in SPIR-V format.
sizeThe size, in bytes, of the fragment shader data.
Returns
IFragmentShaderPtr The shader ready to be used with a custom post- process step. Objects of this type must be released before the IApexRenderer that created it is released.

◆ enumerateGpus()

static JAWSMAKO_API CGpuDeviceInfoVect JawsMako::IApexRenderer::enumerateGpus ( )
static

Enumerate all the available GPU devices.

Returns
CGpuDeviceInfoVect A vector of all the available GPU devices.

◆ render()

virtual void JawsMako::IApexRenderer::render ( const IDOMNodePtr & node,
CRenderSpec * renderSpec )
pure virtual

Render a node, targeting the given render specification. Any gray, RGB (except sRGB), or CMYK space is currently supported for both the process space. Extended gamut (ie CMYKOV or CMYKOVG) ICC color spaces are supported as the final output space, achievable by the use of a color conversion post process. For best results, it is recommended that a wide gamut CMYK profile is used as the process space in order to preserve as much gamut as possible, while still affording normal PDF transparency and CMYK overprint semantics.

Parameters
nodeThe node to render.
renderSpecA pointer to the concrete render specification to target. CImageRenderSpec, CImagesRenderSpec, CFrameBufferRenderSpec, and CFrameBuffersRenderSpec are supported.

◆ uploadImage()

virtual ITexturePtr JawsMako::IApexRenderer::uploadImage ( void * data,
uint32 size,
uint8 numComponents,
uint32 width,
uint32 height,
uint32 depth,
bool filtered = false )
pure virtual

Upload an image to the GPU preparing for its use as a texture by a custom post processing step (see apexcustompostprocess.h).

Instances must be released prior to the release of the creating IApexRendererPtr in order to satisfy Vulkan API rules.

These images may have one or four components, and may use 8, 16, or 32 bit (single-precision floating point) depth. Little-endian byte ordering is to be used.

The image may be created such that any shader that uses it will receive filtered pixels, using linear interpolation. The default is nearest-neighbour interpolation.

The maximum image dimension supported will differ by GPU, but on typical desktop GPUs and iGPUs, images up to 16384 pixels in each dimension are generally supported. Please see the Vulkan Hardware Database to browse current limits: https://vulkan.gpuinfo.org/displaydevicelimit.php?name=maxImageDimension2D&platform=all

Parameters
dataA pointer to the data to be uploaded. Must be little endian.
sizeThe size, in bytes, of the data.
numComponentsThe number of components in the image. Must be 1 or 4.
widthThe width of the image. Must not exceed the maximum image size of the GPU device in use.
heightThe height of the image. Must not exceed the maximum image size of the GPU device in use.
depthThe depth of the image. Must be 8, 16, or 32 (float)
filteredIf true, the resulting image will be set up for filtered (interpolated) reads from any fragment shader.
Returns
ITexturePtr The uploaded texture ready to be used with a custom post-process step. Objects of this type must be released before the IApexRenderer that created it is released.

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