Occasionally we want to pad the border of an image so that there is room for annotation, a color bar, or just for visual effect. mPad does this and if a color bar is desired it adds one (wherever the user specifies, which might be in the pad or might be over the image).
The pad around the edges is filled with NULLS (which will be rendered the same as the minimum in the color table but mJPEG/mViewer). However the user can optionally have NULLs translated to another value with the "-val" argument.
Switches:
Adding a color bar as part of the image is a little trickier than it might at first seem.
A color bar is a rectangular region of pixels whose data values are set so that it gives the impression of the lookup-table used to render the image. To do this, we need the image histogram that mViewer (or whatever renderer) would use when displaying the data.
The easiest way to do this is to 1) use mHistogram to generate the stretchl 2) use mPad to add the pixel array (usually in a pad added around the outside of the image(; and 3) use mViewer with the same pre-build histogram to render the image.
Arguments:
Examples:
Padded image with color bar:
Return Codes: