| synopsis || arguments || prev || next |
void set_scale( bool transpose, bool vflip, bool hflip, float scale)
Java: void Set_scale( boolean transpose, boolean vflip, boolean hflip, float scale)
[Declared in "../apps/support/kdu_region_compositor.h"]
Sets any rotation, flipping or transposition to be performed, and the scale at which the image is to be composed. The interpretation of the transpose, hflip and vflip arguments is identical to that described in conjunction with the kdu_codestream::change_appearance function.
After calling this function, and before calling process, you must call set_buffer_surface to identify the portion of the image you want rendered. You must not assume that the image buffer returned by a previous call to get_composition_buffer is still valid, so you should generally call that function again also to get a handle to the buffer which will hold the composited image.
Note that the current function does not actually verify that the scale parameters are compatible with the composition being constructed. It merely sets some internal state information which will be used to adjust the internal configuration on the next call to get_composition_buffer, get_total_composition_dims or process. Any of these functions may return a NULL response (each function has an obvious NULL return value) if the scale parameters were found to be invalid during any step which they executed internally (this could happen half way through processing a region, if a tile-component with insufficient DWT levels is encountered, for example).
A value larger than 1 implies that the image should be composed at a larger (zoomed in) size than the nominal size associated with the add_compositing_layer function. Conversely, a value smaller than 1 implies a zoomed out representation.
Note that the scaling capabilities of the present implementation are somewhat limited. As a general rule, you should stick to integer-valued up-scaling factors and power of 2 down-scaling values.