JxlEncoderSetCodestreamLevel

Function JxlEncoderSetCodestreamLevel 

Source
pub unsafe extern "C-unwind" fn JxlEncoderSetCodestreamLevel(
    enc: *mut JxlEncoder,
    level: i32,
) -> JxlEncoderStatus
Expand description

Sets the feature level of the JPEG XL codestream. Valid values are 5 and 10, or -1 (to choose automatically). Using the minimum required level, or level 5 in most cases, is recommended for compatibility with all decoders.

Level 5: for end-user image delivery, this level is the most widely supported level by image decoders and the recommended level to use unless a level 10 feature is absolutely necessary. Supports a maximum resolution 268435456 pixels total with a maximum width or height of 262144 pixels, maximum 16-bit color channel depth, maximum 120 frames per second for animation, maximum ICC color profile size of 4 MiB, it allows all color models and extra channel types except CMYK and the JxlExtraChannelType::Black extra channel, and a maximum of 4 extra channels in addition to the 3 color channels. It also sets boundaries to certain internally used coding tools.

Level 10: this level removes or increases the bounds of most of the level 5 limitations, allows CMYK color and up to 32 bits per color channel, but may be less widely supported.

The default value is -1. This means the encoder will automatically choose between level 5 and level 10 based on what information is inside the JxlBasicInfo structure. Do note that some level 10 features, particularly those used by animated JPEG XL codestreams, might require level 10, even though the JxlBasicInfo only suggests level 5. In this case, the level must be explicitly set to 10, otherwise the encoder will return an error. The encoder will restrict internal encoding choices to those compatible with the level setting.

This setting can only be set at the beginning, before encoding starts.

§Parameters

  • enc: encoder object.
  • level: the level value to set, must be -1, 5, or 10.

§Returns