~ruther/CTU-FEE-B0B35APO-Semestral-project

7f3ff29d37f29076965aa8aa74fa12f4e8a12eef — František Boháček 3 years ago 762b2cf
fix: include xwin only for computer
2 files changed, 5 insertions(+), 6 deletions(-)

M image-viewer/src/display_utils.c
M image-viewer/src/xwin_sdl.c
M image-viewer/src/display_utils.c => image-viewer/src/display_utils.c +2 -0
@@ 13,11 13,13 @@ const raw_pixel_t DISPLAY_PIXEL_MAX = {.red = (uint16_t)DISPLAY_MAX_RED,
                                       .green = (uint16_t)DISPLAY_MAX_GREEN,
                                       .blue = (uint16_t)DISPLAY_MAX_BLUE};

#ifdef COMPUTER
static void display_pixel_to_rgb(display_pixel_t pixel, uint8_t *target) {
  *(target++) = ((float)pixel.fields.r / DISPLAY_MAX_RED) * 255;
  *(target++) = ((float)pixel.fields.g / DISPLAY_MAX_GREEN) * 255;
  *(target++) = ((float)pixel.fields.b / DISPLAY_MAX_BLUE) * 255;
}
#endif

display_pixel_t raw_pixel_onebit_convert_to_display(raw_pixel_onebit_t pixel,
                                                    raw_pixel_onebit_t max) {

M image-viewer/src/xwin_sdl.c => image-viewer/src/xwin_sdl.c +3 -6
@@ 1,9 1,4 @@
/*
 * File name: xwin_sdl.c
 * Date:      2015/06/18 14:37
 * Author:    Jan Faigl
 */

#ifdef COMPUTER
#include <assert.h>

#include <SDL.h>


@@ 69,3 64,5 @@ bool xwin_poll_event(SDL_Event *event) {
}

/* end of xwin_sdl.c */

#endif

Do not follow this link