OLD | NEW |
1 /* vim: set ts=8 sw=8 noexpandtab: */ | 1 /* vim: set ts=8 sw=8 noexpandtab: */ |
2 // qcms | 2 // qcms |
3 // Copyright (C) 2009 Mozilla Foundation | 3 // Copyright (C) 2009 Mozilla Foundation |
4 // Copyright (C) 1998-2007 Marti Maria | 4 // Copyright (C) 1998-2007 Marti Maria |
5 // | 5 // |
6 // Permission is hereby granted, free of charge, to any person obtaining | 6 // Permission is hereby granted, free of charge, to any person obtaining |
7 // a copy of this software and associated documentation files (the "Software"), | 7 // a copy of this software and associated documentation files (the "Software"), |
8 // to deal in the Software without restriction, including without limitation | 8 // to deal in the Software without restriction, including without limitation |
9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, | 9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, |
10 // and/or sell copies of the Software, and to permit persons to whom the Softwar
e | 10 // and/or sell copies of the Software, and to permit persons to whom the Softwar
e |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 invalid_source(src, "missing xyztag"); | 404 invalid_source(src, "missing xyztag"); |
405 } | 405 } |
406 return num; | 406 return num; |
407 } | 407 } |
408 | 408 |
409 // Read the tag at a given offset rather then the tag_index. | 409 // Read the tag at a given offset rather then the tag_index. |
410 // This method is used when reading mAB tags where nested curveType are | 410 // This method is used when reading mAB tags where nested curveType are |
411 // present that are not part of the tag_index. | 411 // present that are not part of the tag_index. |
412 static struct curveType *read_curveType(struct mem_source *src, uint32_t offset,
uint32_t *len) | 412 static struct curveType *read_curveType(struct mem_source *src, uint32_t offset,
uint32_t *len) |
413 { | 413 { |
414 » static const size_t COUNT_TO_LENGTH[5] = {1, 3, 4, 5, 7}; | 414 » static const uint32_t COUNT_TO_LENGTH[5] = {1, 3, 4, 5, 7}; |
415 struct curveType *curve = NULL; | 415 struct curveType *curve = NULL; |
416 uint32_t type = read_u32(src, offset); | 416 uint32_t type = read_u32(src, offset); |
417 uint32_t count; | 417 uint32_t count; |
418 int i; | 418 int i; |
419 | 419 |
420 if (type != CURVE_TYPE && type != PARAMETRIC_CURVE_TYPE) { | 420 if (type != CURVE_TYPE && type != PARAMETRIC_CURVE_TYPE) { |
421 invalid_source(src, "unexpected type, expected CURV or PARA"); | 421 invalid_source(src, "unexpected type, expected CURV or PARA"); |
422 return NULL; | 422 return NULL; |
423 } | 423 } |
424 | 424 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 } | 659 } |
660 | 660 |
661 static struct lutType *read_tag_lutType(struct mem_source *src, struct tag_index
index, uint32_t tag_id) | 661 static struct lutType *read_tag_lutType(struct mem_source *src, struct tag_index
index, uint32_t tag_id) |
662 { | 662 { |
663 struct tag *tag = find_tag(index, tag_id); | 663 struct tag *tag = find_tag(index, tag_id); |
664 uint32_t offset = tag->offset; | 664 uint32_t offset = tag->offset; |
665 uint32_t type = read_u32(src, offset); | 665 uint32_t type = read_u32(src, offset); |
666 uint16_t num_input_table_entries; | 666 uint16_t num_input_table_entries; |
667 uint16_t num_output_table_entries; | 667 uint16_t num_output_table_entries; |
668 uint8_t in_chan, grid_points, out_chan; | 668 uint8_t in_chan, grid_points, out_chan; |
669 » uint32_t clut_offset, output_offset; | 669 » size_t clut_offset, output_offset; |
670 uint32_t clut_size; | 670 uint32_t clut_size; |
671 size_t entry_size; | 671 size_t entry_size; |
672 struct lutType *lut; | 672 struct lutType *lut; |
673 int i; | 673 int i; |
674 | 674 |
675 /* I'm not sure why the spec specifies a fixed number of entries for LUT
8 tables even though | 675 /* I'm not sure why the spec specifies a fixed number of entries for LUT
8 tables even though |
676 * they have room for the num_entries fields */ | 676 * they have room for the num_entries fields */ |
677 if (type == LUT8_TYPE) { | 677 if (type == LUT8_TYPE) { |
678 num_input_table_entries = 256; | 678 num_input_table_entries = 256; |
679 num_output_table_entries = 256; | 679 num_output_table_entries = 256; |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1204 { | 1204 { |
1205 qcms_profile *profile = NULL; | 1205 qcms_profile *profile = NULL; |
1206 FILE *file = _wfopen(path, L"rb"); | 1206 FILE *file = _wfopen(path, L"rb"); |
1207 if (file) { | 1207 if (file) { |
1208 profile = qcms_profile_from_file(file); | 1208 profile = qcms_profile_from_file(file); |
1209 fclose(file); | 1209 fclose(file); |
1210 } | 1210 } |
1211 return profile; | 1211 return profile; |
1212 } | 1212 } |
1213 #endif | 1213 #endif |
OLD | NEW |