summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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
17 files changed, 119 insertions, 0 deletions
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
10 */
11
5static inline TriangleMap *init_trianglemap(IntVector width, IntVector height) { 12static inline TriangleMap *init_trianglemap(IntVector width, IntVector height) {
6 TriangleMap *bottom_left = trianglemap_create(m(0, 0), m(0, height), m(width, height)); 13 TriangleMap *bottom_left = trianglemap_create(m(0, 0), m(0, height), m(width, height));
7 TriangleMap *top_right = trianglemap_create(m(0, 0), m(width, height), m(width, 0)); 14 TriangleMap *top_right = trianglemap_create(m(0, 0), m(width, height), m(width, 0));
diff --git a/src/morpher/quadrilateral.c b/src/morpher/quadrilateral.c
index d5c64b0..4a0dc27 100644
--- a/src/morpher/quadrilateral.c
+++ b/src/morpher/quadrilateral.c
@@ -3,6 +3,13 @@
3#include <assert.h> 3#include <assert.h>
4#include "morpher/matrix.h" 4#include "morpher/matrix.h"
5 5
6/**
7 * File: quadrilateral.c
8 *
9 * Author:
10 * Pacien TRAN-GIRARD
11 */
12
6static inline IntVector p2(IntVector n) { 13static inline IntVector p2(IntVector n) {
7 return n * n; 14 return n * n;
8} 15}
diff --git a/src/morpher/trianglemap.c b/src/morpher/trianglemap.c
index ad526bc..c261a9c 100644
--- a/src/morpher/trianglemap.c
+++ b/src/morpher/trianglemap.c
@@ -4,6 +4,13 @@
4#include "morpher/quadrilateral.h" 4#include "morpher/quadrilateral.h"
5#include "common/mem.h" 5#include "common/mem.h"
6 6
7/**
8 * File: trianglemap.c