## Printer Device Driver

[prev][next][parent][TOC]

### GplJournalCalcBandSize

Description

This function helps you decide if you need to break the page up into bands. If you do need to journal, then it will set up the band size to be constrained by the memory limit and to be a multiple of the modulus.

Based on the page size, number of bits per pel, number of color planes, etc ., the function calculates the number of bytes needed for the page bitmap. If the amount exceeds the memory limit, it calculates the number of bands into which to break the page.

Format

    APIRET APIENTRY GplJournalCalcBandSize(

                       PIJOURNAL  pIJournal,           // Journal data structure

                       USHORT     usBitsPerPel,        // 1, 4, 8, or 24 bits per pel

                       USHORT     usNumPlanes,         // Number of color planes

                       USHORT     usModulus,           // Band size should be a multiple of this

                       USHORT     usDotsPerColumn,     // Resolution

                       ULONG      ulMaxBandMem );      // Maximum memory available for banding

Parameters

pIJournal (PIJOURNAL) Journal data structure. The following input fields are used:

usXLength Length of page in pels along x axis.
usYLength Length of page in pels along y axis.
bPortrait Orientation of page-portrait or landscape.

usBitsPerPel (USHORT) Page bitmap, number of bits per pel.

usNumPlanes (USHORT) Page bitmap, number of planes.

usModulus (USHORT) The band size must be zero or a multiple of this number. This may be necessary to cause byte, word, or Dword alignment to align band size to match the width of a print head. This functionality may also be helpful if you need to send the bits in a certain column height.

usDotsPerColumn (USHORT) Resolution.

ulMaxBandMem (ULONG) Maximum memory available for banding.

This parameter is the limit to the number of bytes that your band bitmap can exceed.

Returns

FALSE Journaling is not necessary.
TRUE Journaling is necessary. The following is filled in and valid:
pIJournal (PIJOURNAL) Journal data structure

usBandLength Band length in pels

pIJournal is output with usBandLength updated as follows:

x-band length indicates landscape orientation.
y-band length indicates portrait orientation.

Notes

This function should be called at COMPLETE_OPEN_DC time; because at this time, job properties have been obtained that may affect how pIJournal is filled in (for example, form size, mono/color selections).