Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ static char *the_docstring1 =
"dtime 1 time between frames (animate only)\n"
"fields 0 if 1 then render fields, ie odd scanlines at time+0.5\n"
"nstrips 1 number of strips, ie render fractions of a frame at once (render only)\n"
"strip NA the strip number to be rendered.\n"
"minstrip NA minimum strip number to be rendered. Using this allows rendering only strips between minstrip and maxstrip.\n"
"maxstrip NA maximum strip number to be rendered. Using this allows rendering only strips between minstrip and maxstrip.\n"
"qs 1 quality scale, multiply quality of all frames by this\n"
"ss 1 size scale, multiply size (in pixels) of all frames by this\n"
"jpeg NA jpeg quality for compression, default is native jpeg default\n"
Expand Down
28 changes: 27 additions & 1 deletion flam3-render.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ int main(int argc, char **argv) {
size_t this_size, last_size = -1;
double imgmem;
unsigned int strip;
int strip_to_render = argi("strip", -1);
double center_y, center_base;
unsigned int nstrips = 1;
randctx savectx;
Expand All @@ -135,6 +136,8 @@ int main(int argc, char **argv) {
int name_enable = argi("name_enable",0);
int num_threads = argi("nthreads",0);
int earlyclip = argi("earlyclip",0);
int minstrip = argi("minstrip", -1);
int maxstrip = argi("maxstrip", -1);
FILE *in;
double zoom_scale;
unsigned int channels;
Expand Down Expand Up @@ -319,7 +322,30 @@ int main(int argc, char **argv) {
/* Copy off random context to use for each strip */
memcpy(&savectx, &f.rc, sizeof(randctx));

for (strip = 0; strip < nstrips; strip++) {
if (minstrip < 1) {
minstrip = 1;
}

if (maxstrip < 0) {
maxstrip = nstrips;
}

// Only one strip is specified to be rendered, change minstrip and maxstrip accordingly
if (strip_to_render > 0 ) {

if (strip_to_render <= nstrips) {

minstrip = strip_to_render;
maxstrip = strip_to_render;
} else {

fprintf(stderr, "Te strip requested to be rendered %d %d is beyond the number of strips. Setting it to last strip\n", strip_to_render, nstrips - 1);
minstrip = nstrips;
maxstrip = nstrips;
}
}

for (strip = minstrip-1; strip < maxstrip; strip++) {
size_t ssoff = (size_t)cps[i].height * strip * cps[i].width * channels * f.bytes_per_channel;
void *strip_start = image + ssoff;
cps[i].center[1] = center_base + cps[i].height * (double) strip / (cps[i].pixels_per_unit * zoom_scale);
Expand Down