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
PR: Add "colour.models.rgb.transfer_functions.log" module. #600
PR: Add "colour.models.rgb.transfer_functions.log" module. #600
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor notes but otherwise looks good!
@@ -58,6 +58,7 @@ | |||
log_encoding_SLog3, log_decoding_SLog3) | |||
from .srgb import eotf_inverse_sRGB, eotf_sRGB | |||
from .viper_log import log_encoding_ViperLog, log_decoding_ViperLog | |||
from .log import log_encoding_Log2, log_decoding_Log2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the module does not depend on anything nor anything really depends on it, please import it in alphabetical order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted! Will take care of that in the future! 👍
@@ -116,6 +117,7 @@ | |||
] | |||
__all__ += ['eotf_inverse_sRGB', 'eotf_sRGB'] | |||
__all__ += ['log_encoding_ViperLog', 'log_decoding_ViperLog'] | |||
__all__ += ['log_encoding_Log2', 'log_decoding_Log2'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alphabetical ordering here too please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted!
@@ -142,7 +144,8 @@ | |||
'S-Log3': log_encoding_SLog3, | |||
'T-Log': log_encoding_FilmLightTLog, | |||
'V-Log': log_encoding_VLog, | |||
'ViperLog': log_encoding_ViperLog | |||
'ViperLog': log_encoding_ViperLog, | |||
'Log2': log_encoding_Log2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure :)
@@ -152,7 +155,7 @@ | |||
'Canon Log 3', 'Canon Log', 'Cineon', 'D-Log', 'ERIMM RGB', 'F-Log', | |||
'Filmic Pro 6', 'Log3G10', 'Log3G12', 'Panalog', 'PLog', 'Protune', | |||
'REDLog', 'REDLogFilm', 'S-Log', 'S-Log2', 'S-Log3', 'T-Log', 'V-Log', | |||
'ViperLog'}** | |||
'ViperLog', 'Log2'}** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted!
@@ -170,7 +173,7 @@ def log_encoding(value, function='Cineon', **kwargs): | |||
'Canon Log 3', 'Canon Log', 'Cineon', 'D-Log', 'ERIMM RGB', 'F-Log', | |||
'Filmic Pro 6', 'Log3G10', 'Log3G12', 'Panalog', 'PLog', 'Protune', | |||
'REDLog', 'REDLogFilm', 'S-Log', 'S-Log2', 'S-Log3', 'T-Log', | |||
'V-Log', 'ViperLog'}**, | |||
'V-Log', 'ViperLog', 'Log2'}**, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And same for the remaining instances (even in the docs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will take care, Thankyou!
|
||
References | ||
---------- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:cite:`TheAcademyofMotionPictureArtsandSciencesa`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thankyou!
|
||
References | ||
---------- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:cite:`TheAcademyofMotionPictureArtsandSciencesb`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thankyou!
|
||
Examples | ||
-------- | ||
Linear numeric input gets encoded as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gets is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure :)
|
||
__all__ = [ | ||
'TestLogEncoding_Log2', | ||
'TestLogDecoding_Log2', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra coma at the end prevents Yapf inlining.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted
docs/colour.models.rst
Outdated
@@ -588,6 +588,8 @@ Log Encoding and Decoding | |||
log_decoding_VLog | |||
log_encoding_ViperLog | |||
log_decoding_ViperLog | |||
log_encoding_Log2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alphabetical ordering please :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted, Thankyou!
@@ -1,9 +1,9 @@ | |||
# | |||
""" | |||
Log2 Shaper Implementation | |||
Common Log Encodings | |||
========================== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful at title marker length: ==========================
should be shorter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, should have taken care. Noted anyways!
The common *Log2* encoding function can be used | ||
to build linear to logarithmic shapers in the | ||
ACES OCIO configuration. | ||
|
||
A (48-nits OCIO) shaper having values in a linear | ||
domain, can be encoded to a logarithmic domain: | ||
|
||
+-------------------+------------------+ | ||
| **Shaper Domain** | **Shaper range** | | ||
+===================+==================+ | ||
| [0.002, 16.291] | [0, 1] | | ||
+-------------------+------------------+ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thankyou! :)
domain, can be encoded to a logarithmic domain: | ||
|
||
+-------------------+------------------+ | ||
| **Shaper Domain** | **Shaper range** | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Title case range for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted!
decoded back to linear domain: | ||
|
||
+-------------------+------------------+ | ||
| **Shaper Range** | **Shaper Domain** | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful, the table will break at the column separator are not aligned, sphinx is very picky with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will take care, Thankyou!
Here is an overview of what got changed by this pull request: Complexity increasing per file
==============================
- colour/models/rgb/transfer_functions/log.py 1
- colour/models/rgb/transfer_functions/tests/test_log.py 3
See the complete overview on Codacy |
LGTM! Thanks @njwardhan! |
This pull request adds the
log.py
module to the 'transfer functions' sub-package in colour models, and contains the following functions:log_encoding_Log2
log_decoding_Log2