NCEPLIBS-g2  3.4.5
enc_jpeg2000.c File Reference

This Function encodes a grayscale image into a JPEG2000 code stream specified in the JPEG2000 Part-1 standard. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "jasper/jasper.h"

Go to the source code of this file.

Macros

#define JAS_1_700_2
 Define jasper type. More...
 
#define MAXOPTSSIZE   1024
 This Function encodes a grayscale image into a JPEG2000 code stream specified in the JPEG2000 Part-1 standard. More...
 

Typedefs

typedef long g2int
 Long Integer type. More...
 

Detailed Description

This Function encodes a grayscale image into a JPEG2000 code stream specified in the JPEG2000 Part-1 standard.

Author
Stephen Gilbert
Date
2002-12-02

Definition in file enc_jpeg2000.c.

Macro Definition Documentation

◆ JAS_1_700_2

#define JAS_1_700_2

Define jasper type.

Definition at line 12 of file enc_jpeg2000.c.

◆ MAXOPTSSIZE

int MAXOPTSSIZE   1024

This Function encodes a grayscale image into a JPEG2000 code stream specified in the JPEG2000 Part-1 standard.

It uses JasPer Software version 1.500.4 (or 1.700.2 ) written by the University of British Columbia, Image Power Inc, and others. JasPer is available at http: * www.ece.uvic.ca/~mdadams/jasper/.

PROGRAM HISTORY LOG:

  • 2002-12-02 Stephen Gilbert
  • 2004-07-20 Stephen Gilbert - Added retry argument/option to allow option of increasing the maximum number of guard bits to the JPEG2000 algorithm.
Parameters
[in]cinPacked matrix of Grayscale image values to encode.
[in]pwidthPointer to width of image
[in]pheightPointer to height of image
[in]pnbitsPointer to depth (in bits) of image. i.e number of bits used to hold each data value
[in]ltypePointer to indicator of lossless or lossy compression
  • = 1, for lossy compression
  • != 1, for lossless compression
[in]ratioPointer to target compression ratio. (ratio:1) Used only when *ltype == 1.
[in]retry- Pointer to option type. 1 = try increasing number of guard bits otherwise, no additional options
[in]jpclen- Number of bytes allocated for new JPEG2000 code stream in outjpc.
[in]outjpc- Output encoded JPEG2000 code stream
Returns
  • 0 Length in bytes of encoded JPEG2000 code stream.
  • -3 Error decode jpeg2000 code stream.
  • -5 decoded image had multiple color components. Only grayscale is expected.
Note
Requires JasPer Software version 1.500.4 or 1.700.2
Author
Stephen Gilbert
Date
2002-12-02

Typedef Documentation

◆ g2int

typedef long g2int

Long Integer type.

Definition at line 17 of file enc_jpeg2000.c.