These options are used inside the options string, passed to the decode functions of J2K-Codec.
| bpp |
Bytes Per Pixel |
This option is useful to specify 24 or 32-bit data representation.
If this option is not used, then the value of 4 will be assumed for the buffer allocated inside J2K-Codec and the number of components — for the buffer allocated by user.
Example: "bpp=3".
|
| comp_order, co |
Components Order |
The order of components in the destination buffer.
You can use 'R', 'G', 'B' to denote the according component position.
The current version of J2K-Codec supports only two combinations: BGR (default) and RGB.
For grayscale images and BPP > 1 you can also use 'Y' and '0' (zero) to specify what bytes
to fill and what to skip. For example, "bpp=3,co=0YY" will result in a black-and-yellow image.
Example: "comp_order=RGB".
|
| res_level, rl |
Resolution Level |
This parameter is useful if you want to get 1/4, 1/8, 1/16, etc. of the image.
For example, you may store your textures as 512x512 images and then
use res_level = 1 to get 256x256 image if the user has preferred speed to quality.
Or res_level = 3 to get 64x64 image for mip-mapping.
If this parameter is too large, then the smallest possible resolution will be used.
API users: To get the exact size of a resolution level always use J2K_GetResolutionDimensions()!
Example: "rl=2". |
| mul_by_alpha, mba |
Multiply By Alpha |
If this flag is specified then R, G and B components will be multiplied by Alpha.
Drawing routine that supports alpha may work in two ways:
1. dest_pixel = ( dest_pixel*(255-alpha) + src_pixel*alpha ) >> 8;
2. dest_pixel = ( dest_pixel*(255-alpha) >> 8 ) + src_pixel;
In the second case you save one multiplication per pixel on each draw by performing this multiplication beforehand using the "mul_by_alpha" flag.
Example: "bpp=4,mba". |
| video |
Live-Video Decoding |
Use this option to activate (video=1) or deactivate (video=0) a special video decoding mode. This mode will boost performance at the expense of quality and will also remove interlacing artifacts.
Example: "bpp=4,video=1".
|
| bitmap, bmp |
Windows Bitmap Order |
Use this option to decode in the Windows bitmaps order (upside-down). Useful for fast GDI drawing (for example, in VisualBasic).
Example: "bpp=4,bmp".
|
| nomct |
No YUV=>RGB conversion |
Sometimes it is required to skip YUV to RGB conversion to pass an image directly to YUV hardware.
Use this option to skip multi-component transform and get YUV image.
Example: "nomct".
|
Notes
1. All options must be separated by comma (','). There must be no spaces or tabs in the options string.
2. Short versions can be used equally.
Example
J2K_Image image;
int j2k_err = image.easyDecode("test.j2k", "bpp=3,co=RGB,rl=1");
|