diff options
author | Merov Linden <merov@lindenlab.com> | 2011-05-04 22:43:51 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2011-05-04 22:43:51 -0700 |
commit | c6c1419faa6e4acef19b3ddfc6c89b4a10bca15f (patch) | |
tree | f604895d955bf2816eb93513448e1a312fc22ad0 /indra/llimage/llimage.h | |
parent | 1ef083244ad8cc603b50c1d737d8efb4ed14bb17 (diff) |
EXP-664 : Make encoding parameters more resilient to bad entries, add levels as encoding parameters, update test applet to support this
Diffstat (limited to 'indra/llimage/llimage.h')
-rw-r--r-- | indra/llimage/llimage.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 18444f3934..c464c3b2b6 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -35,8 +35,21 @@ const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2 const S32 MAX_IMAGE_MIP = 11; // 2048x2048 + +// *TODO : Use MAX_IMAGE_MIP as max discard level and modify j2c management so that the number +// of levels is read from the header's file, not inferred from its size. const S32 MAX_DISCARD_LEVEL = 5; +// JPEG2000 size constraints +// Those are declared here as they are germane to other image constraints used in the viewer +// and declared right here. Some come from the JPEG2000 spec, some conventions specific to SL. +const S32 MAX_DECOMPOSITION_LEVELS = 32; // Number of decomposition levels cannot exceed 32 according to jpeg2000 spec +const S32 MIN_DECOMPOSITION_LEVELS = 5; // the SL viewer will *crash* trying to decode images with fewer than 5 decomposition levels (unless image is small that is) +const S32 MAX_PRECINCT_SIZE = 2048; // No reason to be bigger than MAX_IMAGE_SIZE +const S32 MIN_PRECINCT_SIZE = 4; // Can't be smaller than MIN_BLOCK_SIZE +const S32 MAX_BLOCK_SIZE = 64; // Max total block size is 4096, hence 64x64 when using square blocks +const S32 MIN_BLOCK_SIZE = 4; // Min block dim is 4 according to jpeg2000 spec + const S32 MIN_IMAGE_SIZE = (1<<MIN_IMAGE_MIP); // 4, only used for expand/contract power of 2 const S32 MAX_IMAGE_SIZE = (1<<MAX_IMAGE_MIP); // 2048 const S32 MIN_IMAGE_AREA = MIN_IMAGE_SIZE * MIN_IMAGE_SIZE; |