Browse files

beautify: add HDR effect.

  • Loading branch information...
1 parent cc4074b commit 083e42c89230ac2faf0330784f1393bde11a78db @hejiann committed Jul 20, 2012
Showing with 91 additions and 0 deletions.
  1. +1 −0 README
  2. +40 −0 beautify-effect.c
  3. +1 −0 beautify-effect.h
  4. +4 −0 beautify.c
  5. +45 −0 curves/HDR
View
1 README
@@ -28,6 +28,7 @@ CHANGELOG
2012-07-20
fix make install in x86_64
beautify refactor: split the effect code into beautify-feature.c
+beautify: add HDR effect
2012-07-19
beautify: fix memory leak
View
40 beautify-effect.c
@@ -167,6 +167,46 @@ run_effect (gint32 image_ID, BeautifyEffectType effect)
gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_BLUE, 18, blue_pts);
}
break;
+ case BEAUTIFY_EFFECT_HDR:
+ {
+ guint8 red_pts[] = {
+ 0.000000 * 255, 0.003922 * 255,
+ 0.121569 * 255, 0.015686 * 255,
+ 0.247059 * 255, 0.207843 * 255,
+ 0.372549 * 255, 0.396078 * 255,
+ 0.498039 * 255, 0.556863 * 255,
+ 0.623529 * 255, 0.698039 * 255,
+ 0.749020 * 255, 0.811765 * 255,
+ 0.874510 * 255, 0.909804 * 255,
+ 1.000000 * 255, 1.000000 * 255,
+ };
+ guint8 green_pts[] = {
+ 0.000000 * 255, 0.003922 * 255,
+ 0.121569 * 255, 0.015686 * 255,
+ 0.247059 * 255, 0.200000 * 255,
+ 0.372549 * 255, 0.384314 * 255,
+ 0.498039 * 255, 0.541176 * 255,
+ 0.623529 * 255, 0.682353 * 255,
+ 0.749020 * 255, 0.800000 * 255,
+ 0.874510 * 255, 0.901961 * 255,
+ 1.000000 * 255, 1.000000 * 255,
+ };
+ guint8 blue_pts[] = {
+ 0.000000 * 255, 0.054902 * 255,
+ 0.121569 * 255, 0.121569 * 255,
+ 0.247059 * 255, 0.262745 * 255,
+ 0.372549 * 255, 0.407843 * 255,
+ 0.498039 * 255, 0.537255 * 255,
+ 0.623529 * 255, 0.662745 * 255,
+ 0.749020 * 255, 0.780392 * 255,
+ 0.874510 * 255, 0.890196 * 255,
+ 1.000000 * 255, 1.000000 * 255,
+ };
+ gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_RED, 18, red_pts);
+ gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_GREEN, 18, green_pts);
+ gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_BLUE, 18, blue_pts);
+ break;
+ }
case BEAUTIFY_EFFECT_CLASSIC_HDR:
{
guint8 red_pts[] = {
View
1 beautify-effect.h
@@ -26,6 +26,7 @@ typedef enum
BEAUTIFY_EFFECT_INVERT,
BEAUTIFY_EFFECT_GOTHIC_STYLE,
+ BEAUTIFY_EFFECT_HDR,
BEAUTIFY_EFFECT_CLASSIC_HDR,
BEAUTIFY_EFFECT_IMPRESSION,
View
4 beautify.c
@@ -52,6 +52,7 @@ static const BeautifyEffectType basic_effects[] =
static const BeautifyEffectType lomo_effects[] =
{
BEAUTIFY_EFFECT_GOTHIC_STYLE,
+ BEAUTIFY_EFFECT_HDR,
BEAUTIFY_EFFECT_CLASSIC_HDR,
BEAUTIFY_EFFECT_IMPRESSION,
};
@@ -809,6 +810,9 @@ effect_icon_new (BeautifyEffectType effect)
case BEAUTIFY_EFFECT_GOTHIC_STYLE:
title = "Gothic Style";
break;
+ case BEAUTIFY_EFFECT_HDR:
+ title = "HDR";
+ break;
case BEAUTIFY_EFFECT_CLASSIC_HDR:
title = "Classic HDR";
break;
View
45 curves/HDR
@@ -0,0 +1,45 @@
+# GIMP curves tool settings
+
+(time 0)
+(time 0)
+(channel value)
+(curve
+ (curve-type smooth)
+ (n-points 17)
+ (points 34 0.000000 0.000000 -1.000000 -1.000000 0.121569 0.121569 -1.000000 -1.000000 0.247059 0.247059 -1.000000 -1.000000 0.372549 0.372549 -1.000000 -1.000000 0.498039 0.498039 -1.000000 -1.000000 0.623529 0.623529 -1.000000 -1.000000 0.749020 0.749020 -1.000000 -1.000000 0.874510 0.874510 -1.000000 -1.000000 1.000000 1.000000)
+ (n-samples 256)
+ (samples 256 0.000000 0.003922 0.007843 0.011765 0.015686 0.019608 0.023530 0.027451 0.031373 0.035294 0.039216 0.043137 0.047059 0.050981 0.054902 0.058824 0.062745 0.066667 0.070589 0.074510 0.078432 0.082353 0.086275 0.090196 0.094118 0.098040 0.101961 0.105883 0.109804 0.113726 0.117647 0.121569 0.125491 0.129412 0.133334 0.137255 0.141177 0.145098 0.149020 0.152942 0.156863 0.160785 0.164706 0.168628 0.172549 0.176471 0.180392 0.184314 0.188236 0.192157 0.196079 0.200000 0.203922 0.207843 0.211765 0.215687 0.219608 0.223530 0.227451 0.231373 0.235294 0.239216 0.243137 0.247059 0.250981 0.254902 0.258824 0.262745 0.266667 0.270588 0.274510 0.278431 0.282353 0.286275 0.290196 0.294118 0.298039 0.301961 0.305882 0.309804 0.313726 0.317647 0.321569 0.325490 0.329412 0.333333 0.337255 0.341177 0.345098 0.349020 0.352941 0.356863 0.360784 0.364706 0.368627 0.372549 0.376471 0.380392 0.384314 0.388235 0.392157 0.396078 0.400000 0.403921 0.407843 0.411765 0.415686 0.419608 0.423529 0.427451 0.431372 0.435294 0.439216 0.443137 0.447059 0.450980 0.454902 0.458823 0.462745 0.466667 0.470588 0.474510 0.478431 0.482353 0.486274 0.490196 0.494117 0.498039 0.501961 0.505882 0.509804 0.513725 0.517647 0.521568 0.525490 0.529411 0.533333 0.537255 0.541176 0.545098 0.549019 0.552941 0.556862 0.560784 0.564705 0.568627 0.572549 0.576470 0.580392 0.584313 0.588235 0.592156 0.596078 0.600000 0.603921 0.607843 0.611764 0.615686 0.619607 0.623529 0.627451 0.631372 0.635294 0.639215 0.643137 0.647059 0.650980 0.654902 0.658823 0.662745 0.666666 0.670588 0.674510 0.678431 0.682353 0.686274 0.690196 0.694118 0.698039 0.701961 0.705883 0.709804 0.713726 0.717647 0.721569 0.725490 0.729412 0.733334 0.737255 0.741177 0.745098 0.749020 0.752942 0.756863 0.760785 0.764706 0.768628 0.772549 0.776471 0.780393 0.784314 0.788236 0.792157 0.796079 0.800000 0.803922 0.807844 0.811765 0.815687 0.819608 0.823530 0.827451 0.831373 0.835294 0.839216 0.843138 0.847059 0.850981 0.854902 0.858824 0.862745 0.866667 0.870588 0.874510 0.878432 0.882353 0.886275 0.890196 0.894118 0.898039 0.901961 0.905883 0.909804 0.913726 0.917647 0.921569 0.925490 0.929412 0.933333 0.937255 0.941177 0.945098 0.949020 0.952941 0.956863 0.960784 0.964706 0.968627 0.972549 0.976471 0.980392 0.984314 0.988235 0.992157 0.996078 1.000000))
+(time 0)
+(channel red)
+(curve
+ (curve-type smooth)
+ (n-points 17)
+ (points 34 0.000000 0.003922 -1.000000 -1.000000 0.121569 0.015686 -1.000000 -1.000000 0.247059 0.207843 -1.000000 -1.000000 0.372549 0.396078 -1.000000 -1.000000 0.498039 0.556863 -1.000000 -1.000000 0.623529 0.698039 -1.000000 -1.000000 0.749020 0.811765 -1.000000 -1.000000 0.874510 0.909804 -1.000000 -1.000000 1.000000 1.000000)
+ (n-samples 256)
+ (samples 256 0.003922 0.002874 0.001836 0.000815 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000921 0.002772 0.004856 0.007180 0.009753 0.012586 0.015686 0.019095 0.022837 0.026896 0.031255 0.035898 0.040807 0.045967 0.051361 0.056972 0.062783 0.068779 0.074942 0.081256 0.087704 0.094270 0.100937 0.107689 0.114509 0.121380 0.128286 0.135211 0.142137 0.149048 0.155927 0.162759 0.169526 0.176212 0.182800 0.189274 0.195617 0.201812 0.207843 0.213796 0.219766 0.225750 0.231748 0.237756 0.243772 0.249794 0.255821 0.261849 0.267878 0.273903 0.279925 0.285939 0.291945 0.297940 0.303921 0.309887 0.315836 0.321765 0.327673 0.333556 0.339413 0.345243 0.351041 0.356807 0.362539 0.368233 0.373889 0.379503 0.385074 0.390600 0.396078 0.401514 0.406917 0.412286 0.417624 0.422929 0.428204 0.433449 0.438664 0.443850 0.449009 0.454140 0.459245 0.464323 0.469377 0.474406 0.479412 0.484394 0.489354 0.494293 0.499211 0.504109 0.508987 0.513847 0.518689 0.523513 0.528321 0.533114 0.537891 0.542654 0.547403 0.552139 0.556863 0.561575 0.566275 0.570962 0.575636 0.580295 0.584939 0.589567 0.594179 0.598774 0.603350 0.607908 0.612447 0.616965 0.621462 0.625938 0.630392 0.634823 0.639230 0.643613 0.647970 0.652302 0.656607 0.660885 0.665135 0.669356 0.673547 0.677709 0.681840 0.685939 0.690005 0.694039 0.698039 0.702003 0.705930 0.709820 0.713676 0.717497 0.721286 0.725042 0.728768 0.732465 0.736132 0.739772 0.743386 0.746974 0.750539 0.754079 0.757598 0.761096 0.764573 0.768032 0.771473 0.774897 0.778306 0.781700 0.785080 0.788448 0.791804 0.795151 0.798488 0.801816 0.805138 0.808454 0.811765 0.815062 0.818338 0.821591 0.824824 0.828037 0.831230 0.834405 0.837562 0.840701 0.843824 0.846931 0.850023 0.853101 0.856165 0.859216 0.862255 0.865283 0.868299 0.871306 0.874303 0.877292 0.880273 0.883246 0.886213 0.889175 0.892131 0.895083 0.898032 0.900977 0.903921 0.906863 0.909804 0.912739 0.915664 0.918577 0.921481 0.924374 0.927257 0.930131 0.932996 0.935853 0.938701 0.941541 0.944374 0.947200 0.950019 0.952831 0.955637 0.958438 0.961233 0.964023 0.966808 0.969589 0.972367 0.975140 0.977911 0.980678 0.983443 0.986206 0.988967 0.991726 0.994485 0.997243 1.000000))
+(time 0)
+(channel green)
+(curve
+ (curve-type smooth)
+ (n-points 17)
+ (points 34 0.000000 0.003922 -1.000000 -1.000000 0.121569 0.015686 -1.000000 -1.000000 0.247059 0.200000 -1.000000 -1.000000 0.372549 0.384314 -1.000000 -1.000000 0.498039 0.541176 -1.000000 -1.000000 0.623529 0.682353 -1.000000 -1.000000 0.749020 0.800000 -1.000000 -1.000000 0.874510 0.901961 -1.000000 -1.000000 1.000000 1.000000)
+ (n-samples 256)
+ (samples 256 0.003922 0.002936 0.001959 0.001000 0.000065 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.001465 0.003252 0.005261 0.007501 0.009979 0.012704 0.015686 0.018961 0.022552 0.026442 0.030617 0.035061 0.039758 0.044694 0.049851 0.055215 0.060771 0.066502 0.072394 0.078430 0.084596 0.090875 0.097253 0.103714 0.110241 0.116821 0.123436 0.130073 0.136714 0.143345 0.149950 0.156514 0.163021 0.169456 0.175802 0.182046 0.188170 0.194160 0.200000 0.205773 0.211570 0.217389 0.223227 0.229082 0.234951 0.240832 0.246722 0.252619 0.258520 0.264422 0.270324 0.276223 0.282115 0.287999 0.293873 0.299733 0.305577 0.311402 0.317207 0.322988 0.328743 0.334470 0.340166 0.345828 0.351454 0.357042 0.362588 0.368091 0.373548 0.378957 0.384314 0.389626 0.394901 0.400139 0.405343 0.410512 0.415649 0.420753 0.425827 0.430872 0.435887 0.440875 0.445837 0.450774 0.455686 0.460574 0.465441 0.470287 0.475112 0.479919 0.484708 0.489480 0.494237 0.498978 0.503707 0.508423 0.513127 0.517821 0.522506 0.527183 0.531853 0.536517 0.541176 0.545829 0.550473 0.555109 0.559735 0.564350 0.568953 0.573545 0.578125 0.582690 0.587242 0.591779 0.596300 0.600805 0.605293 0.609764 0.614215 0.618648 0.623061 0.627453 0.631824 0.636173 0.640499 0.644802 0.649081 0.653335 0.657563 0.661764 0.665939 0.670086 0.674204 0.678294 0.682353 0.686382 0.690381 0.694351 0.698292 0.702206 0.706092 0.709952 0.713787 0.717597 0.721382 0.725144 0.728883 0.732601 0.736297 0.739972 0.743627 0.747264 0.750882 0.754482 0.758065 0.761632 0.765184 0.768720 0.772243 0.775752 0.779248 0.782732 0.786206 0.789668 0.793121 0.796565 0.800000 0.803418 0.806811 0.810178 0.813523 0.816844 0.820145 0.823424 0.826685 0.829928 0.833153 0.836362 0.839557 0.842737 0.845905 0.849061 0.852206 0.855342 0.858469 0.861589 0.864702 0.867810 0.870914 0.874015 0.877114 0.880212 0.883310 0.886409 0.889511 0.892616 0.895725 0.898840 0.901961 0.905083 0.908200 0.911311 0.914417 0.917518 0.920614 0.923706 0.926792 0.929875 0.932954 0.936028 0.939099 0.942166 0.945230 0.948291 0.951348 0.954403 0.957455 0.960504 0.963551 0.966596 0.969639 0.972680 0.975720 0.978758 0.981795 0.984831 0.987866 0.990900 0.993934 0.996967 1.000000))
+(time 0)
+(channel blue)
+(curve
+ (curve-type smooth)
+ (n-points 17)
+ (points 34 0.000000 0.054902 -1.000000 -1.000000 0.121569 0.121569 -1.000000 -1.000000 0.247059 0.262745 -1.000000 -1.000000 0.372549 0.407843 -1.000000 -1.000000 0.498039 0.537255 -1.000000 -1.000000 0.623529 0.662745 -1.000000 -1.000000 0.749020 0.780392 -1.000000 -1.000000 0.874510 0.890196 -1.000000 -1.000000 1.000000 1.000000)
+ (n-samples 256)
+ (samples 256 0.054902 0.056479 0.058059 0.059647 0.061245 0.062858 0.064489 0.066141 0.067818 0.069524 0.071262 0.073036 0.074850 0.076706 0.078610 0.080563 0.082570 0.084635 0.086760 0.088950 0.091208 0.093538 0.095943 0.098427 0.100994 0.103646 0.106388 0.109224 0.112156 0.115188 0.118325 0.121569 0.124935 0.128429 0.132047 0.135782 0.139627 0.143576 0.147624 0.151764 0.155990 0.160296 0.164675 0.169122 0.173630 0.178194 0.182806 0.187461 0.192153 0.196876 0.201622 0.206387 0.211164 0.215947 0.220730 0.225506 0.230270 0.235015 0.239735 0.244424 0.249075 0.253683 0.258242 0.262745 0.267229 0.271735 0.276259 0.280802 0.285360 0.289932 0.294517 0.299111 0.303715 0.308325 0.312940 0.317559 0.322179 0.326798 0.331416 0.336029 0.340637 0.345237 0.349828 0.354408 0.358975 0.363527 0.368062 0.372580 0.377077 0.381552 0.386003 0.390430 0.394828 0.399198 0.403537 0.407843 0.412119 0.416369 0.420595 0.424797 0.428976 0.433135 0.437272 0.441391 0.445491 0.449574 0.453642 0.457694 0.461732 0.465758 0.469771 0.473774 0.477768 0.481753 0.485731 0.489702 0.493668 0.497630 0.501589 0.505545 0.509501 0.513457 0.517414 0.521373 0.525336 0.529303 0.533276 0.537255 0.541238 0.545220 0.549202 0.553183 0.557162 0.561139 0.565114 0.569087 0.573057 0.577024 0.580987 0.584946 0.588900 0.592851 0.596796 0.600735 0.604669 0.608597 0.612518 0.616433 0.620340 0.624240 0.628132 0.632016 0.635891 0.639757 0.643614 0.647461 0.651298 0.655124 0.658940 0.662745 0.666540 0.670328 0.674108 0.677880 0.681644 0.685401 0.689150 0.692892 0.696626 0.700352 0.704071 0.707782 0.711485 0.715181 0.718869 0.722549 0.726222 0.729886 0.733544 0.737193 0.740835 0.744470 0.748097 0.751716 0.755327 0.758931 0.762527 0.766115 0.769696 0.773269 0.776834 0.780392 0.783938 0.787470 0.790988 0.794493 0.797985 0.801466 0.804935 0.808394 0.811844 0.815285 0.818718 0.822143 0.825562 0.828974 0.832381 0.835784 0.839183 0.842579 0.845972 0.849364 0.852755 0.856146 0.859537 0.862929 0.866323 0.869720 0.873120 0.876524 0.879933 0.883348 0.886768 0.890196 0.893627 0.897059 0.900490 0.903922 0.907353 0.910784 0.914216 0.917647 0.921078 0.924510 0.927941 0.931373 0.934804 0.938235 0.941667 0.945098 0.948529 0.951961 0.955392 0.958824 0.962255 0.965686 0.969118 0.972549 0.975980 0.979412 0.982843 0.986275 0.989706 0.993137 0.996569 1.000000))
+(time 0)
+(channel alpha)
+(curve
+ (curve-type free)
+ (n-points 17)
+ (points 34 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000)
+ (n-samples 256)
+ (samples 256 0.000000 0.003922 0.007843 0.011765 0.015686 0.019608 0.023529 0.027451 0.031373 0.035294 0.039216 0.043137 0.047059 0.050980 0.054902 0.058824 0.062745 0.066667 0.070588 0.074510 0.078431 0.082353 0.086275 0.090196 0.094118 0.098039 0.101961 0.105882 0.109804 0.113725 0.117647 0.121569 0.125490 0.129412 0.133333 0.137255 0.141176 0.145098 0.149020 0.152941 0.156863 0.160784 0.164706 0.168627 0.172549 0.176471 0.180392 0.184314 0.188235 0.192157 0.196078 0.200000 0.203922 0.207843 0.211765 0.215686 0.219608 0.223529 0.227451 0.231373 0.235294 0.239216 0.243137 0.247059 0.250980 0.254902 0.258824 0.262745 0.266667 0.270588 0.274510 0.278431 0.282353 0.286275 0.290196 0.294118 0.298039 0.301961 0.305882 0.309804 0.313725 0.317647 0.321569 0.325490 0.329412 0.333333 0.337255 0.341176 0.345098 0.349020 0.352941 0.356863 0.360784 0.364706 0.368627 0.372549 0.376471 0.380392 0.384314 0.388235 0.392157 0.396078 0.400000 0.403922 0.407843 0.411765 0.415686 0.419608 0.423529 0.427451 0.431373 0.435294 0.439216 0.443137 0.447059 0.450980 0.454902 0.458824 0.462745 0.466667 0.470588 0.474510 0.478431 0.482353 0.486275 0.490196 0.494118 0.498039 0.501961 0.505882 0.509804 0.513725 0.517647 0.521569 0.525490 0.529412 0.533333 0.537255 0.541176 0.545098 0.549020 0.552941 0.556863 0.560784 0.564706 0.568627 0.572549 0.576471 0.580392 0.584314 0.588235 0.592157 0.596078 0.600000 0.603922 0.607843 0.611765 0.615686 0.619608 0.623529 0.627451 0.631373 0.635294 0.639216 0.643137 0.647059 0.650980 0.654902 0.658824 0.662745 0.666667 0.670588 0.674510 0.678431 0.682353 0.686275 0.690196 0.694118 0.698039 0.701961 0.705882 0.709804 0.713725 0.717647 0.721569 0.725490 0.729412 0.733333 0.737255 0.741176 0.745098 0.749020 0.752941 0.756863 0.760784 0.764706 0.768627 0.772549 0.776471 0.780392 0.784314 0.788235 0.792157 0.796078 0.800000 0.803922 0.807843 0.811765 0.815686 0.819608 0.823529 0.827451 0.831373 0.835294 0.839216 0.843137 0.847059 0.850980 0.854902 0.858824 0.862745 0.866667 0.870588 0.874510 0.878431 0.882353 0.886275 0.890196 0.894118 0.898039 0.901961 0.905882 0.909804 0.913725 0.917647 0.921569 0.925490 0.929412 0.933333 0.937255 0.941176 0.945098 0.949020 0.952941 0.956863 0.960784 0.964706 0.968627 0.972549 0.976471 0.980392 0.984314 0.988235 0.992157 0.996078 1.000000))
+
+# end of curves tool settings

0 comments on commit 083e42c

Please sign in to comment.