| synopsis || return value || arguments || prev || next |

kdu_stripe_decompressor::get_recommended_stripe_heights

Java: Kdu_stripe_decompressor::Get_recommended_stripe_heights

bool get_recommended_stripe_heights( int preferred_min_height, int absolute_max_height, int stripe_heights[], int * max_stripe_heights)

Java: boolean Get_recommended_stripe_heights( int preferred_min_height, int absolute_max_height, int[] stripe_heights, int[] max_stripe_heights)

[Declared in "../apps/support/kdu_stripe_decompressor.h"]

Go to class description.


Synopsis

Convenience function, provides recommended stripe heights for the most efficient use of the pull_stripe function, subject to some guidelines provided by the application.

If the image is vertically tiled, the function recommends stripe heights which will advance each component to the next vertical tile boundary. If any of these exceed absolute_max_height, the function scales back the recommendation. In either event, the function returns true, meaning that this is a well-informed recommendation and doing anything else may result in less efficient processing.

If the image is not tiled (no vertical tile boundaries), the function returns small stripe heights which will result in processing the image components in a manner which is roughly proportional to their dimensions. In this case, the function returns false, since there are no serious efficiency implications to selecting quite different stripe heights. The stripe height recommendations in this case are usually governed by the preferred_min_height argument.

In either case, the recommendations may change from time to time, depending on how much data has already been retrieved for each image component by previous calls to pull_stripe. However, the function will never recommend the use of stripe heights larger than those returned via the max_stripe_heights array. These maximum recommendations are determined the first time the function is called after start. New values will only be computed if the object is re-used by calling start again, after finish.


Return Value

True if the recommendation should be taken particularly seriously, meaning there will be efficiency implications to selecting different stripe heights.

Arguments

preferred_min_height [int]

Preferred minimum value for the recommended stripe height of the image component which has the largest stripe height. This value is principally of interest where the image is not vertically tiled.

absolute_max_height [int]

Maximum value which will be recommended for the stripe height of any image component.

stripe_heights[] [int]

Array with one entry for each image component, which receives the recommended stripe height for that component.

max_stripe_heights [int *]

If non-NULL, this argument points to an array with one entry for each image component, which receives an upper bound on the stripe height which this function will ever recommend for that component. There is no upper bound on the stripe height you can actually use in a call to pull_stripe, only an upper bound on the recommendations which this function will produce as it is called from time to time. Thus, if you intend to use this function to guide your stripe selection, the max_stripe_heights information might prove useful in pre-allocating storage for stripe buffers provided by your application.


| top || synopsis || return value || arguments || prev || next |