| synopsis || return value || arguments || prev || next |
bool count_compositing_layers( int & count)
Java: boolean Count_compositing_layers( int[] count)
[Declared in "../apps/compressed_io/jpx.h"]
This function plays a similar role to count_codestreams but counts the number of compositing layers instead. If the data source contains compositing layer header (jplh) boxes, the function counts the number of such boxes. If it contains no compositing layer header boxes, the function returns 1, treating the first codestream as a compositing layer and using the JP2 header to derive colour space and other information which would normally appear within a compositing layer header box.
In either case, the function returns true, unless it cannot be sure what the count is, because insufficient elements from the data source are currently available. This generally means that the underlying jp2_family_src object is fueled by a dynamic cache (i.e., a kdu_cache object).
When the number of compositing layers cannot yet be determined, the function writes the number of compositing layer header boxes found so far into the count argument. This may be 0 if the data source contains no compositing layer header boxes and the end of the source has not yet been encountered.
JPX data sources need not necessarily contain compositing layer header boxes; in this case, each codestream represents a separate compositing layer. However, the reader cannot make this judgement until the end of the file has been encountered. If the data source is ultimately fueled by a dynamic cache whose top-level databin is incomplete, the function may thus have to return with count equal to 0, even if a large number of codestreams have been encountered already. For these reasons, JPX writers are strongly encouraged to include compositing layer header boxes, even if they are not strictly required.
False if the number of compositing layers cannot yet be determined, because the function is unable to parse any further into the source at this point. This generally means that the underlying jp2_family_src object is fueled by a dynamic cache (i.e., a kdu_cache object).
| top || synopsis || return value || arguments || prev || next |