summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/brot.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/bin/brot.c b/bin/brot.c
index 69734c77..e657509a 100644
--- a/bin/brot.c
+++ b/bin/brot.c
@@ -46,8 +46,7 @@ static uint32_t color(uint32_t n) {
 }
 
 static double complex translate = -0.75;
-static double complex rotate = 1.0;
-static double scale = 2.5;
+static double complex transform = 2.5;
 
 void draw(uint32_t *buf, size_t width, size_t height) {
     double yRatio = (height > width) ? (double)height / (double)width : 1.0;
@@ -56,7 +55,7 @@ void draw(uint32_t *buf, size_t width, size_t height) {
         for (size_t x = 0; x < width; ++x) {
             double zx = ((double)x / (double)width - 0.5) * xRatio;
             double zy = ((double)y / (double)height - 0.5) * yRatio;
-            uint32_t n = mandelbrot((zx + zy * I) * scale * rotate + translate);
+            uint32_t n = mandelbrot((zx + zy * I) * transform + translate);
             buf[y * width + x] = color(n);
         }
     }
@@ -73,14 +72,14 @@ bool input(char in) {
         case 'q': return false;
         case '.': depth += depthDelta; break;
         case ',': if (depth > depthDelta) depth -= depthDelta; break;
-        case 'l': translate += translateDelta * scale * rotate; break;
-        case 'h': translate -= translateDelta * scale * rotate; break;
-        case 'j': translate += translateDelta * I * scale * rotate; break;
-        case 'k': translate -= translateDelta * I * scale * rotate; break;
-        case 'u': rotate *= cexp(rotateDelta * PI * I); break;
-        case 'i': rotate /= cexp(rotateDelta * PI * I); break;
-        case '+': scale /= scaleFactor; break;
-        case '-': scale *= scaleFactor; break;
+        case 'l': translate += translateDelta * transform; break;
+        case 'h': translate -= translateDelta * transform; break;
+        case 'j': translate += translateDelta * I * transform; break;
+        case 'k': translate -= translateDelta * I * transform; break;
+        case 'u': transform *= cexp(rotateDelta * PI * I); break;
+        case 'i': transform /= cexp(rotateDelta * PI * I); break;
+        case '+': transform /= scaleFactor; break;
+        case '-': transform *= scaleFactor; break;
     }
     return true;
 }
@@ -89,11 +88,10 @@ const char *status(void) {
     static char buf[256];
     snprintf(
         buf, sizeof(buf),
-        "-d %u -t %g+%gi -r %g+%gi -z %g",
+        "-i %u -t %g+%gi -f %g+%gi",
         depth,
         creal(translate), cimag(translate),
-        creal(rotate), cimag(rotate),
-        scale
+        creal(transform), cimag(transform)
     );
     return buf;
 }
href='/src/commit/www/text.causal.agency/Makefile?id=9efb52aadc5c3c65701b998a5adcca8cb8b4a8c2&follow=1'>Publish "film review"June McEnroe 2024-10-12Add photos from October 6June McEnroe 2024-10-12Add photos from October 5June McEnroe 2024-10-09Add photos from October 1June McEnroe Ok the first 3 are from September 29 but I didn't want to spoil the black and white roll. 2024-10-07Add photos from September 29June McEnroe 2024-10-07Add photos from September 28June McEnroe 2024-10-07Add photos from September 22June McEnroe 2024-09-25Add photos from September 15June McEnroe 2024-09-24Add photos from September 14June McEnroe 2024-09-24Add photos from September 12June McEnroe 2024-09-24Add photos from September 7June McEnroe 2024-09-24Allow not having descriptionsJune McEnroe I'm sorry, I can't keep writing descriptions. It makes posting photos take too long, I often don't know the words for what I'm looking at, and a good description is an entirely different work of art than the photo I took, and I'm just a photographer. It's visual art. 2024-09-23Automatically select the last used lens for a bodyJune McEnroe 2024-09-19Add photos from September 5June McEnroe Had to prefix the folder number onto these file names manually because they must have come out of a different scanner or something. 2024-09-15Add some more film stocks to the listJune McEnroe 2024-09-13Add photos from September 2June McEnroe 2024-09-13Add Fomapan 200 to films listJune McEnroe 2024-09-10Add August 29 picnic photosJune McEnroe 2024-09-08Apply some bold to trips renderingJune McEnroe This seems easier to visually scan. The only other thing I'd like is a nicer date rendering but JavaScript is useless for that. 2024-09-08Render trips hopefully more efficientlyJune McEnroe 2024-09-08Allow removing bodies and lensesJune McEnroe 2024-09-08Limit body width so it looks less silly on desktopJune McEnroe 2024-09-07Handle no film being loadedJune McEnroe 2024-09-07Fancy up the text a littleJune McEnroe