commit 4a1e809

pita  ·  2026-06-29 19:09:02 +0000 UTC
parent 963b9b9
stuff
1 files changed,  +11, -5
+11, -5
 1@@ -10,7 +10,9 @@ typedef struct {
 2     unsigned char *data;
 3 } Ppm;
 4 
 5-void rotate_image(Ppm *src, Ppm *dst, double degrees) {
 6+void 
 7+rotate_image(Ppm *src, Ppm *dst, double degrees) 
 8+{
 9     double radians = degrees * (3.1415926 / 180.0);
10     double cos_t = cos(radians);
11     double sin_t = sin(radians);
12@@ -51,7 +53,9 @@ void rotate_image(Ppm *src, Ppm *dst, double degrees) {
13     }
14 }
15 
16-void place_tile(Ppm *tile, Ppm *grid, int tile_col, int tile_row) {
17+void 
18+place_tile(Ppm *tile, Ppm *grid, int tile_col, int tile_row) 
19+{
20     int x, y, src_idx, dst_idx, dst_x, dst_y;
21 
22     for (y = 0; y < tile->height; y++) {
23@@ -75,7 +79,9 @@ void place_tile(Ppm *tile, Ppm *grid, int tile_col, int tile_row) {
24     }
25 }
26 
27-int main(void) {
28+int
29+main(void) 
30+{
31     FILE *in, *out;
32     char magic[3];
33     int width, height, max_val;
34@@ -88,9 +94,9 @@ int main(void) {
35     for (cell = 0; cell < 9; cell++)
36         degrees[cell] = (double)(rand() % 3600) / 10.0;
37 
38-    in = fopen("theclassic.ppm", "r");
39+    in = fopen("pjw.ppm", "r");
40     if (!in) {
41-        perror("failed to open file, theclassic.ppm");
42+        perror("failed to open file, pjw.ppm");
43         return 1;
44     }
45