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

kdu_region_compositor::set_single_component

Java: Kdu_region_compositor::Set_single_component

int set_single_component( int stream_idx, int component_idx)

Java: int Set_single_component( int stream_idx, int component_idx)

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

Go to class description.


Synopsis

Calling this function will automatically remove (not permanently) all layers previously added using add_compositing_layer, after which it prepares the object to render the compositing surface using just the single component or the indicated code-stream.

If a compositing layer using this code-stream has already been opened (and not permanently destroyed), the present function will re-use the open code-stream resource, rather than opening a new one. Similarly, if the code-stream has been used to display a different single component previously, the code-stream resource can generally be re-used.

Note that this function may cause an error to be generated through kdu_error if some problem occurs while opening the code-stream.


Return Value

-1 if the code-stream cannot yet be opened. This happens only when a JPX/JP2 data source is served by a dynamic cache which does not yet have enough information to actually open the code-stream, or to verify whether or not it exists. If the requested code-stream is known not to exist, the function generates an appropriate error through kdu_error, rather than returning.

If successful, the function returns the index of the actual image component opened, which may be different to the supplied component_idx if that value was outside the range of available components for the code-stream.

Arguments

stream_idx [int]

component_idx [int]


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