-
Notifications
You must be signed in to change notification settings - Fork 885
sigmoidalcontrastimage.xml Amend parameter names #5751
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
Open
mmalferov
wants to merge
7
commits into
php:master
Choose a base branch
from
mmalferov:patch-20
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+34
−33
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
93f6844
sigmoidalcontrastimage.xml Amend parameter names
mmalferov 55703ae
Update sigmoidalcontrastimage.xml
mmalferov bd1472f
Update sigmoidalcontrastimage.xml
mmalferov 343ad67
Update sigmoidalcontrastimage.xml
mmalferov 7f498e7
Update sigmoidalcontrastimage.xml
mmalferov 3c953e2
Update sigmoidalcontrastimage.xml
mmalferov 9acf08e
Apply suggestions from code review
mmalferov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,19 +15,21 @@ | |
| <methodparam><type>float</type><parameter>beta</parameter></methodparam> | ||
| <methodparam choice="opt"><type>int</type><parameter>channel</parameter><initializer>Imagick::CHANNEL_DEFAULT</initializer></methodparam> | ||
| </methodsynopsis> | ||
| <para> | ||
| <simpara> | ||
| Adjusts the contrast of an image with a non-linear sigmoidal contrast | ||
| algorithm. Increase the contrast of the image using a sigmoidal transfer | ||
| function without saturating highlights or shadows. Contrast indicates | ||
| how much to increase the contrast (0 is none; 3 is typical; 20 is | ||
| pushing it); mid-point indicates where midtones fall in the resultant | ||
| image (0 is white; 50 is middle-gray; 100 is black). Set sharpen to | ||
| function without saturating highlights or shadows. <parameter>alpha</parameter> indicates | ||
| how much to increase the contrast: <literal>0.00</literal> is none; <literal>3.00</literal> is | ||
| typical; <literal>20.00</literal> is pushing it. | ||
| <parameter>beta</parameter> indicates where midtones fall in the resultant | ||
| image: <literal>0.00</literal> is white; <literal>0.50</literal> is | ||
| middle-gray; <literal>1.00</literal> is black. Set <parameter>sharpen</parameter> to | ||
| &true; to increase the image contrast otherwise the contrast is reduced. | ||
| </para> | ||
| <para> | ||
| </simpara> | ||
| <simpara> | ||
| See also <link xlink:href="&url.imagemagick.usage.color_mods.sigmoidal;">ImageMagick | ||
| v6 Examples - Image Transformations — Sigmoidal Non-linearity Contrast</link> | ||
| </para> | ||
| Examples -- Color Modifications — Sigmoidal Non-linearity Contrast</link>. | ||
| </simpara> | ||
| </refsect1> | ||
|
|
||
| <refsect1 role="parameters"> | ||
|
|
@@ -37,33 +39,35 @@ | |
| <varlistentry> | ||
| <term><parameter>sharpen</parameter></term> | ||
| <listitem> | ||
| <para> | ||
| If true increase the contrast, if false decrease the contrast. | ||
| </para> | ||
| <simpara> | ||
| If &true; increase the contrast, if &false; decrease the contrast. | ||
| </simpara> | ||
| </listitem> | ||
| </varlistentry> | ||
| <varlistentry> | ||
| <term><parameter>alpha</parameter></term> | ||
| <listitem> | ||
| <para> | ||
| The amount of contrast to apply. 1 is very little, 5 is a significant amount, 20 is extreme. | ||
| </para> | ||
| <simpara> | ||
| The amount of contrast to apply. <literal>1.00</literal> is very little, <literal>5.00</literal> | ||
| is a significant amount, <literal>20.00</literal> is extreme. | ||
| </simpara> | ||
| </listitem> | ||
| </varlistentry> | ||
| <varlistentry> | ||
| <term><parameter>beta</parameter></term> | ||
| <listitem> | ||
| <simpara> | ||
| Where the midpoint of the gradient will be. This value should be in the range 0 to 1 - multiplied by the quantum value for ImageMagick. | ||
| Where the midpoint of the gradient will be. This value should be in the range <literal>0.00</literal> | ||
| to <literal>1.00</literal> - multiplied by the quantum value for ImageMagick. | ||
|
Comment on lines
+60
to
+61
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is still super confusing to me, but I have no idea how to write it better. |
||
| </simpara> | ||
| </listitem> | ||
| </varlistentry> | ||
| <varlistentry> | ||
| <term><parameter>channel</parameter></term> | ||
| <listitem> | ||
| <para> | ||
| <simpara> | ||
| Which color channels the contrast will be applied to. | ||
| </para> | ||
| </simpara> | ||
| </listitem> | ||
| </varlistentry> | ||
| </variablelist> | ||
|
|
@@ -86,31 +90,28 @@ | |
|
|
||
| <refsect1 role="examples"> | ||
| &reftitle.examples; | ||
| <para> | ||
| <example> | ||
| <title> | ||
| Create a gradient image using <function>Imagick::sigmoidalContrastImage</function> | ||
| suitable for blending two images together smoothly, with the blending | ||
| defined by $contrast and $the midpoint | ||
| </title> | ||
| <programlisting role="php"> | ||
| <example> | ||
| <title> | ||
| Create a gradient image using <function>Imagick::sigmoidalContrastImage</function> | ||
| suitable for blending two images together smoothly, with the blending | ||
| defined by <parameter>alpha</parameter> and <parameter>beta</parameter> | ||
| </title> | ||
| <programlisting role="php"> | ||
| <![CDATA[ | ||
| <?php | ||
|
|
||
| function generateBlendImage($width, $height, $contrast = 10, $midpoint = 0.5) { | ||
| function generateBlendImage($width, $height, $alpha = 10, $beta = 0.5) | ||
| { | ||
| $imagick = new Imagick(); | ||
| $imagick->newPseudoImage($width, $height, 'gradient:black-white'); | ||
| $quanta = $imagick->getQuantumRange(); | ||
| $imagick->sigmoidalContrastImage(true, $contrast, $midpoint * $quanta["quantumRangeLong"]); | ||
| $imagick->sigmoidalContrastImage(true, $alpha, $beta * $quanta["quantumRangeLong"]); | ||
|
|
||
| return $imagick; | ||
| } | ||
|
|
||
| ?> | ||
| ]]> | ||
| </programlisting> | ||
| </example> | ||
| </para> | ||
| </programlisting> | ||
| </example> | ||
| </refsect1> | ||
|
|
||
| </refentry> | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't think dividing by 100 is correct here. I don't know anything about Imagick, so I think keeping it 0, 50, 100 is safer.