77 #include "jasper/jas_image.h" 78 #include "jasper/jas_stream.h" 87 #define JPC_MAXRLVLS 33 90 #define JPC_MAXBANDS (3 * JPC_MAXRLVLS + 1) 93 #define JPC_MAXLYRS 16384 104 #define JPC_CS_INIT 0 106 #define JPC_CS_MHDR 1 108 #define JPC_CS_THDR 2 110 #define JPC_CS_MTLR 3 112 #define JPC_CS_TDATA 4 129 uint_fast16_t numcomps;
140 uint_fast16_t tileno;
150 uint_fast8_t numparts;
189 uint_fast32_t height;
200 uint_fast32_t tilewidth;
203 uint_fast32_t tileheight;
207 uint_fast32_t tilexoff;
211 uint_fast32_t tileyoff;
214 uint_fast16_t numcomps;
217 jpc_sizcomp_t *comps;
230 #define JPC_COX_PRT 0x01 232 #define JPC_COD_SOP 0x02 234 #define JPC_COD_EPH 0x04 242 #define JPC_COD_LRCPPRG 0 245 #define JPC_COD_RLCPPRG 1 247 #define JPC_COD_RPCLPRG 2 249 #define JPC_COD_PCRLPRG 3 251 #define JPC_COD_CPRLPRG 4 257 #define JPC_COX_LAZY 0x01 258 #define JPC_COX_RESET 0x02 259 #define JPC_COX_TERMALL 0x04 260 #define JPC_COX_VSC 0x08 261 #define JPC_COX_PTERM 0x10 262 #define JPC_COX_SEGSYM 0x20 265 #define JPC_COX_INS 0x00 266 #define JPC_COX_RFT 0x01 269 #define JPC_COD_NOMCT 0x00 270 #define JPC_COD_MCT 0x01 273 #define JPC_COX_CBLKSIZEEXPN(x) ((x) - 2) 275 #define JPC_COX_GETCBLKSIZEEXPN(x) ((x) + 2) 282 uint_fast8_t parwidthval;
285 uint_fast8_t parheightval;
297 uint_fast8_t numdlvls;
300 uint_fast8_t cblkwidthval;
303 uint_fast8_t cblkheightval;
306 uint_fast8_t cblksty;
315 jpc_coxrlvl_t rlvls[JPC_MAXRLVLS];
330 uint_fast16_t numlyrs;
333 uint_fast8_t mctrans;
336 jpc_coxcp_t compparms;
345 uint_fast16_t compno;
348 jpc_coxcp_t compparms;
357 #define JPC_RGN_MAXSHIFT 0x00 362 uint_fast16_t compno;
368 uint_fast8_t roishift;
380 #define JPC_QCX_NOQNT 0 381 #define JPC_QCX_SIQNT 1 382 #define JPC_QCX_SEQNT 2 388 #define JPC_QCX_GETEXPN(x) ((x) >> 11) 389 #define JPC_QCX_GETMANT(x) ((x) & 0x07ff) 390 #define JPC_QCX_EXPN(x) (assert(!((x) & (~0x1f))), (((x) & 0x1f) << 11)) 391 #define JPC_QCX_MANT(x) (assert(!((x) & (~0x7ff))), ((x) & 0x7ff)) 404 uint_fast16_t *stepsizes;
407 uint_fast8_t numguard;
416 uint_fast16_t compno;
419 jpc_qcxcp_t compparms;
428 jpc_qcxcp_t compparms;
443 uint_fast8_t rlvlnostart;
447 uint_fast8_t rlvlnoend;
451 uint_fast16_t compnostart;
455 uint_fast16_t compnoend;
459 uint_fast16_t lyrnoend;
464 typedef jpc_pocpchg_t jpc_pchg_t;
474 jpc_pocpchg_t *pchgs;
520 #define JPC_COM_BIN 0x00 521 #define JPC_COM_LATIN 0x01 569 jpc_crgcomp_t *comps;
621 #define JPC_MS_MIN 0xff00 624 #define JPC_MS_MAX 0xffff 627 #define JPC_MS_INMIN 0xff80 629 #define JPC_MS_INMAX 0xffff 632 #define JPC_MS_SOC 0xff4f 633 #define JPC_MS_SOT 0xff90 634 #define JPC_MS_SOD 0xff93 635 #define JPC_MS_EOC 0xffd9 638 #define JPC_MS_SIZ 0xff51 641 #define JPC_MS_COD 0xff52 642 #define JPC_MS_COC 0xff53 643 #define JPC_MS_RGN 0xff5e 644 #define JPC_MS_QCD 0xff5c 645 #define JPC_MS_QCC 0xff5d 646 #define JPC_MS_POC 0xff5f 649 #define JPC_MS_TLM 0xff55 650 #define JPC_MS_PLM 0xff57 651 #define JPC_MS_PLT 0xff58 652 #define JPC_MS_PPM 0xff60 653 #define JPC_MS_PPT 0xff61 656 #define JPC_MS_SOP 0xff91 657 #define JPC_MS_EPH 0xff92 660 #define JPC_MS_CRG 0xff63 661 #define JPC_MS_COM 0xff64 683 struct jpc_msops_s *ops;
689 typedef struct jpc_msops_s {
692 void (*destroyparms)(jpc_ms_t *ms);
695 int (*getparms)(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
698 int (*putparms)(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
701 int (*dumpparms)(jpc_ms_t *ms, FILE *out);
710 jpc_cstate_t *jpc_cstate_create(
void);
713 void jpc_cstate_destroy(jpc_cstate_t *cstate);
716 jpc_ms_t *jpc_ms_create(
int type);
719 void jpc_ms_destroy(jpc_ms_t *ms);
722 #define JPC_MS_HASPARMS(x) \ 723 (!((x) == JPC_MS_SOC || (x) == JPC_MS_SOD || (x) == JPC_MS_EOC || \ 724 (x) == JPC_MS_EPH || ((x) >= 0xff30 && (x) <= 0xff3f))) 727 #define jpc_ms_gettype(ms) \ 731 jpc_ms_t *jpc_getms(jas_stream_t *in, jpc_cstate_t *cstate);
734 int jpc_putms(jas_stream_t *out, jpc_cstate_t *cstate, jpc_ms_t *ms);
737 int jpc_getdata(jas_stream_t *in, jas_stream_t *out,
long n);
740 int jpc_putdata(jas_stream_t *out, jas_stream_t *in,
long n);
743 void jpc_ms_dump(jpc_ms_t *ms, FILE *out);
746 int jpc_getuint8(jas_stream_t *in, uint_fast8_t *val);
749 int jpc_getuint16(jas_stream_t *in, uint_fast16_t *val);
752 int jpc_getuint32(jas_stream_t *in, uint_fast32_t *val);
755 int jpc_putuint8(jas_stream_t *out, uint_fast8_t val);
758 int jpc_putuint16(jas_stream_t *out, uint_fast16_t val);
761 int jpc_putuint32(jas_stream_t *out, uint_fast32_t val);