History

avfilter/vf_pseudocolor: do not leave alpha uninitialized

Paul B Mahol committed 5 years ago

Commit 44facfb1 parent 0ef53cc1 file · +9 −6Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_pseudocolor.c+9−6
@@ -88,7 +88,7 @@ typedef struct Curve { · 87 unmodified lines
8888 } Curve;
8989
9090 typedef struct Fill {
91− float fill[3];
91+ float fill[4];
9292 } Fill;
9393
9494 typedef struct Range {
@@ -108,10 +108,10 @@ static const Range spec2_range[] = {{0, 16}, {16, 22}, {22, 226}, {226, 236}, {2 · 13 unmodified lines
108108 static const Range shadows_range[] = {{0, 32}, {32, 256}};
109109 static const Range highlights_range[] = {{0, 214}, {214, 224}, {224, 256}};
110110
111−static const Fill spec1_fills[] = {{0.5f, 0.f, .5f}, {-1.f, -1.f, -1.f}, {1.f, 0.f, 0.f}};
112−static const Fill spec2_fills[] = {{0.5f, 0.f, .5f}, {0.f, 1.f, 1.f}, {-1.f, -1.f, -1.f}, {1.f, 1.f, 0.f}, {1.f, 0.f, 0.f}};
113−static const Fill shadows_fills[] = {{0.8f, 0.4f, .8f}, {-1.f, -1.f, -1.f}};
114−static const Fill highlights_fills[] = {{-1.f, -1.f, -1.f}, {1.f, 0.3f, 0.6f}, {1.f, 0.2f, .5f}};
111+static const Fill spec1_fills[] = {{0.5f, 0.f, .5f, 1.f}, {-1.f, -1.f, -1.f, 1.f}, {1.f, 0.f, 0.f, 1.f}};
112+static const Fill spec2_fills[] = {{0.5f, 0.f, .5f, 1.f}, {0.f, 1.f, 1.f, 1.f}, {-1.f, -1.f, -1.f, 1.f}, {1.f, 1.f, 0.f, 1.f}, {1.f, 0.f, 0.f, 1.f}};
113+static const Fill shadows_fills[] = {{0.8f, 0.4f, .8f, 1.f}, {-1.f, -1.f, -1.f, 1.f}};
114+static const Fill highlights_fills[] = {{-1.f, -1.f, -1.f, 1.f}, {1.f, 0.3f, 0.6f, 1.f}, {1.f, 0.2f, .5f, 1.f}};
115115
116116 static const Curve curves[] =
117117 {
@@ -627,11 +627,12 @@ static int config_input(AVFilterLink *inlink) · 509 unmodified lines
627627 const Fill fill = presets[s->preset].fills[seg];
628628
629629 for (int j = 0; j < factor; j++) {
630− double r, g, b;
630+ double r, g, b, a;
631631
632632 g = fill.fill[1];
633633 b = fill.fill[2];
634634 r = fill.fill[0];
635+ a = fill.fill[3];
635636
636637 if (g >= 0.f && b >= 0.f && r >= 0.f) {
637638 g *= s->max;
@@ -652,6 +653,7 @@ static int config_input(AVFilterLink *inlink) · 14 unmodified lines
652653 s->lut[0][i*factor+j] = g;
653654 s->lut[1][i*factor+j] = b;
654655 s->lut[2][i*factor+j] = r;
656+ s->lut[3][i*factor+j] = a * s->max;
655657 }
656658 } else {
657659 const Curve curve = presets[s->preset].curves[seg];
@@ -677,6 +679,7 @@ static int config_input(AVFilterLink *inlink) · 19 unmodified lines
677679 s->lut[0][i*factor+j] = g;
678680 s->lut[1][i*factor+j] = b;
679681 s->lut[2][i*factor+j] = r;
682+ s->lut[3][i*factor+j] = 1.f * s->max;
680683 }
681684 }
682685 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t