aboutsummaryrefslogtreecommitdiffstats
path: root/src/calibrator.h
blob: 1db7a3bddf8e19f66e9e412fb689f71409ba2764 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
 * crt-calibrator – Calibration utility for CRT monitors
 * Copyright © 2014  Mattias Andrée (maandree@member.fsf.org)
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef CRT_CALIBRATOR_CALIBRATOR_H
#define CRT_CALIBRATOR_CALIBRATOR_H


#include "framebuffer.h"
#include "drmgamma.h"

#include <stdint.h>
#include <stddef.h>


/**
 * Draw bars in different shades of grey, red, green and blue
 * used for calibrating the contrast and brightness
 * 
 * @return  Zero on success, -1 on error
 */
int draw_contrast_brightness(void);

/**
 * Draw a seven segment display
 * 
 * @param  fb      The framebuffer to draw on
 * @param  colour  The intensity of the least intense colour to use
 * @param  x       The X component of the top left corner of the seven segment display
 * @param  y       The Y component of the top left corner of the seven segment display
 */
void draw_digit(framebuffer_t* restrict fb, int colour, uint32_t x, uint32_t y);

/**
 * Manipulate a CRT controllers gamma ramps to display a specific digit
 * for one of the seven segment display on only that CRT controller's
 * monitors
 * 
 * @param   crtc    The CRT controller information
 * @param   colour  The intensity of the least intense colour in the seven segment display
 * @param   value   The valud of the digit to display
 * @return          Zero on success, -1 on error
 */
int gamma_digit(drm_crtc_t* restrict crtc, int colour, size_t value);

/**
 * Draw an unique index on each monitor
 * 
 * @return   Zero on success, -1 on error
 */
int draw_id(void);


#endif