Lines Matching refs:pxformseq
92 static int jas_cmpxformseq_append(jas_cmpxformseq_t *pxformseq,
94 static int jas_cmpxformseq_appendcnvt(jas_cmpxformseq_t *pxformseq,
96 static int jas_cmpxformseq_resize(jas_cmpxformseq_t *pxformseq, int n);
98 static int mono(jas_iccprof_t *prof, int op, jas_cmpxformseq_t **pxformseq);
101 static void jas_cmpxformseq_destroy(jas_cmpxformseq_t *pxformseq);
102 static int jas_cmpxformseq_delete(jas_cmpxformseq_t *pxformseq, int i);
104 static jas_cmpxformseq_t *jas_cmpxformseq_copy(jas_cmpxformseq_t *pxformseq);
106 static int jas_cmpxformseq_insertpxform(jas_cmpxformseq_t *pxformseq,
280 lut(prof->iccprof, 0, PER, &pxformseq);
281 pxformseqs_set(prof, SEQFWD(PER), pxformseq);
282 lut(prof->iccprof, 1, PER, &pxformseq);
283 pxformseqs_set(prof, SEQREV(PER), pxformseq);
284 lut(prof->iccprof, 0, CLR, &pxformseq);
285 pxformseqs_set(prof, SEQREV(CLR), pxformseq);
286 lut(prof->iccprof, 1, CLR, &pxformseq);
287 pxformseqs_set(prof, SEQREV(CLR), pxformseq);
288 lut(prof->iccprof, 0, SAT, &pxformseq);
289 pxformseqs_set(prof, SEQREV(SAT), pxformseq);
290 lut(prof->iccprof, 1, SAT, &pxformseq);
291 pxformseqs_set(prof, SEQREV(SAT), pxformseq);
382 if (!(xform->pxformseq = jas_cmpxformseq_create()))
391 if (jas_cmpxformseq_append(xform->pxformseq, inpxformseq) ||
392 jas_cmpxformseq_appendcnvt(xform->pxformseq,
394 jas_cmpxformseq_append(xform->pxformseq, outpxformseq))
404 if (jas_cmpxformseq_append(xform->pxformseq, outpxformseq) ||
405 jas_cmpxformseq_appendcnvt(xform->pxformseq,
407 jas_cmpxformseq_append(xform->pxformseq, inpxformseq))
426 if (jas_cmpxformseq_append(xform->pxformseq, inpxformseq) ||
427 jas_cmpxformseq_appendcnvt(xform->pxformseq,
431 if (jas_cmpxformseq_append(xform->pxformseq, outpxformseq) ||
432 jas_cmpxformseq_append(xform->pxformseq, altoutpxformseq))
435 if (jas_cmpxformseq_append(xform->pxformseq, outpxformseq))
438 if (jas_cmpxformseq_appendcnvt(xform->pxformseq,
440 jas_cmpxformseq_append(xform->pxformseq, prfpxformseq))
450 if (jas_cmpxformseq_append(xform->pxformseq, inpxformseq) ||
451 jas_cmpxformseq_appendcnvt(xform->pxformseq,
453 jas_cmpxformseq_append(xform->pxformseq, outpxformseq))
469 jas_cmpxformseq_t *pxformseq;
508 pxformseq = xform->pxformseq;
509 for (i = 0; i < pxformseq->numpxforms; ++i) {
510 pxform = pxformseq->pxforms[i];
544 for (i = 0; i < pxformseq->numpxforms; ++i) {
545 pxform = pxformseq->pxforms[i];
580 if (xform->pxformseq)
581 jas_cmpxformseq_destroy(xform->pxformseq);
591 jas_cmpxformseq_t *pxformseq;
592 pxformseq = 0;
593 if (!(pxformseq = jas_malloc(sizeof(jas_cmpxformseq_t))))
595 pxformseq->pxforms = 0;
596 pxformseq->numpxforms = 0;
597 pxformseq->maxpxforms = 0;
598 if (jas_cmpxformseq_resize(pxformseq, 16))
600 return pxformseq;
602 if (pxformseq)
603 jas_cmpxformseq_destroy(pxformseq);
607 static jas_cmpxformseq_t *jas_cmpxformseq_copy(jas_cmpxformseq_t *pxformseq)
613 if (jas_cmpxformseq_append(newpxformseq, pxformseq))
620 static void jas_cmpxformseq_destroy(jas_cmpxformseq_t *pxformseq)
622 while (pxformseq->numpxforms > 0)
623 jas_cmpxformseq_delete(pxformseq, pxformseq->numpxforms - 1);
624 if (pxformseq->pxforms)
625 jas_free(pxformseq->pxforms);
626 jas_free(pxformseq);
629 static int jas_cmpxformseq_delete(jas_cmpxformseq_t *pxformseq, int i)
631 assert(i >= 0 && i < pxformseq->numpxforms);
632 if (i != pxformseq->numpxforms - 1)
634 jas_cmpxform_destroy(pxformseq->pxforms[i]);
635 pxformseq->pxforms[i] = 0;
636 --pxformseq->numpxforms;
640 static int jas_cmpxformseq_appendcnvt(jas_cmpxformseq_t *pxformseq,
647 pxformseq = 0;
651 static int jas_cmpxformseq_insertpxform(jas_cmpxformseq_t *pxformseq,
657 i = pxformseq->numpxforms;
658 assert(i >= 0 && i <= pxformseq->numpxforms);
659 if (pxformseq->numpxforms >= pxformseq->maxpxforms) {
660 if (jas_cmpxformseq_resize(pxformseq, pxformseq->numpxforms +
664 assert(pxformseq->numpxforms < pxformseq->maxpxforms);
667 n = pxformseq->numpxforms - i;
669 memmove(&pxformseq->pxforms[i + 1], &pxformseq->pxforms[i],
672 pxformseq->pxforms[i] = tmppxform;
673 ++pxformseq->numpxforms;
679 static int jas_cmpxformseq_append(jas_cmpxformseq_t *pxformseq,
686 n = pxformseq->numpxforms + othpxformseq->numpxforms;
687 if (n > pxformseq->maxpxforms) {
688 if (jas_cmpxformseq_resize(pxformseq, n))
695 pxformseq->pxforms[pxformseq->numpxforms] = pxform;
696 ++pxformseq->numpxforms;
703 static int jas_cmpxformseq_resize(jas_cmpxformseq_t *pxformseq, int n)
706 assert(n >= pxformseq->numpxforms);
707 p = jas_realloc2(pxformseq->pxforms, n, sizeof(jas_cmpxform_t *));
711 pxformseq->pxforms = p;
712 pxformseq->maxpxforms = n;
1073 jas_cmpxformseq_t *pxformseq;
1083 if (!(pxformseq = jas_cmpxformseq_create()))
1085 if (jas_cmpxformseq_insertpxform(pxformseq, -1, pxform))
1115 *retpxformseq = pxformseq;
1128 jas_cmpxformseq_t *pxformseq;
1133 pxformseq = 0;
1157 if (!(pxformseq = jas_cmpxformseq_create()))
1159 if (jas_cmpxformseq_insertpxform(pxformseq, -1, pxform))
1202 *retpxformseq = pxformseq;
1215 if (pxformseq) {
1216 jas_cmpxformseq_destroy(pxformseq);