summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flam3.c4
-rw-r--r--flam3.h6
-rw-r--r--main.c2
-rw-r--r--palettes.c2
-rw-r--r--rect.c26
-rw-r--r--rect.h3
6 files changed, 12 insertions, 31 deletions
diff --git a/flam3.c b/flam3.c
index 74a4cc7..38d41b1 100644
--- a/flam3.c
+++ b/flam3.c
@@ -3081,11 +3081,11 @@ int flam3_estimate_bounding_box(flam3_genome *cp, double eps, int nsamples,
}
int flam3_render(flam3_frame *spec, void *out,
- int field, stat_struct *stats) {
+ stat_struct *stats) {
int retval;
- retval = render_rectangle (spec, out, field, stats);
+ retval = render_rectangle (spec, out, stats);
return(retval);
}
diff --git a/flam3.h b/flam3.h
index de082fd..3c7b860 100644
--- a/flam3.h
+++ b/flam3.h
@@ -582,13 +582,9 @@ typedef struct {
} flam3_frame;
-#define flam3_field_both 0
-#define flam3_field_even 1
-#define flam3_field_odd 2
-
/* out is pixel array. pixels are rgba */
int flam3_render(flam3_frame *spec, void *out,
- int field, stat_struct *stats);
+ stat_struct *stats);
void rotate_by(double *p, double *center, double by);
diff --git a/main.c b/main.c
index 7a24e82..63384e3 100644
--- a/main.c
+++ b/main.c
@@ -133,7 +133,7 @@ static void do_render (const render_arguments * const arguments) {
void *image = (void *) calloc(this_size, sizeof(char));
stat_struct stats;
- if (flam3_render (&f, image, flam3_field_both, &stats)) {
+ if (flam3_render (&f, image, &stats)) {
fprintf(stderr,"error rendering image: aborting.\n");
exit(1);
}
diff --git a/palettes.c b/palettes.c
index 6154054..77f3142 100644
--- a/palettes.c
+++ b/palettes.c
@@ -382,7 +382,7 @@ static double try_colors(flam3_genome *g, int color_resolution) {
f.sub_batch_size = 10000;
image = (unsigned char *) calloc(g->width * g->height, 3);
- if (flam3_render(&f, image, flam3_field_both, &stats)) {
+ if (flam3_render(&f, image, &stats)) {
fprintf(stderr,"Error rendering test image for trycolors. Aborting.\n");
return(-1);
}
diff --git a/rect.c b/rect.c
index e6d02aa..e2197f4 100644
--- a/rect.c
+++ b/rect.c
@@ -284,7 +284,7 @@ static double4 clip (const double4 in, const double g, const double linrange,
}
int render_rectangle(flam3_frame *spec, void *out,
- int field, stat_struct *stats) {
+ stat_struct *stats) {
long nbuckets;
int i, j, k;
double ppux=0, ppuy=0;
@@ -339,15 +339,7 @@ int render_rectangle(flam3_frame *spec, void *out,
const unsigned int channels = 4;
image_width = cp.width;
out_width = image_width;
- if (field) {
- image_height = cp.height / 2;
-
- if (field == flam3_field_odd)
- out = (unsigned char *)out + channels * bytes_per_channel * out_width;
-
- out_width *= 2;
- } else
- image_height = cp.height;
+ image_height = cp.height;
/* Allocate the space required to render the image */
fic.height = image_height;
@@ -405,7 +397,7 @@ int render_rectangle(flam3_frame *spec, void *out,
/* compute camera */
{
- double shift=0.0, corner0, corner1;
+ double corner0, corner1;
double scale;
if (cp.sample_density <= 0.0) {
@@ -419,20 +411,14 @@ int render_rectangle(flam3_frame *spec, void *out,
sample_density = cp.sample_density * scale * scale;
ppux = cp.pixels_per_unit * scale;
- ppuy = field ? (ppux / 2.0) : ppux;
+ ppuy = ppux;
ppux /= spec->pixel_aspect_ratio;
- switch (field) {
- case flam3_field_both: shift = 0.0; break;
- case flam3_field_even: shift = -0.5; break;
- case flam3_field_odd: shift = 0.5; break;
- }
- shift = shift / ppux;
corner0 = cp.center[0] - image_width / ppux / 2.0;
corner1 = cp.center[1] - image_height / ppuy / 2.0;
fic.bounds[0] = corner0;
- fic.bounds[1] = corner1 + shift;
+ fic.bounds[1] = corner1;
fic.bounds[2] = corner0 + image_width / ppux;
- fic.bounds[3] = corner1 + image_height / ppuy + shift;
+ fic.bounds[3] = corner1 + image_height / ppuy;
fic.size[0] = 1.0 / (fic.bounds[2] - fic.bounds[0]);
fic.size[1] = 1.0 / (fic.bounds[3] - fic.bounds[1]);
rotate_center ((double2) { cp.rot_center[0], cp.rot_center[1] },
diff --git a/rect.h b/rect.h
index 2d40713..7ec2a3b 100644
--- a/rect.h
+++ b/rect.h
@@ -1,5 +1,4 @@
#pragma once
-int render_rectangle(flam3_frame *spec, void *out,
- int field, stat_struct *stats);
+int render_rectangle(flam3_frame *spec, void *out, stat_struct *stats);