summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpacien2018-01-09 16:14:18 +0100
committerpacien2018-01-09 16:14:18 +0100
commit38195a70192301e7df5b69bf2266a04a0b90a532 (patch)
tree2ad004884b1d5348e7b0812e514293eda3cd7d66
parent76cb6ee14cb72eba8df8112604d9c2e8598d2448 (diff)
downloadmorpher-38195a70192301e7df5b69bf2266a04a0b90a532.tar.gz
Update report, add authorship to C filesHEADmaster
Signed-off-by: pacien <pacien.trangirard@pacien.net>
-rw-r--r--doc/project-report.md2
-rw-r--r--src/common/error.c7
-rw-r--r--src/common/geom.c7
-rw-r--r--src/common/mem.c7
-rw-r--r--src/gui/button.c7
-rw-r--r--src/gui/component.c7
-rw-r--r--src/gui/group.c7
-rw-r--r--src/gui/gui.c7
-rw-r--r--src/gui/pictureframe.c7
-rw-r--r--src/gui/window.c7
-rw-r--r--src/main.c7
-rw-r--r--src/morpher/matrix.c7
-rw-r--r--src/morpher/morphing.c7
-rw-r--r--src/morpher/quadrilateral.c7
-rw-r--r--src/morpher/trianglemap.c7
-rw-r--r--src/painter/canvas.c7
-rw-r--r--src/painter/color.c7
-rw-r--r--src/painter/rasterizer.c7
-rw-r--r--test/common/geom.c7
-rw-r--r--test/morpher/matrix.c7
-rw-r--r--test/morpher/quadrilateral.c7
-rw-r--r--test/morpher/trianglemap.c7
-rw-r--r--test/painter/color.c7
-rw-r--r--test/painter/rasterizer.c7
24 files changed, 163 insertions, 0 deletions
diff --git a/doc/project-report.md b/doc/project-report.md
index 8a8103f..4f9ccc3 100644
--- a/doc/project-report.md
+++ b/doc/project-report.md
@@ -119,6 +119,8 @@ triangle lookup from arbitrarily given coordinates and a simple way of traversin
119The painter module provides functions to apply a previously constructed morphing to a base and a target image, 119The painter module provides functions to apply a previously constructed morphing to a base and a target image,
120generating a morphed image as the output. 120generating a morphed image as the output.
121 121
122None of its inputs are altered, allowing later reuse of the same base morphing.
123
122A per-triangle rasterisation algorithm has been implemented instead of the suggested per-pixel triangle lookup for 124A per-triangle rasterisation algorithm has been implemented instead of the suggested per-pixel triangle lookup for
123performance reasons, as the whole process was meant to run in a single thread on the CPU, not benefiting the massive 125performance reasons, as the whole process was meant to run in a single thread on the CPU, not benefiting the massive
124parallelisation possibility that a GPU would have offered. 126parallelisation possibility that a GPU would have offered.
diff --git a/src/common/error.c b/src/common/error.c
index f28a6cd..02ce788 100644
--- a/src/common/error.c
+++ b/src/common/error.c
@@ -2,6 +2,13 @@
2#include <stdlib.h> 2#include <stdlib.h>
3#include <stdio.h> 3#include <stdio.h>
4 4
5/**
6 * File: error.c
7 *
8 * Author:
9 * Pacien TRAN-GIRARD
10 */
11
5void rage_quit(const char *msg) { 12void rage_quit(const char *msg) {
6 fprintf(stderr, "FATAL ERROR: %s\n", msg); 13 fprintf(stderr, "FATAL ERROR: %s\n", msg);
7 exit(1); 14 exit(1);
diff --git a/src/common/geom.c b/src/common/geom.c
index f903fe8..65c0f4c 100644
--- a/src/common/geom.c
+++ b/src/common/geom.c
@@ -2,6 +2,13 @@
2#include <math.h> 2#include <math.h>
3#include "morpher/matrix.h" 3#include "morpher/matrix.h"
4 4
5/**
6 * File: geom.c
7 *
8 * Author:
9 * Pacien TRAN-GIRARD
10 */
11
5static inline IntVector int_round(RealVector x) { 12static inline IntVector int_round(RealVector x) {
6 return (IntVector) round(x); 13 return (IntVector) round(x);
7} 14}
diff --git a/src/common/mem.c b/src/common/mem.c
index 855e010..02bd8c5 100644
--- a/src/common/mem.c
+++ b/src/common/mem.c
@@ -2,6 +2,13 @@
2#include <stdlib.h> 2#include <stdlib.h>
3#include "common/error.h" 3#include "common/error.h"
4 4
5/**
6 * File: error.c
7 *
8 * Author:
9 * Pacien TRAN-GIRARD
10 */
11
5void *malloc_or_die(size_t size) { 12void *malloc_or_die(size_t size) {
6 void *ptr = malloc(size); 13 void *ptr = malloc(size);
7 14
diff --git a/src/gui/button.c b/src/gui/button.c
index 4bf3952..79abef2 100644
--- a/src/gui/button.c
+++ b/src/gui/button.c
@@ -6,6 +6,13 @@
6#include <MLV/MLV_all.h> 6#include <MLV/MLV_all.h>
7#include "common/mem.h" 7#include "common/mem.h"
8 8
9/**
10 * File: button.c
11 *
12 * Author:
13 * Adam NAILI
14 */
15
9static bool button_is_selected(int x, int y, Button *button) { 16static bool button_is_selected(int x, int y, Button *button) {
10 assert(button != NULL); 17 assert(button != NULL);
11 int x1 = button->component.x_pos; 18 int x1 = button->component.x_pos;
diff --git a/src/gui/component.c b/src/gui/component.c
index c45ea4f..65435db 100644
--- a/src/gui/component.c
+++ b/src/gui/component.c
@@ -1,5 +1,12 @@
1#include "gui/component.h" 1#include "gui/component.h"
2 2
3/**
4 * File: component.c
5 *
6 * Author:
7 * Adam NAILI
8 */
9
3Mode mode = WAITING_BUTTON_SHOW; 10Mode mode = WAITING_BUTTON_SHOW;
4 11
5int frame = 2; 12int frame = 2;
diff --git a/src/gui/group.c b/src/gui/group.c
index 7f5adcd..75737af 100644
--- a/src/gui/group.c
+++ b/src/gui/group.c
@@ -4,6 +4,13 @@
4#include <MLV/MLV_shape.h> 4#include <MLV/MLV_shape.h>
5#include "common/mem.h" 5#include "common/mem.h"
6 6
7/**
8 * File: group.c
9 *
10 * Author:
11 * Adam NAILI
12 */
13
7void group_print(Component *parameterSelf) { 14void group_print(Component *parameterSelf) {
8 assert(parameterSelf != NULL); 15 assert(parameterSelf != NULL);
9 Group *self = (Group *) parameterSelf; 16 Group *self = (Group *) parameterSelf;
diff --git a/src/gui/gui.c b/src/gui/gui.c
index 7300196..45565e5 100644
--- a/src/gui/gui.c
+++ b/src/gui/gui.c
@@ -2,6 +2,13 @@
2#include <MLV/MLV_all.h> 2#include <MLV/MLV_all.h>
3#include "common/mem.h" 3#include "common/mem.h"
4 4
5/**
6 * File: gui.c
7 *
8 * Author:
9 * Adam NAILI
10 */
11
5GUI *gui_create(const char *fpath1, const char *fpath2) { 12GUI *gui_create(const char *fpath1, const char *fpath2) {
6 GUI *gui = malloc_or_die(sizeof(GUI)); 13 GUI *gui = malloc_or_die(sizeof(GUI));
7 gui->window = window_create(500, 500, "Morphing"); 14 gui->window = window_create(500, 500, "Morphing");
diff --git a/src/gui/pictureframe.c b/src/gui/pictureframe.c
index c012ece..c6d7bf6 100644
--- a/src/gui/pictureframe.c
+++ b/src/gui/pictureframe.c
@@ -3,6 +3,13 @@
3#include <MLV/MLV_all.h> 3#include <MLV/MLV_all.h>
4#include "common/mem.h" 4#include "common/mem.h"
5 5
6/**
7 * File: pictureframe.c
8 *
9 * Author:
10 * Adam NAILI
11 */
12
6static bool pictureframe_is_selected(int x, int y, PictureFrame *pictureFrame) { 13static bool pictureframe_is_selected(int x, int y, PictureFrame *pictureFrame) {
7 assert(pictureFrame != NULL); 14 assert(pictureFrame != NULL);
8 int x1 = pictureFrame->component.x_pos; 15 int x1 = pictureFrame->component.x_pos;
diff --git a/src/gui/window.c b/src/gui/window.c
index c9d200a..5d0a187 100644
--- a/src/gui/window.c
+++ b/src/gui/window.c
@@ -4,6 +4,13 @@
4#include "painter/rasterizer.h" 4#include "painter/rasterizer.h"
5#include "common/mem.h" 5#include "common/mem.h"
6 6
7/**
8 * File: window.c
9 *
10 * Author:
11 * Adam NAILI
12 */
13
7Window *window_create(int width, int height, char *title) { 14Window *window_create(int width, int height, char *title) {
8 assert(width > 0); 15 assert(width > 0);
9 assert(height > 0); 16 assert(height > 0);
diff --git a/src/main.c b/src/main.c
index ddcc6dc..193de55 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4,6 +4,13 @@
4#include <MLV/MLV_path.h> 4#include <MLV/MLV_path.h>
5#include "gui/gui.h" 5#include "gui/gui.h"
6 6
7/**
8 * File: main.c
9 *
10 * Author:
11 * Adam NAILI
12 */
13
7static inline void print_help() { 14static inline void print_help() {
8 printf("Usage: morph [--help] <path to base image> <path to end image>\n\n" 15 printf("Usage: morph [--help] <path to base image> <path to end image>\n\n"
9 "To use the morphing, you need to put two correct paths to image files.\n\n" 16 "To use the morphing, you need to put two correct paths to image files.\n\n"
diff --git a/src/morpher/matrix.c b/src/morpher/matrix.c
index 2fe1193..564137d 100644
--- a/src/morpher/matrix.c
+++ b/src/morpher/matrix.c
@@ -1,5 +1,12 @@
1#include "morpher/matrix.h" 1#include "morpher/matrix.h"
2 2
3/**
4 * File: matrix.c
5 *
6 * Author:
7 * Pacien TRAN-GIRARD
8 */
9
3IntVector matrix_int_det2(IntVector u11, IntVector u12, 10IntVector matrix_int_det2(IntVector u11, IntVector u12,
4 IntVector u21, IntVector u22) { 11 IntVector u21, IntVector u22) {
5 12
diff --git a/src/morpher/morphing.c b/src/morpher/morphing.c
index 7df3839..39f1146 100644
--- a/src/morpher/morphing.c
+++ b/src/morpher/morphing.c
@@ -2,6 +2,13 @@
2#include <malloc.h> 2#include <malloc.h>
3#include "common/mem.h" 3#include "common/mem.h"
4 4
5/**
6 * File: morphing.c
7 *
8 * Author:
9 * Pacien TRAN-GIRARD