diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-11-01 22:39:01 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-11-01 22:39:01 +0000 |
commit | ebd5d47022a0bd4539719348c150602d958d4e00 (patch) | |
tree | f706ae5954969ac3e4c0f4f985d396ed5ca2530b /converter/other/jpeg2000/libjasper/base | |
parent | 5e91e2d3ffb0e9bc2a342dcf6f0ba951b95c601e (diff) | |
download | netpbm-mirror-ebd5d47022a0bd4539719348c150602d958d4e00.tar.gz netpbm-mirror-ebd5d47022a0bd4539719348c150602d958d4e00.tar.xz netpbm-mirror-ebd5d47022a0bd4539719348c150602d958d4e00.zip |
Add -size, cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4449 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/jpeg2000/libjasper/base')
-rw-r--r-- | converter/other/jpeg2000/libjasper/base/jas_image.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/converter/other/jpeg2000/libjasper/base/jas_image.c b/converter/other/jpeg2000/libjasper/base/jas_image.c index 5ee13a0d..c6f984c1 100644 --- a/converter/other/jpeg2000/libjasper/base/jas_image.c +++ b/converter/other/jpeg2000/libjasper/base/jas_image.c @@ -675,7 +675,7 @@ int jas_image_fmtfromname(char *name) return -1; } ++ext; - /* Try to find a format that uses this extension. */ + /* Try to find a format that uses this extension. */ for (i = 0, fmtinfo = jas_image_fmtinfos; i < jas_image_numfmts; ++i, ++fmtinfo) { /* Do we have a match? */ @@ -686,25 +686,28 @@ int jas_image_fmtfromname(char *name) return -1; } -/******************************************************************************\ +/*****************************************************************************\ * Miscellaneous operations. -\******************************************************************************/ +\*****************************************************************************/ -uint_fast32_t jas_image_rawsize(jas_image_t *image) -{ - uint_fast32_t rawsize; - uint_fast32_t cmptno; - jas_image_cmpt_t *cmpt; +uint_fast32_t +jas_image_rawsize(jas_image_t * const imageP) { +/*---------------------------------------------------------------------------- + The raw size of the image, i.e. the number of bytes the raster of the image + would take if just represented simply, with no compression. +-----------------------------------------------------------------------------*/ + uint_fast32_t rawsize; + uint_fast32_t cmptno; - rawsize = 0; - for (cmptno = 0; cmptno < image->numcmpts_; ++cmptno) { - cmpt = image->cmpts_[cmptno]; - rawsize += (cmpt->width_ * cmpt->height_ * cmpt->prec_ + - 7) / 8; - } - return rawsize; + for (cmptno = 0, rawsize = 0; cmptno < imageP->numcmpts_; ++cmptno) { + jas_image_cmpt_t * const cmptP = imageP->cmpts_[cmptno]; + rawsize += (cmptP->width_ * cmptP->height_ * cmptP->prec_ + 7) / 8; + } + return rawsize; } + + void jas_image_delcmpt(jas_image_t *image, uint_fast16_t cmptno) { if (cmptno >= image->numcmpts_) { |