1
0
mirror of https://github.com/rricharz/Tek4010.git synced 2026-02-26 17:03:25 +00:00

improved intensity and character size control

This commit is contained in:
¨Rene Richarz
2019-04-29 09:22:19 +02:00
parent 0ba80492d7
commit eb6d9da372
3 changed files with 10 additions and 11 deletions

BIN
tek4010

Binary file not shown.

View File

@@ -218,10 +218,10 @@ void tek4010_escapeCodeHandler(cairo_t *cr, cairo_t *cr2, int ch)
int defocussed = 0;
break;
case '8': tube_changeCharacterSize(cr, cr2, 74, 35, (int)(efactor * 18)); break;
case '9': tube_changeCharacterSize(cr, cr2, 81, 38, (int)(efactor * 16)); break;
case ':': tube_changeCharacterSize(cr, cr2, 121, 58, (int)(efactor * 11)); break;
case ';': tube_changeCharacterSize(cr, cr2, 133, 64, (int)(efactor * 10)); break;
case '8': tube_changeCharacterSize(cr, cr2, 74, 35, (int)(efactor * 18)); mode = 0; break;
case '9': tube_changeCharacterSize(cr, cr2, 81, 38, (int)(efactor * 16)); mode = 0; break;
case ':': tube_changeCharacterSize(cr, cr2, 121, 58, (int)(efactor * 11)); mode = 0; break;
case ';': tube_changeCharacterSize(cr, cr2, 133, 64, (int)(efactor * 10)); mode = 0; break;
case '[': // a second escape code follows, do not reset mode
break;
@@ -560,8 +560,7 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int first)
}
else if (DEBUG) printf("Illegal byte 0x%02X in incremental plot\n", ch);
break;
case 50:// special plot mode, not implemented
// ignore the value for now
case 50:// special plot mode
tag = ch >> 5;
if ((ch < 32) || (ch >= 126)) return;
if (DEBUG) printf("intensity/focus control = %c: %d: ", ch, tag);

10
tube.c
View File

@@ -32,7 +32,7 @@
#define CURSOR_INTENSITY 0.8
#define BRIGHT_SPOT_COLOR 1.0
#define BRIGHT_SPOT_COLOR_HALF 0.6
#define BLACK_COLOR 0.0,0.08,0.0 // effect of flood gun
#define BLACK_COLOR 0.08 // effect of flood gun
#define _GNU_SOURCE
@@ -407,7 +407,7 @@ void tube_clearPersistent(cairo_t *cr, cairo_t *cr2)
// clear the persistant surface
// flash using the second surface
{
cairo_set_source_rgb(cr, BLACK_COLOR);
cairo_set_source_rgb(cr, 0.0, BLACK_COLOR, 0.0);
cairo_paint(cr);
tube_doClearPersistent = 0;
tube_x0 = 0;
@@ -485,7 +485,7 @@ void tube_drawCharacter(cairo_t *cr, cairo_t *cr2, char ch)
else {
// draw the character
cairo_set_source_rgb(cr, 0, (NORMAL_INTENSITY * intensity) / 100, 0);
cairo_set_source_rgb(cr, 0, BLACK_COLOR + ((NORMAL_INTENSITY - BLACK_COLOR) * intensity) / 100, 0);
cairo_move_to(cr, tube_x0, windowHeight - tube_y0);
cairo_show_text(cr, s);
@@ -515,7 +515,7 @@ void tube_drawPoint(cairo_t *cr, cairo_t *cr2)
{
#define PI2 6.283185307
cairo_set_line_width (cr, 1 + defocussed);
cairo_set_source_rgb(cr, 0, (NORMAL_INTENSITY * intensity) / 100, 0);
cairo_set_source_rgb(cr, 0, BLACK_COLOR + ((NORMAL_INTENSITY - BLACK_COLOR) * intensity) / 100, 0);
cairo_move_to(cr, tube_x2, windowHeight - tube_y2);
cairo_line_to(cr, tube_x2 + 1, windowHeight - tube_y2);
cairo_stroke (cr);
@@ -574,7 +574,7 @@ void tube_drawVector(cairo_t *cr, cairo_t *cr2)
else {
// draw the actual vector on permanent surface
cairo_set_line_width (cr, 1 + defocussed);
cairo_set_source_rgb(cr, 0, (NORMAL_INTENSITY * intensity) / 100, 0);
cairo_set_source_rgb(cr, 0, BLACK_COLOR + ((NORMAL_INTENSITY - BLACK_COLOR) * intensity) / 100, 0);
tube_line_type(cr, cr2, ltype);
cairo_move_to(cr, tube_x0, windowHeight - tube_y0);
cairo_line_to(cr, tube_x2, windowHeight - tube_y2);