TV: Add individual test image for selected color of color bar
This commit is contained in:
parent
26213d667a
commit
a7a1ac7c5e
13
src/tv/bas.c
13
src/tv/bas.c
|
@ -119,12 +119,19 @@ int bas_generate(bas_t *bas, sample_t *sample)
|
|||
/* render color convergence test image */
|
||||
convergence_gen_line(sample, x, bas->samplerate, H_LINE_START, H_LINE_END, middlefield_line, (bas->grid_width) > 1 ? 1.0: 0.5);
|
||||
break;
|
||||
case BAS_BLACK:
|
||||
case BAS_BLUE:
|
||||
case BAS_RED:
|
||||
/* render (thin) color convergence test image */
|
||||
color_gen_line(sample, x, bas->samplerate, color_u, color_v, bas->v_polarity, H_LINE_START, H_LINE_END);
|
||||
case BAS_MAGENTA:
|
||||
case BAS_GREEN:
|
||||
case BAS_CYAN:
|
||||
case BAS_YELLOW:
|
||||
case BAS_WHITE:
|
||||
/* single color test image */
|
||||
color_gen_line(sample, x, bas->samplerate, color_u, color_v, bas->v_polarity, H_LINE_START, H_LINE_END, bas->type);
|
||||
break;
|
||||
case BAS_EBU:
|
||||
/* render (thin) color convergence test image */
|
||||
/* EBU test image */
|
||||
ebu_gen_line(sample, x, bas->samplerate, color_u, color_v, bas->v_polarity, H_LINE_START, H_LINE_END);
|
||||
break;
|
||||
case BAS_IMAGE: {
|
||||
|
|
|
@ -2,7 +2,14 @@
|
|||
enum bas_type {
|
||||
BAS_FUBK,
|
||||
BAS_CONVERGENCE,
|
||||
BAS_BLACK,
|
||||
BAS_BLUE,
|
||||
BAS_RED,
|
||||
BAS_MAGENTA,
|
||||
BAS_GREEN,
|
||||
BAS_CYAN,
|
||||
BAS_YELLOW,
|
||||
BAS_WHITE,
|
||||
BAS_EBU,
|
||||
BAS_VCR,
|
||||
BAS_IMAGE,
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include "../libsample/sample.h"
|
||||
#include "../libfilter/iir_filter.h"
|
||||
#include "bas.h"
|
||||
#include "color.h"
|
||||
|
||||
#define RAMP_WIDTH 0.0000002
|
||||
|
@ -38,13 +40,41 @@ static struct color_bar {
|
|||
{0.0, 0.0},
|
||||
};
|
||||
|
||||
int color_gen_line(sample_t *sample, double x, double samplerate, sample_t *color_u, sample_t *color_v, int v_polarity, double line_start, double line_end)
|
||||
int color_gen_line(sample_t *sample, double x, double samplerate, sample_t *color_u, sample_t *color_v, int v_polarity, double line_start, double line_end, enum bas_type type)
|
||||
{
|
||||
int b = 5;
|
||||
int b;
|
||||
double step = 1.0 / samplerate;
|
||||
int i = 0;
|
||||
double amplitude, Y, U, V, colorphase;
|
||||
|
||||
switch (type) {
|
||||
case BAS_WHITE:
|
||||
b = 0;
|
||||
break;
|
||||
case BAS_YELLOW:
|
||||
b = 1;
|
||||
break;
|
||||
case BAS_CYAN:
|
||||
b = 2;
|
||||
break;
|
||||
case BAS_GREEN:
|
||||
b = 3;
|
||||
break;
|
||||
case BAS_MAGENTA:
|
||||
b = 4;
|
||||
break;
|
||||
case BAS_RED:
|
||||
b = 5;
|
||||
break;
|
||||
case BAS_BLUE:
|
||||
b = 6;
|
||||
break;
|
||||
case BAS_BLACK:
|
||||
default:
|
||||
b = 7;
|
||||
break;
|
||||
}
|
||||
|
||||
/* skip x to line_start */
|
||||
while (x < line_start && x < line_end) {
|
||||
i++;
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
|
||||
int color_gen_line(sample_t *sample, double x, double samplerate, sample_t *color_u, sample_t *color_v, int v_polarity, double frame_start, double line_end);
|
||||
int color_gen_line(sample_t *sample, double x, double samplerate, sample_t *color_u, sample_t *color_v, int v_polarity, double frame_start, double line_end, enum bas_type type);
|
||||
|
||||
|
|
|
@ -90,8 +90,15 @@ void print_help(const char *arg0)
|
|||
printf(" tx-fubk Transmit FUBK test image (German PAL image)\n");
|
||||
printf(" tx-ebu Transmit EBU test image (color bars)\n");
|
||||
printf(" tx-convergence Transmit convergence grid for color adjustemnt\n");
|
||||
printf(" tx-red Transmit single color image for DY adjustment\n");
|
||||
printf(" tx-vcr Transmit VCR calibration pattern\n");
|
||||
printf(" tx-black Transmit single color image\n");
|
||||
printf(" tx-blue Transmit single color image\n");
|
||||
printf(" tx-red Transmit single color image (for DY adjustment)\n");
|
||||
printf(" tx-magenta Transmit single color image\n");
|
||||
printf(" tx-green Transmit single color image\n");
|
||||
printf(" tx-cyan Transmit single color image\n");
|
||||
printf(" tx-yellow Transmit single color image\n");
|
||||
printf(" tx-white Transmit single color image\n");
|
||||
printf(" tx-vcr Transmit Jolly's VCR test pattern\n");
|
||||
printf(" tx-img [<image>] Transmit natural image or given image file\n");
|
||||
printf(" Use 4:3 image with 574 lines for best result.\n");
|
||||
printf("\ngeneral options:\n");
|
||||
|
@ -528,8 +535,22 @@ int main(int argc, char *argv[])
|
|||
tx_test_picture(BAS_EBU);
|
||||
} else if (!strcmp(argv[argi], "tx-convergence")) {
|
||||
tx_test_picture(BAS_CONVERGENCE);
|
||||
} else if (!strcmp(argv[argi], "tx-black")) {
|
||||
tx_test_picture(BAS_BLACK);
|
||||
} else if (!strcmp(argv[argi], "tx-blue")) {
|
||||
tx_test_picture(BAS_BLUE);
|
||||
} else if (!strcmp(argv[argi], "tx-red")) {
|
||||
tx_test_picture(BAS_RED);
|
||||
} else if (!strcmp(argv[argi], "tx-magenta")) {
|
||||
tx_test_picture(BAS_MAGENTA);
|
||||
} else if (!strcmp(argv[argi], "tx-green")) {
|
||||
tx_test_picture(BAS_GREEN);
|
||||
} else if (!strcmp(argv[argi], "tx-cyan")) {
|
||||
tx_test_picture(BAS_CYAN);
|
||||
} else if (!strcmp(argv[argi], "tx-yellow")) {
|
||||
tx_test_picture(BAS_YELLOW);
|
||||
} else if (!strcmp(argv[argi], "tx-white")) {
|
||||
tx_test_picture(BAS_WHITE);
|
||||
} else if (!strcmp(argv[argi], "tx-vcr")) {
|
||||
tx_test_picture(BAS_VCR);
|
||||
} else if (!strcmp(argv[argi], "tx-img")) {
|
||||
|
|
Loading…
Reference in New Issue