Tags:
create new tag
view all tags

MuRaster

What is MuRaster?

MuRaster is a simple piece of code that shows how you'd use MuPDF within a printer to rasterise input documents.

It's intended as a basis for printer customers to use when evaluating or tailoring MuPDF for their devices.

Having said that it's simple, it's still quite powerful, with a number of easily configuration options:

  • The color output can be tuned to include any of Greyscale, RGB, CMYK, with or without halftoning.

  • Optionally uses threading (if available) to do background printing (so the next page can be being interpretted while this one is being rendered).

  • Optionally uses threading (if available) to optimise the rendering of bands.

  • Optionally can automatically spot that a page is greyscale, and will drop back to using pure greyscale rendering (saving time).

In addition, it is smart enough so that if any of the above features causes it to run into memory problems, it will progressively drop back to simpler and simpler modes of operation so that we'll still get output (just at the cost of reduced speed).

How to configure MuRaster

There are 2 places to configure MuRaster.

include/mupdf/fitz/config.h

This is the standard MuPDF configuration file. Edit this file to control the colour output possibilities, the input formats required, and the exact font set required.

source/mupdf/tools/muraster.c

This file contains a configuration section at the top. Each option in this section can be set by the integrator simply by editing the file.

Leaving the file unedited gives sane defaults.

The options are currently as follows:

MURASTER_CONFIG_RENDER_THREADS

This controls the number of rendering threads to use. Typically if you are running on a multi-threaded CPU with N cores, you'd set this to N-1 (or N-2 if background printing is enabled).

MURASTER_CONFIG_BGPRINT

This controls whether background printing is used. Typically single threaded CPUs would disable it (set it to 0), multi-threaded CPUs might set it to 1.

MURASTER_CONFIG_X_RESOLUTION

Set to the devices X resolution in dpi.

MURASTER_CONFIG_Y_RESOLUTION

Set to the devices Y resolution in dpi.

MURASTER_CONFIG_WIDTH

The printable page width in inches.

MURASTER_CONFIG_HEIGHT

The printable page height in inches.

MURASTER_CONFIG_STORE_SIZE

The maximum size to use for the fz_store. Typically, set this to the amount of memory free for MuRaster to work with.

MURASTER_CONFIG_MIN_BAND_HEIGHT

The smallest band height we can ever use. On an inkjet printer this would typically be the number of lines printable with one pass of the nozzles.

MURASTER_CONFIG_BAND_MEMORY

The amount of memory to use for each rendering threads render buffer.

MURASTER_CONFIG_GREY_FALLBACK

Whether to attempt "grey page detection" or not.

-- Robin Watts - 2016-11-22

Comments

Topic revision: r1 - 2016-11-22 - RobinWatts
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 2014 Artifex Software Inc