From 759751a7df2c6e184d646f131ed927df7aaff847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9tro?= <yann.roberge@polymtl.ca> Date: Sat, 29 May 2021 15:54:17 -0400 Subject: [PATCH] =?UTF-8?q?S=C3=A9par=C3=A9=20les=20champs=20configurables?= =?UTF-8?q?=20dans=20un=20fichier=20=C3=A0=20part?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.h | 36 ++++++++++++++++++++++++++++++++++++ main.h | 27 +-------------------------- 2 files changed, 37 insertions(+), 26 deletions(-) create mode 100644 config.h diff --git a/config.h b/config.h new file mode 100644 index 0000000..b7cf9f4 --- /dev/null +++ b/config.h @@ -0,0 +1,36 @@ +/********************************************************* +* Config des images à corriger, leur emplacement +* et la correction à appliquer +* Date: 29-Mai-2021 +* Auteur: Yann Roberge +*********************************************************/ + +#ifndef CONFIG_H +#define CONFIG_H + +// Image definition +#define N_IMAGES 5 +#define IMG_WIDTH 640 +#define IMG_HEIGHT 360 + +#define IMG_AREA (IMG_WIDTH * IMG_HEIGHT) +#define IMG_DEPTH 8 // bits +#define IMG_N_CHANNELS 3 // RGB + +#define BYTES_PER_PIXEL (IMG_N_CHANNELS * IMG_DEPTH / 8) +#define FRAME_BUF_SIZE (IMG_AREA * BYTES_PER_PIXEL) + +// Files and directories +#define FRAME_IN_DIRECTORY "/run/user/1000/gvfs/sftp:host=odroid,user=nas/media/raid/frames/" +#define FRAME_OUT_DIRECTORY "/run/user/1000/gvfs/sftp:host=odroid,user=nas/media/raid/frames_out/" + +#define FRAME_IN_FILENAME "frame" +#define FRAME_OUT_FILENAME "frameout" + +// Corrections to apply +#define DELTA_HUE 60 +#define DELTA_SATURATION 0.2 +#define DELTA_VALUE 0 + +#endif + diff --git a/main.h b/main.h index 5ea6fad..2bc6920 100644 --- a/main.h +++ b/main.h @@ -9,32 +9,7 @@ #include <stdint.h> -// Image definition -#define N_IMAGES 1 -#define IMG_WIDTH 15 -#define IMG_HEIGHT 11 - -//#define IMG_WIDTH 640 -//#define IMG_HEIGHT 360 -#define IMG_AREA (IMG_WIDTH * IMG_HEIGHT) -#define IMG_DEPTH 8 // bits -#define IMG_N_CHANNELS 3 // RGB - -#define BYTES_PER_PIXEL (IMG_N_CHANNELS * IMG_DEPTH / 8) -#define FRAME_BUF_SIZE (IMG_AREA * BYTES_PER_PIXEL) - -// Files and directories -#define FRAME_IN_DIRECTORY "/run/user/1000/gvfs/sftp:host=odroid,user=nas/media/raid/frames/" -#define FRAME_OUT_DIRECTORY "/run/user/1000/gvfs/sftp:host=odroid,user=nas/media/raid/frames_out/" - -//#define FRAME_IN_FILENAME "frame" -#define FRAME_IN_FILENAME "color_test_pattern" -#define FRAME_OUT_FILENAME "color_test_pattern_out" - -// Corrections to apply -#define DELTA_HUE 50 -#define DELTA_SATURATION 0.2 -#define DELTA_VALUE 50 +#include "config.h" // Pixel struct unpacked for processing typedef struct { -- GitLab