Lines Matching refs:prof
207 jas_iccprof_t *prof; in jas_iccprof_create() local
208 prof = 0; in jas_iccprof_create()
209 if (!(prof = jas_malloc(sizeof(jas_iccprof_t)))) { in jas_iccprof_create()
212 if (!(prof->attrtab = jas_iccattrtab_create())) in jas_iccprof_create()
214 memset(&prof->hdr, 0, sizeof(jas_icchdr_t)); in jas_iccprof_create()
215 prof->tagtab.numents = 0; in jas_iccprof_create()
216 prof->tagtab.ents = 0; in jas_iccprof_create()
217 return prof; in jas_iccprof_create()
219 if (prof) in jas_iccprof_create()
220 jas_iccprof_destroy(prof); in jas_iccprof_create()
224 jas_iccprof_t *jas_iccprof_copy(jas_iccprof_t *prof) in jas_iccprof_copy() argument
230 newprof->hdr = prof->hdr; in jas_iccprof_copy()
235 if (!(newprof->attrtab = jas_iccattrtab_copy(prof->attrtab))) in jas_iccprof_copy()
244 void jas_iccprof_destroy(jas_iccprof_t *prof) in jas_iccprof_destroy() argument
246 if (prof->attrtab) in jas_iccprof_destroy()
247 jas_iccattrtab_destroy(prof->attrtab); in jas_iccprof_destroy()
248 if (prof->tagtab.ents) in jas_iccprof_destroy()
249 jas_free(prof->tagtab.ents); in jas_iccprof_destroy()
250 jas_free(prof); in jas_iccprof_destroy()
253 void jas_iccprof_dump(jas_iccprof_t *prof, FILE *out) in jas_iccprof_dump() argument
255 jas_iccattrtab_dump(prof->attrtab, out); in jas_iccprof_dump()
260 jas_iccprof_t *prof; in jas_iccprof_load() local
273 prof = 0; in jas_iccprof_load()
276 if (!(prof = jas_iccprof_create())) { in jas_iccprof_load()
280 if (jas_iccprof_readhdr(in, &prof->hdr)) { in jas_iccprof_load()
284 if (jas_iccprof_gettagtab(in, &prof->tagtab)) { in jas_iccprof_load()
288 jas_iccprof_sorttagtab(&prof->tagtab); in jas_iccprof_load()
290 numtags = prof->tagtab.numents; in jas_iccprof_load()
295 tagtabent = &prof->tagtab.ents[i]; in jas_iccprof_load()
300 if (jas_iccprof_setattr(prof, tagtabent->tag, attrval)) in jas_iccprof_load()
343 if (jas_iccprof_setattr(prof, tagtabent->tag, attrval)) { in jas_iccprof_load()
351 return prof; in jas_iccprof_load()
354 if (prof) in jas_iccprof_load()
355 jas_iccprof_destroy(prof); in jas_iccprof_load()
361 int jas_iccprof_save(jas_iccprof_t *prof, jas_stream_t *out) in jas_iccprof_save() argument
375 tagtab = &prof->tagtab; in jas_iccprof_save()
376 if (!(tagtab->ents = jas_alloc2(prof->attrtab->numattrs, in jas_iccprof_save()
379 tagtab->numents = prof->attrtab->numattrs; in jas_iccprof_save()
383 if (jas_iccattrtab_get(prof->attrtab, i, &attrname, &attrval)) in jas_iccprof_save()
412 prof->hdr.size = curoff; in jas_iccprof_save()
413 if (jas_iccprof_writehdr(out, &prof->hdr)) in jas_iccprof_save()
415 if (jas_iccprof_puttagtab(out, &prof->tagtab)) in jas_iccprof_save()
421 if (jas_iccattrtab_get(prof->attrtab, i, &attrname, &attrval)) in jas_iccprof_save()
435 tagtab->ents[i].off : prof->hdr.size; in jas_iccprof_save()
545 jas_iccattrval_t *jas_iccprof_getattr(jas_iccprof_t *prof, in jas_iccprof_getattr() argument
550 if ((i = jas_iccattrtab_lookup(prof->attrtab, name)) < 0) in jas_iccprof_getattr()
552 if (!(attrval = jas_iccattrval_clone(prof->attrtab->attrs[i].val))) in jas_iccprof_getattr()
559 int jas_iccprof_setattr(jas_iccprof_t *prof, jas_iccattrname_t name, in jas_iccprof_setattr() argument
563 if ((i = jas_iccattrtab_lookup(prof->attrtab, name)) >= 0) { in jas_iccprof_setattr()
565 if (jas_iccattrtab_replace(prof->attrtab, i, name, val)) in jas_iccprof_setattr()
568 jas_iccattrtab_delete(prof->attrtab, i); in jas_iccprof_setattr()
572 if (jas_iccattrtab_add(prof->attrtab, -1, name, val)) in jas_iccprof_setattr()
583 int jas_iccprof_gethdr(jas_iccprof_t *prof, jas_icchdr_t *hdr) in jas_iccprof_gethdr() argument
585 *hdr = prof->hdr; in jas_iccprof_gethdr()
589 int jas_iccprof_sethdr(jas_iccprof_t *prof, jas_icchdr_t *hdr) in jas_iccprof_sethdr() argument
591 prof->hdr = *hdr; in jas_iccprof_sethdr()
1693 jas_iccprof_t *prof; in jas_iccprof_createfrombuf() local
1696 if (!(prof = jas_iccprof_load(in))) in jas_iccprof_createfrombuf()
1699 return prof; in jas_iccprof_createfrombuf()
1706 jas_iccprof_t *prof; in jas_iccprof_createfromclrspc() local
1709 prof = jas_iccprof_createfrombuf(jas_iccprofdata_srgb, in jas_iccprof_createfromclrspc()
1713 prof = jas_iccprof_createfrombuf(jas_iccprofdata_sgray, in jas_iccprof_createfromclrspc()
1717 prof = 0; in jas_iccprof_createfromclrspc()
1720 return prof; in jas_iccprof_createfromclrspc()