-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
documenting tags #80
Comments
Hello @kateniolet Documenting enums in IccProfLib/icProfileHeader.h, this would be a nice feature. Perhaps a file located contrib/IccProfLib/icProfileHeader.html with the documented enums, and/or add to Doxygen Config, what are your thoughts? With respect to refactoring, agreed. As we submit PR's others will do same. If you have the time, please consider a PR with any refactored code. I will try to include your suggestion of documenting enums in IccProfLib/icProfileHeader.h in future, but hope you will consider providing the PR. Thank you for sharing, great idea! |
Hello @kateniolet I had a few thoughts for Linking Source -> Specifications for your PR. Confirm the SourcesThe ICC publishes the Specifications at URL https://www.color.org/icc_specs2.xalter ICC Links to Specs
Friendly URI'sGenerate the friendly URI's using location.hash with anchors when converting the pdf->html Perhaps something like:
Summary: The Source -> Specification hyperlinked would be very helpful. Please consider a PR if you have time. |
I'm not 100% sure I follow your suggestion as URL's like https://www.color.org/specification/ICC.2-2023.html#section9.2.3 do not work currently (and I have no idea what/who would be involved in getting that to work) And we probably wouldn't want to hard-code URL's into the source files anyway as that is pretty fragile and verbose, but rather use doxygen to recognize the tags when generating html documentation If that sounds acceptable I'll do a PR with those changes. Probably best, IMHO, is if the format is something like: icSigAToB0Tag = 0x41324230, // @tag A2B0 @icc 2:2023§9.2.1 that way doxygen should (AFAIK, i'm not a doxygen expert by any means) be able to pick it up and create the URL links if we write the accompanying rules. |
What you are looking for is called "PDF Fragment Identifiers" - see RFC 8118 Section 3. Unfortunately, the ICC specification PDFs hosted at https://www.color.org/specification/index.xalter do not include the necessary PDF data structures to make the "best" PDF fragment identifiers, such as using However you can always use a PDF Fragment Identifier that opens to a specific page - and this will work across all browsers: Note that this uses 1-based page numbers and won't match the page numbers visible in footers for the ICC PDFs because the first many pages are labelled with Roman numerals: PS. (Shameless self-promotion) I recently wrote about PDF Fragment Identifiers at the PDF Association website. Note also that not all browsers support all PDF Fragment Identifiers, but |
Hello @kateniolet @petervwyatt Sample Doxygen for DemoIccMAX at URL https://xss.cx/public/docs/DemoIccMAX/ I did a quick mockup for a few URI's in the Source File at URL https://xss.cx/public/docs/DemoIccMAX/d3/d1f/ic_profile_header_8h_source.html for the look and feel. Example
Any feedback appreciated, then will modify the Doxygen Config. |
@xsscx https://xss.cx/public/docs/DemoIccMAX/d3/d1f/ic_profile_header_8h_source.html is working nicely for me, except for the strange symbol (not valid UTF8??) that is before the mentioned clause number... did you mean it to be § ( And won't you want this inside the C++ comment rather than outside so that it will also work in certain IDEs that auto-detect URLs? |
@petervwyatt thank you, good feedback. I'll check it and fix/update over weekend and will check with some IDE's. If any other thoughts and ideas, please do share. thank you! |
Hello @kateniolet and @petervwyatt: I had been working on this enum and Documentation item, then started to check the enums, and now need to resolve things like:
I will return to Documenting the emuns once I can get these ubsan and other issues resolved. If either of you or anyone else can pickup this Documentation for these enums items that would be great. |
Hi @xsscx, not quite understanding what you're asking... do you mean for us to actually edit and commit changes to I do have some scripts and data from my SafeDocs work where I did a multi-way comparison between tags-as-ASCII and tags-as-hex in both this C++ code and the ICC.1 and ICC.2 specs to identify things like mismatched hex tags, mismatched ASCII tags, coded but missing documentation, and documented but missing code. But this was against older versions of both ICC docs and would need updating. Another thing that I found useful was to ensure that ASCII tags were always single-quoted in comments (so as to be sure SPACE was correctly captured). |
I should have provided more info. Having the enums documented and linked to the Spec would be helpful. I did the mockup of the idea from @kateniolet, but when I checked the enums, I saw the ubsan issues and my attention shifted. As you suggested, a PR with appropriate URLs (including PDF fragment identifiers) linking to the relevant sections of the ICC spec on the main branch, if you have the time. With respect to the SafeDocs works, this looks very interesting: Scope: Functions: Heuristics: Having the SafeDocs code to review would help educate me and provide ideas for a refactored mashup of iccScan, IccDumpProfile and other ideas to indicate compliance, potential security and other issues. Please consider sharing your SafeDocs works via PR to aid in the identification and reduction of Bug Classes. Hopefully the documentation of enums will be worked into a PR, if you have time. Let me know if I can provide any additional info and/or reach out via email. Summary
Issues to be addressed in a future PR. |
I'd like to start documenting enums in IccProfLib/icProfileHeader.h something like this, which could be hyperlinked to specification in generated docs, and wanted to check if the format and such before I start doing a bunch:
`
/**
/
typedef enum {
icSigAToB0Tag = 0x41324230, / 'A2B0' §9.2.1 /
icSigAToB1Tag = 0x41324231, / 'A2B1' §9.2.2 /
icSigAToB2Tag = 0x41324232, / 'A2B2' §9.2.3 /
icSigAToB3Tag = 0x41324233, / 'A2B3' §9.2.4 /
icSigAToM0Tag = 0x41324d30, / 'A2M0' §9.2.5 /
icSigBlueColorantTag = 0x6258595A, / 'bXYZ' §12.2.3.2.1 /
icSigBlueMatrixColumnTag = 0x6258595A, / 'bXYZ' §12.2.3.2.1 /
icSigBlueTRCTag = 0x62545243, / 'bTRC' /
icSigBrdfColorimetricParameter0Tag = 0x62637030, / 'bcp0' §9.2.6 /
icSigBrdfColorimetricParameter1Tag = 0x62637031, / 'bcp1' §9.2.7 /
icSigBrdfColorimetricParameter2Tag = 0x62637032, / 'bcp2' §9.2.8 /
icSigBrdfColorimetricParameter3Tag = 0x62637033, / 'bcp3' §9.2.9 /
icSigBrdfSpectralParameter0Tag = 0x62737030, / 'bsp0' §9.2.10 /
icSigBrdfSpectralParameter1Tag = 0x62737031, / 'bsp1' §9.2.11 /
icSigBrdfSpectralParameter2Tag = 0x62737032, / 'bsp2' §9.2.12 /
icSigBrdfSpectralParameter3Tag = 0x62737033, / 'bsp3' §9.2.13 /
icSigBRDFAToB0Tag = 0x62414230, / 'bAB0' §9.2.14 /
icSigBRDFAToB1Tag = 0x62414231, / 'bAB1' §9.2.15 /
icSigBRDFAToB2Tag = 0x62414232, / 'bAB2' §9.2.16 /
icSigBRDFAToB3Tag = 0x62414233, / 'bAB3' §9.2.17 /
icSigBRDFDToB0Tag = 0x62444230, / 'bDB0' §9.2.26 /
icSigBRDFDToB1Tag = 0x62444231, / 'bDB1' §9.2.27 /
icSigBRDFDToB2Tag = 0x62444232, / 'bDB2' §9.2.28 /
icSigBRDFDToB3Tag = 0x62444233, / 'bDB3' §9.2.29 /
icSigBRDFMToB0Tag = 0x624D4230, / 'bMB0' §9.2.30 /
icSigBRDFMToB1Tag = 0x624D4231, / 'bMB1' §9.2.31*/
icSigBRDFMToB2Tag = 0x624D4232, /* 'bMB2' §9.2.32 /
icSigBRDFMToB3Tag = 0x624D4233, / 'bMB3' §9.2.33 /
icSigBRDFMToS0Tag = 0x624D5330, / 'bMS0' §9.2.34 /
icSigBRDFMToS1Tag = 0x624D5331, / 'bMS1' §9.2.35 /
icSigBRDFMToS2Tag = 0x624D5332, / 'bMS2' §9.2.36 /
icSigBRDFMToS3Tag = 0x624D5333, / 'bMS3' §9.2.37 /
icSigBToA0Tag = 0x42324130, / 'B2A0' §9.2.38 /
icSigBToA1Tag = 0x42324131, / 'B2A1' §9.2.39 /
icSigBToA2Tag = 0x42324132, / 'B2A2' §9.2.40 /
icSigBToA3Tag = 0x42324133, / 'B2A3' §9.2.41 /
icSigCalibrationDateTimeTag = 0x63616C74, / 'calt' §9.2.46 /
icSigCharTargetTag = 0x74617267, / 'targ' §9.2.47 /
icSigChromaticAdaptationTag = 0x63686164, / 'chad' /
icSigChromaticityTag = 0x6368726D, / 'chrm' /
icSigCicpTag = 0x63696370, / 'cicp' §9.2.48 /
icSigColorEncodingParamsTag = 0x63657074, / 'cept' §9.2.49 /
icSigColorSpaceNameTag = 0x63736e6d, / 'csnm' §9.2.50 /
icSigColorantInfoTag = 0x636c696e, / 'clin' §9.2.53 /
icSigColorantInfoOutTag = 0x636c696f, / 'clio' §9.2.54 /
icSigColorantOrderTag = 0x636C726F, / 'clro' §9.2.51 /
icSigColorantOrderOutTag = 0x636c6f6f, / 'cloo' §9.2.52 /
icSigColorantTableTag = 0x636C7274, / 'clrt' /
icSigColorantTableOutTag = 0x636C6F74, / 'clot' /
icSigColorimetricIntentImageStateTag = 0x63696973, / 'ciis' §9.2.55 /
icSigCopyrightTag = 0x63707274, / 'cprt' §9.2.56 /
icSigCrdInfoTag = 0x63726469, / 'crdi' Removed in V4 /
icSigCustomToStandardPccTag = 0x63327370, / 'c2sp' §9.2.57 /
icSigCxFTag = 0x43784620, / 'CxF ' §9.2.58 /
icSigDataTag = 0x64617461, / 'data' Removed in V4 /
icSigDateTimeTag = 0x6474696D, / 'dtim' Removed in V4 /
#if 0 // not documented!
icSigDeviceMediaWhitePointTag = 0x646d7770, / 'dmwp' /
#endif
icSigDeviceMfgDescTag = 0x646D6E64, / 'dmnd' §9.2.59 /
icSigDeviceModelDescTag = 0x646D6464, / 'dmdd' §9.2.60 /
icSigDeviceSettingsTag = 0x64657673, / 'devs' Removed in V4 /
icSigDToB0Tag = 0x44324230, / 'D2B0' §9.2.77 /
icSigDToB1Tag = 0x44324231, / 'D2B1' §9.2.78 /
icSigDToB2Tag = 0x44324232, / 'D2B2' §9.2.79 /
icSigDToB3Tag = 0x44324233, / 'D2B3' §9.2.80 /
icSigBToD0Tag = 0x42324430, / 'B2D0' §9.2.42 /
icSigBToD1Tag = 0x42324431, / 'B2D1' §9.2.43 /
icSigBToD2Tag = 0x42324432, / 'B2D2' §9.2.44 /
icSigBToD3Tag = 0x42324433, / 'B2D3' §9.2.45 /
icSigGamutTag = 0x67616D74, / 'gamt' /
icSigGamutBoundaryDescription0Tag = 0x67626430, / 'gbd0' §9.2.81 /
icSigGamutBoundaryDescription1Tag = 0x67626431, / 'gbd1' §9.2.82 /
icSigGamutBoundaryDescription2Tag = 0x67626432, / 'gbd2' §9.2.83 /
icSigGamutBoundaryDescription3Tag = 0x67626433, / 'gbd3' §9.2.84 /
icSigHToS0Tag = 0x48325330, / 'H2S0' §9.2.85 /
icSigHToS1Tag = 0x48325331, / 'H2S1' §9.2.86 /
icSigHToS2Tag = 0x48325332, / 'H2S2' §9.2.87 /
icSigHToS3Tag = 0x48325333, / 'H2S3' §9.2.88 /
icSigGrayTRCTag = 0x6b545243, / 'kTRC' /
icSigGreenColorantTag = 0x6758595A, / 'gXYZ' §12.2.3.2.2 /
icSigGreenMatrixColumnTag = 0x6758595A, / 'gXYZ' §12.2.3.2.2 /
icSigGreenTRCTag = 0x67545243, / 'gTRC' /
icSigLuminanceTag = 0x6C756d69, / 'lumi' /
icSigMaterialDefaultValuesTag = 0x6D647620, / 'mdv ' §9.2.89 /
icSigMaterialTypeArrayTag = 0x6d637461, / 'mcta' §9.2.90 /
icSigMToA0Tag = 0x4d324130, / 'M2A0' §9.2.95 /
icSigMToB0Tag = 0x4d324230, / 'M2B0' §9.2.96 /
icSigMToB1Tag = 0x4d324231, / 'M2B1' §9.2.97 /
icSigMToB2Tag = 0x4d324232, / 'M2B2' §9.2.98 /
icSigMToB3Tag = 0x4d324233, / 'M2B3' §9.2.99 /
icSigMToS0Tag = 0x4d325330, / 'M2S0' §9.2.100 /
icSigMToS1Tag = 0x4d325331, / 'M2S1' §9.2.101 /
icSigMToS2Tag = 0x4d325332, / 'M2S2' §9.2.102 /
icSigMToS3Tag = 0x4d325333, / 'M2S3' §9.2.103 /
icSigMeasurementTag = 0x6D656173, / 'meas' /
icSigMediaBlackPointTag = 0x626B7074, / 'bkpt' /
icSigMediaWhitePointTag = 0x77747074, / 'wtpt' §9.2.93 /
icSigMetaDataTag = 0x6D657461, / 'meta' §9.2.94 /
#if 0
icSigNamedColorTag = 0x6E636f6C, / 'ncol' OBSOLETE, use ncl2 /
#endif
icSigNamedColorTag = 0x6e6d636C, / 'nmcl' use for V5 §9.2.104 /
icSigNamedColor2Tag = 0x6E636C32, / 'ncl2' /
icSigOutputResponseTag = 0x72657370, / 'resp' /
icSigPerceptualRenderingIntentGamutTag = 0x72696730, / 'rig0' §9.2.105 /
icSigPreview0Tag = 0x70726530, / 'pre0' /
icSigPreview1Tag = 0x70726531, / 'pre1' /
icSigPreview2Tag = 0x70726532, / 'pre2' /
icSigPrintConditionTag = 0x7074636e, / 'ptcn' /
icSigProfileDescriptionTag = 0x64657363, / 'desc' §9.2.106 /
icSigProfileSequenceDescTag = 0x70736571, / 'pseq' /
icSigProfileSequceIdTag = 0x70736964, / 'psid' /
icSigPs2CRD0Tag = 0x70736430, / 'psd0' Removed in V4 /
icSigPs2CRD1Tag = 0x70736431, / 'psd1' Removed in V4 /
icSigPs2CRD2Tag = 0x70736432, / 'psd2' Removed in V4 /
icSigPs2CRD3Tag = 0x70736433, / 'psd3' Removed in V4 /
icSigPs2CSATag = 0x70733273, / 'ps2s' Removed in V4 /
icSigPs2RenderingIntentTag = 0x70733269, / 'ps2i' Removed in V4 /
icSigRedColorantTag = 0x7258595A, / 'rXYZ' §12.2.3.2.3 /
icSigRedMatrixColumnTag = 0x7258595A, / 'rXYZ' §12.2.3.2.3 /
icSigRedTRCTag = 0x72545243, / 'rTRC' /
icSigReferenceNameTag = 0x72666e6d, / 'rfnm' §9.2.108 /
icSigSaturationRenderingIntentGamutTag = 0x72696732, / 'rig2' §9.2.109 /
icSigScreeningDescTag = 0x73637264, / 'scrd' Removed in V4 /
icSigScreeningTag = 0x7363726E, / 'scrn' Removed in V4 /
icSigSpectralDataInfoTag = 0x7364696e, / 'sdin' /
icSigSpectralWhitePointTag = 0x73777074, / 'swpt' §9.2.112 /
icSigSpectralViewingConditionsTag = 0x7376636e, / 'svcn' §9.2.111 /
icSigStandardToCustomPccTag = 0x73326370, / 's2cp' §9.2.113 /
icSigSurfaceMapTag = 0x736D6170, / 'smap' §9.2.114 /
icSigTechnologyTag = 0x74656368, / 'tech' §9.2.115 /
icSigUcrBgTag = 0x62666420, / 'bfd ' Removed in V4 /
icSigViewingCondDescTag = 0x76756564, / 'vued' /
icSigViewingConditionsTag = 0x76696577, / 'view' */
/* Private tags*/
icSigEmbeddedV5ProfileTag = 0x49434335, /* 'ICC5' */
} icTagSignature;
`
The text was updated successfully, but these errors were encountered: