? .sconsign.dblite ? blender ? blender.cbp ? blender.cbp.save ? blender.layout ? bin/Debug ? source/blender/src/drawseq.c.save ? source/blender/src/seqeffects ? source/blender/src/seqeffects.c.save ? tools/Blender.pyc ? tools/__init__.pyc ? tools/bcolors.pyc ? tools/btools.pyc Index: config/linux2-config.py =================================================================== RCS file: /cvsroot/bf-blender/blender/config/linux2-config.py,v retrieving revision 1.26 diff -u -r1.26 linux2-config.py --- config/linux2-config.py 21 Nov 2006 06:11:41 -0000 1.26 +++ config/linux2-config.py 7 Dec 2006 20:43:12 -0000 @@ -11,7 +11,7 @@ BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a' BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic'] -WITH_BF_OPENAL = 'true' +WITH_BF_OPENAL = 'false' BF_OPENAL = '/usr' BF_OPENAL_INC = '${BF_OPENAL}/include' BF_OPENAL_LIB = 'openal' Index: intern/SoundSystem/openal/SND_OpenALDevice.cpp =================================================================== RCS file: /cvsroot/bf-blender/blender/intern/SoundSystem/openal/SND_OpenALDevice.cpp,v retrieving revision 1.25 diff -u -r1.25 SND_OpenALDevice.cpp --- intern/SoundSystem/openal/SND_OpenALDevice.cpp 29 Jan 2006 21:29:14 -0000 1.25 +++ intern/SoundSystem/openal/SND_OpenALDevice.cpp 7 Dec 2006 20:43:13 -0000 @@ -231,7 +231,7 @@ m_context = alcCreateContext(dev, NULL); if (m_context) { -#ifdef AL_VERSION_1_1 +#if defined(AL_VERSION_1_1) || defined(ALC_VERSION_0_1) alcMakeContextCurrent((ALCcontext*)m_context); #else alcMakeContextCurrent(m_context); Index: source/blender/blenloader/intern/writefile.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/blenloader/intern/writefile.c,v retrieving revision 1.91 diff -u -r1.91 writefile.c --- source/blender/blenloader/intern/writefile.c 3 Dec 2006 22:15:49 -0000 1.91 +++ source/blender/blenloader/intern/writefile.c 7 Dec 2006 20:43:16 -0000 @@ -192,7 +192,7 @@ int file; unsigned char *buf; MemFile *compare, *current; - + int tot, count, error, memsize; } WriteData; @@ -230,7 +230,7 @@ else { if (write(wd->file, mem, memlen) != memlen) wd->error= 1; - + } } @@ -252,7 +252,7 @@ * @param len Length of new chunk of data * @warning Talks to other functions with global parameters */ - + #define MYWRITE_FLUSH NULL static void mywrite( WriteData *wd, void *adr, int len) @@ -268,7 +268,7 @@ } wd->tot+= len; - + if(len>50000) { if(wd->count) { writedata_do_write(wd, wd->buf, wd->count); @@ -302,7 +302,7 @@ wd->current= current; /* this inits comparing */ add_memfilechunk(compare, NULL, NULL, 0); - + return wd; } @@ -320,7 +320,7 @@ writedata_do_write(wd, wd->buf, wd->count); wd->count= 0; } - + err= wd->error; writedata_free(wd); /* blender gods may live forever but this parent pointer died in the statement above @@ -432,7 +432,7 @@ static void write_curvemapping(WriteData *wd, CurveMapping *cumap) { int a; - + writestruct(wd, DATA, "CurveMapping", 1, cumap); for(a=0; acm[a].totpoint, cumap->cm[a].curve); @@ -444,9 +444,9 @@ bNode *node; bNodeSocket *sock; bNodeLink *link; - + /* for link_list() speed, we write per list */ - + for(node= ntree->nodes.first; node; node= node->next) writestruct(wd, DATA, "bNode", 1, node); @@ -457,7 +457,7 @@ write_curvemapping(wd, node->storage); else if(ntree->type==NTREE_COMPOSIT && (node->type==CMP_NODE_TIME || node->type==CMP_NODE_CURVE_VEC || node->type==CMP_NODE_CURVE_RGB)) write_curvemapping(wd, node->storage); - else + else writestruct(wd, DATA, node->typeinfo->storagename, 1, node->storage); } for(sock= node->inputs.first; sock; sock= sock->next) @@ -465,7 +465,7 @@ for(sock= node->outputs.first; sock; sock= sock->next) writestruct(wd, DATA, "bNodeSocket", 1, sock); } - + for(link= ntree->links.first; link; link= link->next) writestruct(wd, DATA, "bNodeLink", 1, link); } @@ -686,7 +686,7 @@ { bActionStrip *strip; bActionModifier *amod; - + for (strip=nlabase->first; strip; strip=strip->next) writestruct(wd, DATA, "bActionStrip", 1, strip); for (strip=nlabase->first; strip; strip=strip->next) { @@ -814,7 +814,7 @@ { Object *ob; int a; - + ob= idbase->first; while(ob) { if(ob->id.us>0 || wd->current) { @@ -846,7 +846,7 @@ write_constraints(wd, &ob->constraints); write_constraint_channels(wd, &ob->constraintChannels); write_nlastrips(wd, &ob->nlastrips); - + writestruct(wd, DATA, "PartDeflect", 1, ob->pd); writestruct(wd, DATA, "SoftBody", 1, ob->soft); if(ob->soft) { @@ -859,7 +859,7 @@ } } writestruct(wd, DATA, "FluidsimSettings", 1, ob->fluidsimSettings); // NT - + write_modifiers(wd, &ob->modifiers); } ob= ob->id.next; @@ -1026,7 +1026,7 @@ if(cu->vfont) { writedata(wd, DATA, amount_of_chars(cu->str)+1, cu->str); writestruct(wd, DATA, "CharInfo", cu->len, cu->strinfo); - writestruct(wd, DATA, "TextBox", cu->totbox, cu->tb); + writestruct(wd, DATA, "TextBox", cu->totbox, cu->tb); } else { /* is also the order of reading */ @@ -1059,10 +1059,10 @@ { if (dvlist) { int i; - + /* Write the dvert list */ writestruct(wd, DATA, "MDeformVert", count, dvlist); - + /* Write deformation data for each dvert */ for (i=0; ifirst; while(lt) { if(lt->id.us>0 || wd->current) { @@ -1211,9 +1211,9 @@ /* direct data */ writestruct(wd, DATA, "BPoint", lt->pntsu*lt->pntsv*lt->pntsw, lt->def); - + write_dverts(wd, lt->pntsu*lt->pntsv*lt->pntsw, lt->dvert); - + } lt= lt->id.next; } @@ -1283,7 +1283,7 @@ if(ma->id.us>0 || wd->current) { /* write LibData */ writestruct(wd, ID_MA, "Material", 1, ma); - + /*Write ID Properties -- and copy this comment EXACTLY for easy finding of library blocks that implement this.*/ /*manually set head group property to IDP_GROUP, just in case it hadn't been @@ -1293,12 +1293,12 @@ for(a=0; amtex[a]) writestruct(wd, DATA, "MTex", 1, ma->mtex[a]); } - + if(ma->ramp_col) writestruct(wd, DATA, "ColorBand", 1, ma->ramp_col); if(ma->ramp_spec) writestruct(wd, DATA, "ColorBand", 1, ma->ramp_spec); - + write_scriptlink(wd, &ma->scriptlink); - + /* nodetree is integral part of material, no libdata */ if(ma->nodetree) { writestruct(wd, DATA, "bNodeTree", 1, ma->nodetree); @@ -1366,7 +1366,7 @@ TimeMarker *marker; SceneRenderLayer *srl; int a; - + sce= scebase->first; while(sce) { /* write LibData */ @@ -1413,6 +1413,9 @@ case SEQ_WIPE: writestruct(wd, DATA, "WipeVars", 1, seq->effectdata); break; + case SEQ_PUSH: + writestruct(wd, DATA, "PushVars", 1, seq->effectdata); + break; case SEQ_GLOW: writestruct(wd, DATA, "GlowVars", 1, seq->effectdata); break; @@ -1434,7 +1437,7 @@ } } END_SEQ - + /* new; meta stack too, even when its nasty restore code */ for(ms= ed->metastack.first; ms; ms= ms->next) { writestruct(wd, DATA, "MetaStack", 1, ms); @@ -1457,15 +1460,15 @@ /* writing dynamic list of TimeMarkers to the blend file */ for(marker= sce->markers.first; marker; marker= marker->next) writestruct(wd, DATA, "TimeMarker", 1, marker); - + for(srl= sce->r.layers.first; srl; srl= srl->next) writestruct(wd, DATA, "SceneRenderLayer", 1, srl); - + if(sce->nodetree) { writestruct(wd, DATA, "bNodeTree", 1, sce->nodetree); write_nodetree(wd, sce->nodetree); } - + sce= sce->id.next; } /* flush helps the compression for undo-save */ @@ -1567,10 +1570,10 @@ } else if(sl->spacetype==SPACE_IMAGE) { SpaceImage *sima= (SpaceImage *)sl; - + writestruct(wd, DATA, "SpaceImage", 1, sl); if(sima->cumap) - write_curvemapping(wd, sima->cumap); + write_curvemapping(wd, sima->cumap); } else if(sl->spacetype==SPACE_IMASEL) { writestruct(wd, DATA, "SpaceImaSel", 1, sl); @@ -1648,10 +1651,10 @@ // PATCH for upward compatibility after 2.37+ armature recode bone->size[0]= bone->size[1]= bone->size[2]= 1.0f; - + // Write this bone writestruct(wd, DATA, "Bone", 1, bone); - + // Write Children cbone= bone->childbase.first; while(cbone) { @@ -1689,7 +1692,7 @@ { bAction *act; bActionChannel *chan; - + for(act=idbase->first; act; act= act->id.next) { if (act->id.us>0 || wd->current) { writestruct(wd, ID_AC, "bAction", 1, act); @@ -1811,7 +1814,7 @@ static void write_nodetrees(WriteData *wd, ListBase *idbase) { bNodeTree *ntree; - + for(ntree=idbase->first; ntree; ntree= ntree->id.next) { if (ntree->id.us>0 || wd->current) { writestruct(wd, ID_NT, "bNodeTree", 1, ntree); @@ -1825,7 +1828,7 @@ { Brush *brush; int a; - + for(brush=idbase->first; brush; brush= brush->id.next) { if(brush->id.us>0 || wd->current) { writestruct(wd, ID_BR, "Brush", 1, brush); @@ -1840,7 +1843,7 @@ static void write_global(WriteData *wd) { FileGlobal fg; - + fg.curscreen= G.curscreen; fg.curscene= G.scene; fg.displaymode= G.displaymode; @@ -1852,7 +1855,7 @@ fg.subversion= BLENDER_SUBVERSION; fg.minversion= BLENDER_MINVERSION; fg.minsubversion= BLENDER_MINSUBVERSION; - + writestruct(wd, GLOB, "FileGlobal", 1, &fg); } @@ -1867,7 +1870,7 @@ blo_split_main(&mainlist, G.main); wd= bgnwrite(handle, compare, current, write_flags); - + sprintf(buf, "BLENDER%c%c%.3d", (sizeof(void*)==8)?'-':'_', (G.order==B_ENDIAN)?'V':'v', G.version); mywrite(wd, buf, 12); @@ -1898,7 +1901,7 @@ write_meshs (wd, &G.main->mesh); write_nodetrees(wd, &G.main->nodetree); write_brushes (wd, &G.main->brush); - if(current==NULL) + if(current==NULL) write_libraries(wd, G.main->next); /* no library save in undo */ if (write_user_block) { @@ -1943,11 +1946,11 @@ if(!err) { if(write_flags & G_FILE_COMPRESS) - { + { // compressed files have the same ending as regular files... only from 2.4!!! - + int ret = BLI_gzip(tempname, dir); - + if(-1==ret) { *error_r= "Failed opening .gz file"; return 0; @@ -1963,7 +1966,7 @@ return 0; } - + } else { remove(tempname); @@ -1980,7 +1983,7 @@ int err; err= write_file_handle(0, compare, current, 0, write_flags); - + if(err==0) return 1; return 0; } @@ -2040,7 +2043,7 @@ #ifdef __APPLE__ -static int recursive_copy_runtime(char *outname, char *exename, char **cause_r) +static int recursive_copy_runtime(char *outname, char *exename, char **cause_r) { char *cause = NULL, *runtime = get_runtime_path(exename); char command[2 * (FILE_MAXDIR+FILE_MAXFILE) + 32]; @@ -2051,7 +2054,7 @@ goto cleanup; } //printf("runtimepath %s\n", runtime); - + progfd= open(runtime, O_BINARY|O_RDONLY, 0); if (progfd==-1) { cause= "Unable to find runtime"; Index: source/blender/include/BSE_seqeffects.h =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/include/BSE_seqeffects.h,v retrieving revision 1.3 diff -u -r1.3 BSE_seqeffects.h --- source/blender/include/BSE_seqeffects.h 11 Nov 2006 22:35:39 -0000 1.3 +++ source/blender/include/BSE_seqeffects.h 7 Dec 2006 20:43:16 -0000 @@ -38,6 +38,9 @@ enum {DO_SINGLE_WIPE, DO_DOUBLE_WIPE, DO_BOX_WIPE, DO_CROSS_WIPE, DO_IRIS_WIPE,DO_CLOCK_WIPE}; +/* Push effect */ +enum {DO_LEFT_PUSH, DO_RIGHT_PUSH, DO_TOP_PUSH, DO_BOTTOM_PUSH, DO_HORI_PUSH, DO_VERT_PUSH}; + struct Sequence; struct ImBuf; @@ -47,7 +50,7 @@ void (*init)(struct Sequence *seq); void (*init_plugin)(struct Sequence * seq, const char * fname); - /* number of input strips needed + /* number of input strips needed (called directly after construction) */ int (*num_inputs)(); @@ -62,11 +65,11 @@ void (*free)(struct Sequence *seq); /* returns: -1: no input needed, - 0: no early out, - 1: out = ibuf1, + 0: no early out, + 1: out = ibuf1, 2: out = ibuf2 */ int (*early_out)(struct Sequence *seq, - float facf0, float facf1); + float facf0, float facf1); /* stores the default facf0 and facf1 if no IPO is present */ void (*get_default_fac)(struct Sequence * seq, int cfra, @@ -74,7 +77,7 @@ /* execute the effect sequence effects are only required to either support - float-rects or byte-rects + float-rects or byte-rects (mixed cases are handled one layer up...) */ void (*execute)(struct Sequence *seq, int cfra, Index: source/blender/makesdna/DNA_sequence_types.h =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/makesdna/DNA_sequence_types.h,v retrieving revision 1.26 diff -u -r1.26 DNA_sequence_types.h --- source/blender/makesdna/DNA_sequence_types.h 11 Nov 2006 22:35:39 -0000 1.26 +++ source/blender/makesdna/DNA_sequence_types.h 7 Dec 2006 20:43:16 -0000 @@ -145,12 +145,16 @@ } Editing; /* ************* Effect Variable Structs ********* */ +typedef struct PushVars { + short pushtype, pushnb; +} PushVars; + typedef struct WipeVars { float edgeWidth,angle; short forward, wipetype; } WipeVars; -typedef struct GlowVars { +typedef struct GlowVars { float fMini; /* Minimum intensity to trigger a glow */ float fClamp; float fBoost; /* Amount to multiply glow intensity */ @@ -225,10 +229,10 @@ #define SEQ_PLUGIN 24 #define SEQ_WIPE 25 #define SEQ_GLOW 26 -#define SEQ_TRANSFORM 27 -#define SEQ_COLOR 28 -#define SEQ_SPEED 29 - +#define SEQ_TRANSFORM 27 +#define SEQ_COLOR 28 +#define SEQ_SPEED 29 +#define SEQ_PUSH 30 #endif Index: source/blender/src/drawseq.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/src/drawseq.c,v retrieving revision 1.70 diff -u -r1.70 drawseq.c --- source/blender/src/drawseq.c 11 Nov 2006 22:35:40 -0000 1.70 +++ source/blender/src/drawseq.c 7 Dec 2006 20:43:17 -0000 @@ -56,7 +56,7 @@ #include "BKE_plugin_types.h" #include "BKE_scene.h" #include "BKE_utildefines.h" - + #include "BIF_cursors.h" #include "BIF_gl.h" #include "BIF_graphics.h" @@ -115,6 +115,7 @@ else if(seq->type==SEQ_ALPHAUNDER) return "Alpha Under"; else if(seq->type==SEQ_OVERDROP) return "Over Drop"; else if(seq->type==SEQ_WIPE) return "Wipe"; + else if(seq->type==SEQ_PUSH) return "Push"; else if(seq->type==SEQ_GLOW) return "Glow"; else if(seq->type==SEQ_TRANSFORM) return "Transform"; else if(seq->type==SEQ_COLOR) return "Color"; @@ -156,7 +157,7 @@ break; case SEQ_SCENE: BIF_GetThemeColor3ubv(TH_SEQ_SCENE, col); - + if(seq->scene==G.scene) { BIF_GetColorPtrBlendShade3ubv(col, col, col, 1.0, 20); } @@ -166,21 +167,23 @@ case SEQ_CROSS: case SEQ_GAMCROSS: case SEQ_WIPE: + case SEQ_PUSH: /* slightly offset hue to distinguish different effects */ BIF_GetThemeColor3ubv(TH_SEQ_TRANSITION, col); - - rgb[0] = col[0]/255.0; rgb[1] = col[1]/255.0; rgb[2] = col[2]/255.0; + + rgb[0] = col[0]/255.0; rgb[1] = col[1]/255.0; rgb[2] = col[2]/255.0; rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); - + if (seq->type == SEQ_CROSS) hsv[0]+= 0.04; if (seq->type == SEQ_GAMCROSS) hsv[0]+= 0.08; if (seq->type == SEQ_WIPE) hsv[0]+= 0.12; - + if (seq->type == SEQ_PUSH) hsv[0]+= 0.16; + if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0; hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2); - col[0] = (char)(rgb[0]*255); col[1] = (char)(rgb[1]*255); col[2] = (char)(rgb[2]*255); + col[0] = (char)(rgb[0]*255); col[1] = (char)(rgb[1]*255); col[2] = (char)(rgb[2]*255); break; - + /* effects */ case SEQ_TRANSFORM: case SEQ_SPEED: @@ -193,10 +196,10 @@ case SEQ_GLOW: /* slightly offset hue to distinguish different effects */ BIF_GetThemeColor3ubv(TH_SEQ_EFFECT, col); - - rgb[0] = col[0]/255.0; rgb[1] = col[1]/255.0; rgb[2] = col[2]/255.0; + + rgb[0] = col[0]/255.0; rgb[1] = col[1]/255.0; rgb[2] = col[2]/255.0; rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); - + if (seq->type == SEQ_ADD) hsv[0]+= 0.04; if (seq->type == SEQ_SUB) hsv[0]+= 0.08; if (seq->type == SEQ_MUL) hsv[0]+= 0.12; @@ -208,7 +211,7 @@ if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0; hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2); - col[0] = (char)(rgb[0]*255); col[1] = (char)(rgb[1]*255); col[2] = (char)(rgb[2]*255); + col[0] = (char)(rgb[0]*255); col[1] = (char)(rgb[1]*255); col[2] = (char)(rgb[2]*255); break; case SEQ_COLOR: if (colvars->col) { @@ -239,7 +242,7 @@ float dx; int nr; char col[3]; - + nr= 0; WHILE_SEQ(&seqm->seqbase) { nr++; @@ -250,16 +253,16 @@ WHILE_SEQ(&seqm->seqbase) { get_seq_color3ubv(seq, col); - + glColor3ubv(col); glRectf(x1, y1, x1+0.9*dx, y2); - + BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -30); glColor3ubv(col); fdrawbox(x1, y1, x1+0.9*dx, y2); - + x1+= dx; } END_SEQ @@ -272,7 +275,7 @@ x2 the end x value, same for y1 and y2 winx is the zoom level. */ - + float f, /* floating point value used to store the X draw location for the wave lines when openGL drawing*/ midy, /* fast access to the middle location (y1+y2)/2 */ @@ -283,7 +286,7 @@ feofs_sofs, /* */ sound_width, /* convenience: x2-x1 */ wavemulti; /* scale the samples by this value when GL_LINE drawing so it renders the right height */ - + int offset, /* initial offset value for the wave drawing */ offset_next, /* when in the wave drawing loop this value is the samples intil the next vert */ @@ -296,27 +299,27 @@ the wave is evaluated for min and max values used to draw the wave, however this is slow ehrn zoomed out so when the sample step is above 1 (the larger the further out the zoom is) so not evaluate all samples, only some. */ - + signed short* s; bSound *sound; Uint8 *stream; - + audio_makestream(seq->sound); if(seq->sound==NULL || seq->sound->stream==NULL) return; - + if (seq->flag & SEQ_MUTE) glColor3ub(0x70, 0x80, 0x80); else glColor3ub(0x70, 0xc0, 0xc0); - + sofs = ((int)( (((float)(seq->startdisp-seq->start))/(float)G.scene->r.frs_sec)*(float)G.scene->audio.mixrate*4.0 )) & (~3); eofs = ((int)( (((float)(seq->enddisp-seq->start))/(float)G.scene->r.frs_sec)*(float)G.scene->audio.mixrate*4.0 )) & (~3); - + /* clip the drawing area to the screen bounds to save time */ sample_step= (G.v2d->cur.xmax - G.v2d->cur.xmin)/winx; clipxmin= MAX2(x1, G.v2d->cur.xmin); clipxmax= MIN2(x2, G.v2d->cur.xmax); - + if (sample_step > 1) subsample_step= ((int)(subsample_step*sample_step*8)) & (~3); - + /* for speedy access */ midy = (y1+y2)/2; fsofs= (float)sofs; @@ -326,28 +329,28 @@ stream = sound->stream; wavemulti = (y2-y1)/196605; /*y2-y1 is the height*/ wavesample=0; - + /* we need to get the starting offset value, excuse the duplicate code */ f=clipxmin; offset= (int) (fsofs + ((f-x1)/sound_width) * feofs_sofs) & (~3); - + /* start the loop, draw a line per sample_step -sample_step is about 1 line drawn per pixel */ glBegin(GL_LINES); for (f=x1+sample_step; f<=clipxmax; f+=sample_step) { - + offset_next = (int) (fsofs + ((f-x1)/sound_width) * feofs_sofs) & (~3); if (f > G.v2d->cur.xmin) { /* if this is close to the last sample just exit */ if (offset_next >= sound->streamlen) break; - + wavesamplemin = 131070; wavesamplemax = -131070; - + /*find with high and low of the waveform for this draw, evaluate small samples to find this range */ while (offset < offset_next) { s = (signed short*)(stream+offset); - + wavesample = s[0]*2 + s[1]; if (wavesamplemin>wavesample) wavesamplemin=wavesample; @@ -361,7 +364,7 @@ } else { while (offset < offset_next) offset+=subsample_step; } - + offset=offset_next; } glEnd(); @@ -378,68 +381,68 @@ char str[120]; unsigned int whichsel=0; View2D *v2d; - + x1= seq->startdisp; x2= seq->enddisp; - + y1= seq->machine+SEQ_STRIP_OFSBOTTOM; y2= seq->machine+SEQ_STRIP_OFSTOP; - + v2d = &sseq->v2d; pixelx = (v2d->cur.xmax - v2d->cur.xmin)/(v2d->mask.xmax - v2d->mask.xmin); - + /* clamp handles to defined size in pixel space */ handsize = seq->handsize; minhandle = 7; maxhandle = 28; CLAMP(handsize, minhandle*pixelx, maxhandle*pixelx); - + /* set up co-ordinates/dimensions for either left or right handle */ - if (direction == SEQ_LEFTHANDLE) { + if (direction == SEQ_LEFTHANDLE) { rx1 = x1; rx2 = x1+handsize*0.75; - + v1[0]= x1+handsize/4; v1[1]= y1+( ((y1+y2)/2.0 - y1)/2); v2[0]= x1+handsize/4; v2[1]= y2-( ((y1+y2)/2.0 - y1)/2); v3[0]= v2[0] + handsize/4; v3[1]= (y1+y2)/2.0; - + whichsel = SEQ_LEFTSEL; - } else if (direction == SEQ_RIGHTHANDLE) { + } else if (direction == SEQ_RIGHTHANDLE) { rx1 = x2-handsize*0.75; rx2 = x2; - + v1[0]= x2-handsize/4; v1[1]= y1+( ((y1+y2)/2.0 - y1)/2); v2[0]= x2-handsize/4; v2[1]= y2-( ((y1+y2)/2.0 - y1)/2); v3[0]= v2[0] - handsize/4; v3[1]= (y1+y2)/2.0; - + whichsel = SEQ_RIGHTSEL; } - + /* draw! */ - if(seq->type < SEQ_EFFECT || + if(seq->type < SEQ_EFFECT || get_sequence_effect_num_inputs(seq->type) == 0) { glEnable( GL_BLEND ); - + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - + if(seq->flag & whichsel) glColor4ub(0, 0, 0, 80); else if (seq->flag & SELECT) glColor4ub(255, 255, 255, 30); else glColor4ub(0, 0, 0, 22); - + glRectf(rx1, y1, rx2, y2); - + if(seq->flag & whichsel) glColor4ub(255, 255, 255, 200); else glColor4ub(0, 0, 0, 50); - + glEnable( GL_POLYGON_SMOOTH ); glBegin(GL_TRIANGLES); glVertex2fv(v1); glVertex2fv(v2); glVertex2fv(v3); glEnd(); - + glDisable( GL_POLYGON_SMOOTH ); glDisable( GL_BLEND ); } - + if(G.moving || (seq->flag & whichsel)) { cpack(0xFFFFFF); if (direction == SEQ_LEFTHANDLE) { @@ -450,7 +453,7 @@ glRasterPos3f((x2-BMF_GetStringWidth(G.font, str)*pixelx), y2+0.05, 0.0); } BMF_DrawString(G.font, str); - } + } } static void draw_seq_extensions(Sequence *seq, SpaceSeq *sseq) @@ -458,26 +461,26 @@ float x1, x2, y1, y2, pixely, a; char col[3], blendcol[3]; View2D *v2d; - + if(seq->type >= SEQ_EFFECT) return; x1= seq->startdisp; x2= seq->enddisp; - + y1= seq->machine+SEQ_STRIP_OFSBOTTOM; y2= seq->machine+SEQ_STRIP_OFSTOP; - + v2d = &sseq->v2d; pixely = (v2d->cur.ymax - v2d->cur.ymin)/(v2d->mask.ymax - v2d->mask.ymin); - + blendcol[0] = blendcol[1] = blendcol[2] = 120; if(seq->startofs) { glEnable( GL_BLEND ); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - + get_seq_color3ubv(seq, col); - + if (seq->flag & SELECT) { BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.3, -40); glColor4ub(col[0], col[1], col[2], 170); @@ -485,22 +488,22 @@ BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.6, 0); glColor4ub(col[0], col[1], col[2], 110); } - + glRectf((float)(seq->start), y1-SEQ_STRIP_OFSBOTTOM, x1, y1); - + if (seq->flag & SELECT) glColor4ub(col[0], col[1], col[2], 255); else glColor4ub(col[0], col[1], col[2], 160); fdrawbox((float)(seq->start), y1-SEQ_STRIP_OFSBOTTOM, x1, y1); //outline - + glDisable( GL_BLEND ); } if(seq->endofs) { glEnable( GL_BLEND ); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - + get_seq_color3ubv(seq, col); - + if (seq->flag & SELECT) { BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.3, -40); glColor4ub(col[0], col[1], col[2], 170); @@ -508,30 +511,30 @@ BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.6, 0); glColor4ub(col[0], col[1], col[2], 110); } - + glRectf(x2, y2, (float)(seq->start+seq->len), y2+SEQ_STRIP_OFSBOTTOM); - + if (seq->flag & SELECT) glColor4ub(col[0], col[1], col[2], 255); else glColor4ub(col[0], col[1], col[2], 160); fdrawbox(x2, y2, (float)(seq->start+seq->len), y2+SEQ_STRIP_OFSBOTTOM); //outline - + glDisable( GL_BLEND ); } if(seq->startstill) { get_seq_color3ubv(seq, col); BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.75, 40); glColor3ubv(col); - + draw_shadedstrip(seq, col, x1, y1, (float)(seq->start), y2); - + /* feint pinstripes, helps see exactly which is extended and which isn't, - * especially when the extension is very small */ + * especially when the extension is very small */ if (seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 24); else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -16); - + glColor3ubv(col); - + for(a=y1; a< y2; a+= pixely*2.0 ) { fdrawline(x1, a, (float)(seq->start), a); } @@ -540,16 +543,16 @@ get_seq_color3ubv(seq, col); BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.75, 40); glColor3ubv(col); - + draw_shadedstrip(seq, col, (float)(seq->start+seq->len), y1, x2, y2); - + /* feint pinstripes, helps see exactly which is extended and which isn't, - * especially when the extension is very small */ + * especially when the extension is very small */ if (seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 24); else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -16); - + glColor3ubv(col); - + for(a=y1; a< y2; a+= pixely*2.0 ) { fdrawline((float)(seq->start+seq->len), a, x2, a); } @@ -563,10 +566,10 @@ int len, size; char str[32 + FILE_MAXDIR+FILE_MAXFILE], *strp; short mval[2]; - + v1[1]= y1; v2[1]= y2; - + v1[0]= x1; ipoco_to_areaco_noclip(G.v2d, v1, mval); x1= mval[0]; @@ -574,7 +577,7 @@ ipoco_to_areaco_noclip(G.v2d, v2, mval); x2= mval[0]; size= x2-x1; - + if(seq->name[2]) { sprintf(str, "%d | %s: %s", seq->len, give_seqname(seq), seq->name+2); }else{ @@ -584,7 +587,7 @@ else if(seq->type == SEQ_SCENE) { if(seq->scene) sprintf(str, "%d | %s: %s", seq->len, give_seqname(seq), seq->scene->id.name+2); else sprintf(str, "%d | %s", seq->len, give_seqname(seq)); - + } else if(seq->type == SEQ_IMAGE) { sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name); @@ -597,7 +600,7 @@ sprintf(str, "%d | %s: %d>%d (use %d)%s", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine, seq->seq3->machine, can_float ? "" : " No float, upgrade plugin!"); else if (seq->seq1 && seq->seq2) sprintf(str, "%d | %s: %d>%d%s", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine, can_float ? "" : " No float, upgrade plugin!"); - else + else sprintf(str, "%d | %s", seq->len, give_seqname(seq)); } else if (seq->type == SEQ_RAM_SOUND) { @@ -610,19 +613,19 @@ sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name); } } - + strp= str; - + while( (len= BMF_GetStringWidth(G.font, strp)) > size) { if(len < 10) break; if(strp[1]==0) break; strp++; } - + mval[0]= (x1+x2-len+1)/2; mval[1]= 1; areamouseco_to_ipoco(G.v2d, mval, &x1, &x2); - + if(seq->flag & SELECT) cpack(0xFFFFFF); else cpack(0); glRasterPos3f(x1, y1+SEQ_STRIP_OFSBOTTOM, 0.0); @@ -633,48 +636,48 @@ static void draw_shadedstrip(Sequence *seq, char *col, float x1, float y1, float x2, float y2) { float ymid1, ymid2; - + ymid1 = (y2-y1)*0.25 + y1; ymid2 = (y2-y1)*0.65 + y1; - + glShadeModel(GL_SMOOTH); glBegin(GL_QUADS); - + if(seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -50); else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 0); - + glColor3ubv(col); - + glVertex2f(x1,y1); glVertex2f(x2,y1); - + if(seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 5); else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -5); glColor3ubv(col); - + glVertex2f(x2,ymid1); glVertex2f(x1,ymid1); - + glEnd(); - + glRectf(x1, ymid1, x2, ymid2); - + glBegin(GL_QUADS); - + glVertex2f(x1,ymid2); glVertex2f(x2,ymid2); - + if(seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -15); else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 25); - + glColor3ubv(col); - + glVertex2f(x2,y2); glVertex2f(x1,y2); - + glEnd(); - + } /* @@ -695,24 +698,24 @@ if(seq->endstill) x2= seq->start+seq->len; else x2= seq->enddisp; y2= seq->machine+SEQ_STRIP_OFSTOP; - - + + /* get the correct colour per strip type*/ get_seq_color3ubv(seq, col); - + /* draw the main strip body */ draw_shadedstrip(seq, col, x1, y1, x2, y2); - + /* draw additional info and controls */ if (seq->type == SEQ_RAM_SOUND) drawseqwave(seq, x1, y1, x2, y2, sa->winx); draw_seq_extensions(seq, sseq); draw_seq_handle(seq, sseq, SEQ_LEFTHANDLE); draw_seq_handle(seq, sseq, SEQ_RIGHTHANDLE); - + /* draw the strip outline */ x1= seq->startdisp; x2= seq->enddisp; - + get_seq_color3ubv(seq, col); if (G.moving && (seq->flag & SELECT)) { if(seq->flag & SEQ_OVERLAP) { @@ -726,7 +729,7 @@ glColor3ubv(col); gl_round_box_shade(GL_LINE_LOOP, x1, y1, x2, y2, 0.0, 0.1, 0.0); - + /* calculate if seq is long enough to print a name */ x1= seq->startdisp+seq->handsize; x2= seq->enddisp-seq->handsize; @@ -743,7 +746,7 @@ if(x1 != x2) { draw_seq_text(seq, x1, x2, y1, y2); } - + } static Sequence *special_seq_update= 0; @@ -781,16 +784,16 @@ /* BIG PROBLEM: the give_ibuf_seq() can call a rendering, which in turn calls redraws... this shouldn't belong in a window drawing.... - So: solve this once event based. + So: solve this once event based. Now we check for recursion, space type and active area again (ton) */ - + if(recursive) return; else { recursive= 1; ibuf= (ImBuf *)give_ibuf_seq(rectx, recty, (G.scene->r.cfra), sseq->chanshown); recursive= 0; - + /* HURMF! the give_ibuf_seq can call image display in this window */ if(sa->spacetype!=SPACE_SEQ) return; @@ -798,7 +801,7 @@ areawinset(sa->win); } } - + if(special_seq_update) { se = special_seq_update->curelem; if(se) { @@ -809,11 +812,11 @@ else ibuf= se->ibuf; } } - if(ibuf==NULL) + if(ibuf==NULL) return; if(ibuf->rect_float && ibuf->rect==NULL) IMB_rect_from_float(ibuf); - if(ibuf->rect==NULL) + if(ibuf->rect==NULL) return; if (sseq->mainb == SEQ_DRAW_IMG_WAVEFORM) { @@ -841,7 +844,7 @@ glPixelZoom(zoom, zoom); glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); - + glPixelZoom(1.0, 1.0); if (free_ibuf) { @@ -936,7 +939,7 @@ else if(last_seq->type==SEQ_SCENE) { se= (StripElem *)give_stripelem(last_seq, (G.scene->r.cfra)); if(se && last_seq->scene) { - sprintf(str, "Cur: %d First: %d Last: %d", last_seq->sfra+se->nr, last_seq->sfra, last_seq->sfra+last_seq->len-1); + sprintf(str, "Cur: %d First: %d Last: %d", last_seq->sfra+se->nr, last_seq->sfra, last_seq->sfra+last_seq->len-1); glRasterPos3f(xco, 0.3, 0.0); BMF_DrawString(G.font, str); } @@ -963,46 +966,46 @@ } void seq_viewmove(SpaceSeq *sseq) -{ +{ ScrArea *sa; short mval[2], mvalo[2]; short rectx, recty, xmin, xmax, ymin, ymax, pad; int oldcursor; Window *win; - + sa = sseq->area; rectx= (G.scene->r.size*G.scene->r.xsch)/100; recty= (G.scene->r.size*G.scene->r.ysch)/100; - + pad = 10; xmin = -(sa->winx/2) - rectx/2 + pad; xmax = sa->winx/2 + rectx/2 - pad; ymin = -(sa->winy/2) - recty/2 + pad; ymax = sa->winy/2 + recty/2 - pad; - + getmouseco_sc(mvalo); oldcursor=get_cursor(); win=winlay_get_active_window(); - + SetBlenderCursor(BC_NSEW_SCROLLCURSOR); - + while(get_mbut()&(L_MOUSE|M_MOUSE)) { - + getmouseco_sc(mval); - + if(mvalo[0]!=mval[0] || mvalo[1]!=mval[1]) { sseq->xof -= (mvalo[0]-mval[0]); sseq->yof -= (mvalo[1]-mval[1]); - + /* prevent dragging image outside of the window and losing it! */ CLAMP(sseq->xof, xmin, xmax); CLAMP(sseq->yof, ymin, ymax); - + mvalo[0]= mval[0]; mvalo[1]= mval[1]; - + scrarea_do_windraw(curarea); screen_swapbuffers(); } @@ -1076,7 +1079,7 @@ uiDefBut(block, LABEL, 0, "Type: Image", 10,140,150,20, 0, 0, 0, 0, 0, ""); uiDefBut(block, TEX, B_NOP, "Name: ", 10,120,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, ""); - + uiBlockBeginAlign(block); uiDefButBitS(block, TOG, SEQ_MAKE_PREMUL, SEQ_BUT_RELOAD, "Convert to Premul", 10,90,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Converts RGB values to become premultiplied with Alpha"); uiDefButBitS(block, TOG, SEQ_FILTERY, SEQ_BUT_RELOAD, "FilterY", 10,70,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "For video movies to remove fields"); @@ -1103,28 +1106,28 @@ uiDefBut(block, LABEL, 0, "Type: Movie", 10,140,150,20, 0, 0, 0, 0, 0, ""); uiDefBut(block, TEX, B_NOP, "Name: ", 10,120,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, ""); - + uiBlockBeginAlign(block); uiDefButBitS(block, TOG, SEQ_MAKE_PREMUL, SEQ_BUT_RELOAD, "Make Premul Alpha ", 10,90,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Converts RGB values to become premultiplied with Alpha"); uiDefButBitS(block, TOG, SEQ_FILTERY, SEQ_BUT_RELOAD, "FilterY ", 10,70,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "For video movies to remove fields"); uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Mul:", 10,50,150,19, &last_seq->mul, 0.001, 5.0, 100, 0, "Multiply colors"); - + uiDefButS(block, TOG|BIT|7, SEQ_BUT_RELOAD, "Reverse Frames", 10,30,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Reverse frame order"); uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Strobe:", 10,10,150,19, &last_seq->strobe, 1.0, 30.0, 100, 0, "Only display every nth frame"); uiDefButI(block, NUM, SEQ_BUT_RELOAD, "Preseek:", 10,-10,150,19, &last_seq->anim_preseek, 0.0, 50.0, 100, 0, "On MPEG-seeking preseek this many frames"); uiBlockEndAlign(block); } - else if(last_seq->type==SEQ_RAM_SOUND || + else if(last_seq->type==SEQ_RAM_SOUND || last_seq->type==SEQ_HD_SOUND) { uiDefBut(block, LABEL, 0, "Type: Audio", 10,140,150,20, 0, 0, 0, 0, 0, ""); uiDefBut(block, TEX, 0, "Name: ", 10,120,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, ""); - + uiBlockBeginAlign(block); uiDefButBitS(block, TOG, SEQ_IPO_FRAME_LOCKED, SEQ_BUT_RELOAD, "IPO Frame locked", - 10,90,150,19, &last_seq->flag, - 0.0, 1.0, 0, 0, + 10,90,150,19, &last_seq->flag, + 0.0, 1.0, 0, 0, "Lock the IPO coordinates to the " "global frame counter."); @@ -1136,19 +1139,33 @@ else if(last_seq->type>=SEQ_EFFECT) { uiDefBut(block, LABEL, 0, "Type: Effect", 10,140,150,20, 0, 0, 0, 0, 0, ""); uiDefBut(block, TEX, B_NOP, "Name: ", 10,120,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, ""); - + uiDefButBitS(block, TOG, SEQ_IPO_FRAME_LOCKED, SEQ_BUT_RELOAD, "IPO Frame locked", - 10,90,150,19, &last_seq->flag, - 0.0, 1.0, 0, 0, + 10,90,150,19, &last_seq->flag, + 0.0, 1.0, 0, 0, "Lock the IPO coordinates to the " "global frame counter."); - + uiBlockBeginAlign(block); - if(last_seq->type==SEQ_WIPE){ + + //PUSH SEQUENCE + if(last_seq->type==SEQ_PUSH){ + PushVars *push = (PushVars *)last_seq->effectdata; + char formatstring[256]; + strncpy(formatstring, "Transition Type %t|Left Push%x0|Right Push %x1|Top Push %x2|Bottom Push %x3|Hori Push %x4|Vert Push %x5", 255); + uiDefButS(block, MENU,SEQ_BUT_EFFECT, formatstring, 10,65,220,22, &push->pushtype, 0, 0, 0, 0, "What type of push should be performed"); + switch(push->pushtype){ + case DO_HORI_PUSH: + case DO_VERT_PUSH: + uiDefButS(block, NUM, SEQ_BUT_EFFECT, "Bands:", 10,15,220,22, &push->pushnb, 2, 100, 1, 2, "The Numbers of bands"); + break; + } + } + else if(last_seq->type==SEQ_WIPE){ WipeVars *wipe = (WipeVars *)last_seq->effectdata; char formatstring[256]; - + strncpy(formatstring, "Transition Type %t|Single Wipe%x0|Double Wipe %x1|Iris Wipe %x4|Clock Wipe %x5", 255); uiDefButS(block, MENU,SEQ_BUT_EFFECT, formatstring, 10,65,220,22, &wipe->wipetype, 0, 0, 0, 0, "What type of wipe should be performed"); uiDefButF(block, NUM,SEQ_BUT_EFFECT,"Blur:", 10,40,220,22, &wipe->edgeWidth,0.0,1.0, 1, 2, "The percent width of the blur edge"); @@ -1156,11 +1173,11 @@ case DO_IRIS_WIPE: case DO_CLOCK_WIPE: break; - + default: uiDefButF(block, NUM,SEQ_BUT_EFFECT,"Angle:", 10,15,220,22, &wipe->angle,-90.0,90.0, 1, 2, "The Angle of the Edge"); } - uiDefButS(block, TOG,SEQ_BUT_EFFECT,"Wipe In", 10,-10,220,22, &wipe->forward,0,0, 0, 0, "Controls Primary Direction of Wipe"); + uiDefButS(block, TOG,SEQ_BUT_EFFECT,"Wipe In", 10,-10,220,22, &wipe->forward,0,0, 0, 0, "Controls Primary Direction of Wipe"); } else if(last_seq->type==SEQ_GLOW){ GlowVars *glow = (GlowVars *)last_seq->effectdata; @@ -1179,7 +1196,7 @@ uiDefButF(block, NUM, SEQ_BUT_EFFECT, "xScale End:", 160,70,150,19, &transform->ScalexFin, 0.0, 10.0, 0, 0, "X Scale End"); uiDefButF(block, NUM, SEQ_BUT_EFFECT, "yScale Start:", 10,50,150,19, &transform->ScaleyIni, 0.0, 10.0, 0, 0, "Y Scale Start"); uiDefButF(block, NUM, SEQ_BUT_EFFECT, "yScale End:", 160,50,150,19, &transform->ScaleyFin, 0.0, 10.0, 0, 0, "Y Scale End"); - + uiDefButF(block, NUM, SEQ_BUT_EFFECT, "x Start:", 10,30,150,19, &transform->xIni, -1000.0, 1000.0, 0, 0, "X Position Start"); uiDefButF(block, NUM, SEQ_BUT_EFFECT, "x End:", 160,30,150,19, &transform->xFin, -1000.0, 1000.0, 0, 0, "X Position End"); @@ -1192,32 +1209,32 @@ SolidColorVars *colvars = (SolidColorVars *)last_seq->effectdata; uiDefButF(block, COL, SEQ_BUT_RELOAD, "",10,90,150,19, colvars->col, 0, 0, 0, 0, ""); } else if(last_seq->type==SEQ_SPEED){ - SpeedControlVars *sp = + SpeedControlVars *sp = (SpeedControlVars *)last_seq->effectdata; uiDefButF(block, NUM, SEQ_BUT_EFFECT, "Global Speed:", 10,70,150,19, &sp->globalSpeed, 0.0, 100.0, 0, 0, "Global Speed"); uiDefButBitI(block, TOG, SEQ_SPEED_INTEGRATE, - SEQ_BUT_EFFECT, + SEQ_BUT_EFFECT, "IPO is velocity", - 10,50,150,19, &sp->flags, - 0.0, 1.0, 0, 0, + 10,50,150,19, &sp->flags, + 0.0, 1.0, 0, 0, "Interpret the IPO value as a " "velocity instead of a frame number"); uiDefButBitI(block, TOG, SEQ_SPEED_BLEND, - SEQ_BUT_EFFECT, + SEQ_BUT_EFFECT, "Enable frame blending", - 10,30,150,19, &sp->flags, - 0.0, 1.0, 0, 0, + 10,30,150,19, &sp->flags, + 0.0, 1.0, 0, 0, "Blend two frames into the " "target for a smoother result"); uiDefButBitI(block, TOG, SEQ_SPEED_COMPRESS_IPO_Y, - SEQ_BUT_EFFECT, + SEQ_BUT_EFFECT, "IPO value runs from [0..1]", - 10,10,150,19, &sp->flags, - 0.0, 1.0, 0, 0, + 10,10,150,19, &sp->flags, + 0.0, 1.0, 0, 0, "Scale IPO value to get the " "target frame number."); } @@ -1292,10 +1309,10 @@ BIF_ThemeColorShade(TH_BACK, -20); glRectf(v2d->cur.xmin, 0.0, v2d->cur.xmax, 1.0); - + boundbox_seq(); calc_ipogrid(); - + i= MAX2(1, ((int)G.v2d->cur.ymin)-1); glBegin(GL_QUADS); @@ -1304,7 +1321,7 @@ BIF_ThemeColorShade(TH_BACK, -15); else BIF_ThemeColorShade(TH_BACK, -25); - + glVertex2f(v2d->cur.xmax, i); glVertex2f(v2d->cur.xmin, i); glVertex2f(v2d->cur.xmin, i+1); @@ -1312,7 +1329,7 @@ i+=1.0; } glEnd(); - + /* Force grid lines */ i= MAX2(1, ((int)G.v2d->cur.ymin)-1); glBegin(GL_LINES); @@ -1324,8 +1341,8 @@ i+=1.0; } glEnd(); - - + + draw_ipogrid(); draw_cfra_seq(); Index: source/blender/src/editseq.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/src/editseq.c,v retrieving revision 1.50 diff -u -r1.50 editseq.c --- source/blender/src/editseq.c 17 Nov 2006 17:50:43 -0000 1.50 +++ source/blender/src/editseq.c 7 Dec 2006 20:43:17 -0000 @@ -153,12 +153,12 @@ sh.free(last_seq); sh.init_plugin(last_seq, str); - last_seq->machine = MAX3(last_seq->seq1->machine, - last_seq->seq2->machine, + last_seq->machine = MAX3(last_seq->seq1->machine, + last_seq->seq2->machine, last_seq->seq3->machine); if( test_overlap_seq(last_seq) ) shuffle_seq(last_seq); - + BIF_undo_push("Load/change Sequencer plugin"); } @@ -214,21 +214,21 @@ ed= G.scene->ed; if(ed==0) return 0; - + pixelx = (v2d->cur.xmax - v2d->cur.xmin)/(v2d->mask.xmax - v2d->mask.xmin); getmouseco_areawin(mval); areamouseco_to_ipoco(G.v2d, mval, &x, &y); - + seq= ed->seqbasep->first; - + while(seq) { /* clamp handles to defined size in pixel space */ handsize = seq->handsize; minhandle = 7; maxhandle = 28; CLAMP(handsize, minhandle*pixelx, maxhandle*pixelx); - + if(seq->machine == (int)y) { /* check for both normal strips, and strips that have been flipped horizontally */ if( ((seq->startdisp < seq->enddisp) && (seq->startdisp<=x && seq->enddisp>=x)) || @@ -259,8 +259,8 @@ start = -5.0; end = 105.0; - /* Adjust IPO window to sequence and - avoid annoying snap-back to startframe + /* Adjust IPO window to sequence and + avoid annoying snap-back to startframe when Lock Time is on */ if (G.v2d->flag & V2D_VIEWLOCK) { if ((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) { @@ -373,7 +373,7 @@ seq->flag &= SEQ_DESEL; } END_SEQ - + BIF_undo_push("(De)select all Sequencer"); } @@ -446,12 +446,12 @@ if((G.qual & LR_SHIFTKEY) && (seq->flag & SELECT)) { if(hand==0) seq->flag &= SEQ_DESEL; else if(hand==1) { - if(seq->flag & SEQ_LEFTSEL) + if(seq->flag & SEQ_LEFTSEL) seq->flag &= ~SEQ_LEFTSEL; else seq->flag |= SEQ_LEFTSEL; } else if(hand==2) { - if(seq->flag & SEQ_RIGHTSEL) + if(seq->flag & SEQ_RIGHTSEL) seq->flag &= ~SEQ_RIGHTSEL; else seq->flag |= SEQ_RIGHTSEL; } @@ -491,7 +491,7 @@ seq->start= cfra; seq->machine= machine; seq->mul= 1.0; - + return seq; } @@ -530,7 +530,7 @@ } calc_sequence(seq); - + if(sfile->flag & FILE_STRINGCODE) { strcpy(name, sfile->dir); strcpy(rel, G.sce); @@ -600,7 +600,7 @@ seq->anim_preseek = IMB_anim_get_preseek(anim); calc_sequence(seq); - + if(sfile->flag & FILE_STRINGCODE) { strcpy(name, sfile->dir); strcpy(rel, G.sce); @@ -628,7 +628,7 @@ strncpy(last_imagename, seq->strip->dir, FILE_MAXDIR-1); } -static Sequence *sfile_to_ramsnd_sequence(SpaceFile *sfile, +static Sequence *sfile_to_ramsnd_sequence(SpaceFile *sfile, int cfra, int machine) { Sequence *seq; @@ -667,7 +667,7 @@ seq->sound = sound; calc_sequence(seq); - + if(sfile->flag & FILE_STRINGCODE) { strcpy(name, sfile->dir); strcpy(rel, G.sce); @@ -730,7 +730,7 @@ seq->hdaudio= hdaudio; calc_sequence(seq); - + if(sfile->flag & FILE_STRINGCODE) { strcpy(name, sfile->dir); strcpy(rel, G.sce); @@ -1047,20 +1047,21 @@ if(event==15) return SEQ_TRANSFORM; if(event==16) return SEQ_COLOR; if(event==17) return SEQ_SPEED; + if(event==18) return SEQ_PUSH; return 0; } static int seq_effect_find_selected(Editing *ed, Sequence *activeseq, int type, Sequence **selseq1, Sequence **selseq2, Sequence **selseq3) { Sequence *seq1= 0, *seq2= 0, *seq3= 0, *seq; - + if (!activeseq) seq2= get_last_seq(); for(seq=ed->seqbasep->first; seq; seq=seq->next) { if(seq->flag & SELECT) { if (seq->type == SEQ_RAM_SOUND - || seq->type == SEQ_HD_SOUND) { + || seq->type == SEQ_HD_SOUND) { error("Can't apply effects to " "audio sequence strips"); return 0; @@ -1076,7 +1077,7 @@ } } } - + /* make sequence selection a little bit more intuitive for 3 strips: the last-strip should be sequence3 */ if (seq3 != 0 && seq2 != 0) { @@ -1084,7 +1085,7 @@ seq2 = seq3; seq3 = tmp; } - + switch(get_sequence_effect_num_inputs(type)) { case 0: @@ -1176,7 +1177,7 @@ /* set find a free spot to but the strip */ if (newseq->seq1) { - newseq->machine= MAX3(newseq->seq1->machine, + newseq->machine= MAX3(newseq->seq1->machine, newseq->seq2->machine, newseq->seq3->machine); } @@ -1275,6 +1276,9 @@ case SEQ_SPEED: event = 17; break; + case SEQ_PUSH: + event = 18; + break; default: event = 0; break; @@ -1305,7 +1309,8 @@ "|Glow%x14" "|Transforms%x15" "|Color Generator%x16" - "|Speed Control%x17"); + "|Speed Control%x17" + "|Push%x18"); } if(event<1) return; @@ -1359,7 +1364,7 @@ seq->len= sce->r.efra - sce->r.sfra + 1; seq->strip= strip= MEM_callocN(sizeof(Strip), "strip"); - strncpy(seq->name + 2, sce->id.name + 2, + strncpy(seq->name + 2, sce->id.name + 2, sizeof(seq->name) - 2); strip->len= seq->len; strip->us= 1; @@ -1386,7 +1391,8 @@ case 15: case 16: case 17: - if(get_last_seq()==0 && + case 18: + if(get_last_seq()==0 && get_sequence_effect_num_inputs( event_to_efftype(event))> 0) error("Need at least one active sequence strip"); else if(event==10) @@ -1432,7 +1438,8 @@ "|Glow%x14" "|Transform%x15" "|Color Generator%x16" - "|Speed Control%x17"); + "|Speed Control%x17" + "|Push%x18"); if(event > 0) { if(event==1) { SWAP(Sequence *,last_seq->seq1,last_seq->seq2); @@ -1442,10 +1449,10 @@ } else if(event==11) { activate_fileselect( - FILE_SPECIAL, "Select Plugin", + FILE_SPECIAL, "Select Plugin", U.plugseqdir, change_plugin_seq); } - else if(event==12); + else if(event==12); /* recalculate: only new_stripdata */ else { /* free previous effect and init new effect */ @@ -1460,10 +1467,10 @@ } else { sh = get_sequence_effect(last_seq); sh.free(last_seq); - - last_seq->type + + last_seq->type = event_to_efftype(event); - + sh = get_sequence_effect(last_seq); sh.init(last_seq); } @@ -1476,9 +1483,9 @@ } else if(last_seq->type == SEQ_IMAGE) { if(okee("Change images")) { - activate_fileselect(FILE_SPECIAL, - "Select Images", - last_imagename, + activate_fileselect(FILE_SPECIAL, + "Select Images", + last_imagename, reload_image_strip); } } @@ -1518,7 +1525,7 @@ error("Can't reassign inputs: no cycles allowed"); return; } - + last_seq->seq1 = seq1; last_seq->seq2 = seq2; last_seq->seq3 = seq3; @@ -1576,7 +1583,7 @@ while(seq) { seqn= seq->next; if((seq->flag & flag) || deleteall) { - if(seq->type==SEQ_RAM_SOUND && seq->sound) + if(seq->type==SEQ_RAM_SOUND && seq->sound) seq->sound->id.us--; BLI_remlink(lb, seq); @@ -1779,7 +1786,7 @@ if(seq->len>0) seq->strip->stripdata= MEM_callocN(seq->len*sizeof(StripElem), "stripelem"); seq->flag &= SEQ_DESEL; - + seqn->flag &= ~(SEQ_LEFTSEL+SEQ_RIGHTSEL); } @@ -1915,7 +1922,7 @@ Sequence *seq, *seqm, *next; Editing *ed; int tot; - + ed= G.scene->ed; if(ed==0) return; @@ -1925,9 +1932,9 @@ while(seq) { if(seq->flag & SELECT) { tot++; - if (seq->type == SEQ_RAM_SOUND) { - error("Can't make Meta Strip from audio"); - return; + if (seq->type == SEQ_RAM_SOUND) { + error("Can't make Meta Strip from audio"); + return; } } seq= seq->next; @@ -1941,7 +1948,7 @@ while(seq) { if(seq->flag & SELECT) { if(seq->type & SEQ_EFFECT) { - if(seq->seq1 && + if(seq->seq1 && (seq->seq1->flag & SELECT)==0) tot= 0; if(seq->seq2 && (seq->seq2->flag & SELECT)==0) tot= 0; @@ -2381,10 +2388,10 @@ TransSeq *ts, *transmain; int tot=0; ListBase newlist; - + ed= G.scene->ed; if(ed==0) return; - + /* test for validity */ for(seq= ed->seqbasep->first; seq; seq= seq->next) { if(seq->flag & SELECT) { @@ -2396,7 +2403,7 @@ error("Cannot cut Meta strips"); return; } - + /* we build an array of TransSeq, to denote which strips take part in cutting */ for(seq= ed->seqbasep->first; seq; seq= seq->next) { if(seq->flag & SELECT) { @@ -2406,17 +2413,17 @@ seq->flag &= ~SELECT; // bad code, but we need it for recurs_dupli_seq... note that this ~SELECT assumption is used in loops below too (ton) } } - + if(tot==0) { error("No strips to cut"); return; } - + ts=transmain= MEM_callocN(tot*sizeof(TransSeq), "transseq"); - + for(seq= ed->seqbasep->first; seq; seq= seq->next) { if(seq->flag & SELECT) { - + ts->start= seq->start; ts->machine= seq->machine; ts->startstill= seq->startstill; @@ -2426,14 +2433,14 @@ ts->startofs= seq->startofs; ts->endofs= seq->endofs; ts->len= seq->len; - + ts++; } } - + for(seq= ed->seqbasep->first; seq; seq= seq->next) { if(seq->flag & SELECT) { - + /* strips with extended stillframes before */ if ((seq->startstill) && (cutframe start)) { seq->start= cutframe -1; @@ -2441,29 +2448,29 @@ seq->len= 1; seq->endstill= 0; } - + /* normal strip */ else if ((cutframe >=seq->start)&&(cutframe <=(seq->start+seq->len))) { seq->endofs = (seq->start+seq->len) - cutframe; } - + /* strips with extended stillframes after */ else if (((seq->start+seq->len) < cutframe) && (seq->endstill)) { seq->endstill -= seq->enddisp - cutframe; } - + calc_sequence(seq); } } - + newlist.first= newlist.last= NULL; - + /* now we duplicate the cut strip and move it into place afterwards */ recurs_dupli_seq(ed->seqbasep, &newlist); addlisttolist(ed->seqbasep, &newlist); - + ts= transmain; - + /* go through all the strips and correct them based on their stored values */ for(seq= ed->seqbasep->first; seq; seq= seq->next) { if(seq->flag & SELECT) { @@ -2475,15 +2482,15 @@ seq->len = ts->len; seq->endstill = ts->endstill; } - + /* normal strip */ else if ((cutframe>=seq->start)&&(cutframe<=(seq->start+seq->len))) { seq->startstill = 0; seq->startofs = cutframe - ts->start; seq->endofs = ts->endofs; seq->endstill = ts->endstill; - } - + } + /* strips with extended stillframes after */ else if (((seq->start+seq->len) < cutframe) && (seq->endstill)) { seq->start = cutframe - ts->len +1; @@ -2492,15 +2499,15 @@ seq->startstill = 0; } calc_sequence(seq); - + ts++; } } - - /* as last: */ + + /* as last: */ sort_seq(); MEM_freeN(transmain); - + allqueue(REDRAWSEQ, 0); } Index: source/blender/src/header_seq.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/src/header_seq.c,v retrieving revision 1.33 diff -u -r1.33 header_seq.c --- source/blender/src/header_seq.c 16 Nov 2006 21:40:30 -0000 1.33 +++ source/blender/src/header_seq.c 7 Dec 2006 20:43:17 -0000 @@ -129,7 +129,7 @@ /* Lock Time */ uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Lock Time to Other Windows|", 0, yco-=20, + "Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); /* Draw time or frames.*/ @@ -241,6 +241,9 @@ case 13: add_sequence(SEQ_SPEED); break; + case 14: + add_sequence(SEQ_PUSH); + break; } } @@ -265,6 +268,7 @@ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Color Generator", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Speed Control", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Push", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Plugin...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); @@ -325,7 +329,7 @@ #ifdef WITH_FFMPEG uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Movie + Audio (HD)", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); #endif - + if(curarea->headertype==HEADERTOP) { uiBlockSetDirection(block, UI_DOWN); } @@ -399,16 +403,16 @@ block= uiNewBlock(&curarea->uiblocks, "seq_editmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); uiBlockSetButmFunc(block, do_seq_editmenu, NULL); - + uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Strip Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap to Current Frame|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cut at Current Frame|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); @@ -443,7 +447,7 @@ uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Enter/Exit Meta Strip|Tab", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); } } - + if(curarea->headertype==HEADERTOP) { uiBlockSetDirection(block, UI_DOWN); @@ -463,10 +467,10 @@ { Editing *ed; SpaceSeq *sseq= curarea->spacedata.first; - + ed= G.scene->ed; if(ed==0) return; - + switch(event) { case B_SEQHOME: if(sseq->mainb) @@ -546,18 +550,18 @@ } /* IMAGE */ - uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_SEQ_SEQUENCER, - "Image Preview: %t" + uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_SEQ_SEQUENCER, + "Image Preview: %t" "|Sequence %x0" "|Image Preview %x1" "|Luma Waveform %x2" "|Chroma Vectorscope %x3", - xco,0,XIC+10,YIC, &sseq->mainb, 0.0, 3.0, - 0, 0, + xco,0,XIC+10,YIC, &sseq->mainb, 0.0, 3.0, + 0, 0, "Shows the sequence output image preview"); - + xco+= 8 + XIC+10; - + /* CHANNEL shown in 3D preview */ if(sseq->mainb) { int minchan = 0; @@ -569,11 +573,11 @@ xco, 0, 3.5 * XIC,YIC, &sseq->chanshown, minchan, MAXSEQ, 0, 0, "The channel number shown in the image preview. 0 is the result of all strips combined."); - + xco+= 8 + XIC*3.5; } - + /* ZOOM and BORDER */ xco+= 8; uiBlockBeginAlign(block); Index: source/blender/src/seqeffects.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/src/seqeffects.c,v retrieving revision 1.11 diff -u -r1.11 seqeffects.c --- source/blender/src/seqeffects.c 4 Dec 2006 20:00:17 -0000 1.11 +++ source/blender/src/seqeffects.c 7 Dec 2006 20:43:18 -0000 @@ -138,8 +138,8 @@ if (alloc_private) { pis->instance_private_data = alloc_private(); } - - pis->current_private_data = (void**) + + pis->current_private_data = (void**) PIL_dynlib_find_symbol( pis->handle, "plugin_private_data"); } @@ -199,7 +199,7 @@ seq->plugin= (PluginSeq *)add_plugin_seq(fname, seq->name+2); } -/* +/* * FIXME: should query plugin! Could be generator, that needs zero inputs... */ static int num_inputs_plugin() @@ -223,8 +223,8 @@ } static void do_plugin_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3, struct ImBuf *out) { char *cp; @@ -234,7 +234,7 @@ with imbuf-internals */ if(seq->plugin && seq->plugin->doit) { - if(seq->plugin->cfra) + if(seq->plugin->cfra) *(seq->plugin->cfra)= frame_to_float(cfra); cp = PIL_dynlib_find_symbol( @@ -243,7 +243,7 @@ if(cp) strncpy(cp, seq->name+2, 22); if (seq->plugin->current_private_data) { - *seq->plugin->current_private_data + *seq->plugin->current_private_data = seq->plugin->instance_private_data; } @@ -263,13 +263,13 @@ IMB_rect_from_float(ibuf2); imb_freerectfloatImBuf(ibuf2); ibuf2->flags &= ~IB_rectfloat; - } + } if (ibuf3) { ibuf3 = IMB_dupImBuf(ibuf3); IMB_rect_from_float(ibuf3); imb_freerectfloatImBuf(ibuf3); ibuf3->flags &= ~IB_rectfloat; - } + } if (!out->rect) imb_addrectImBuf(out); imb_freerectfloatImBuf(out); out->flags &= ~IB_rectfloat; @@ -330,7 +330,7 @@ seq->seq1= seq2; } -static void do_alphaover_effect_byte(float facf0, float facf1, int x, int y, +static void do_alphaover_effect_byte(float facf0, float facf1, int x, int y, char * rect1, char *rect2, char *out) { int fac2, mfac, fac, fac4; @@ -396,7 +396,7 @@ } } -static void do_alphaover_effect_float(float facf0, float facf1, int x, int y, +static void do_alphaover_effect_float(float facf0, float facf1, int x, int y, float * rect1, float *rect2, float *out) { float fac2, mfac, fac, fac4; @@ -459,8 +459,8 @@ } static void do_alphaover_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3, struct ImBuf *out) { if (out->rect_float) { @@ -482,7 +482,7 @@ ********************************************************************** */ void do_alphaunder_effect_byte( - float facf0, float facf1, int x, int y, char *rect1, + float facf0, float facf1, int x, int y, char *rect1, char *rect2, char *out) { int fac2, mfac, fac, fac4; @@ -550,8 +550,8 @@ } -static void do_alphaunder_effect_float(float facf0, float facf1, int x, int y, - float *rect1, float *rect2, +static void do_alphaunder_effect_float(float facf0, float facf1, int x, int y, + float *rect1, float *rect2, float *out) { float fac2, mfac, fac, fac4; @@ -604,7 +604,7 @@ if(rt2[3]<=0 && fac4 >= 1.0) { memcpy(rt, rt1, 4 * sizeof(float)); - + } else if(rt2[3]>=1.0) { memcpy(rt, rt2, 4 * sizeof(float)); } else { @@ -626,8 +626,8 @@ } static void do_alphaunder_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3, struct ImBuf *out) { if (out->rect_float) { @@ -648,8 +648,8 @@ CROSS ********************************************************************** */ -void do_cross_effect_byte(float facf0, float facf1, int x, int y, - char *rect1, char *rect2, +void do_cross_effect_byte(float facf0, float facf1, int x, int y, + char *rect1, char *rect2, char *out) { int fac1, fac2, fac3, fac4; @@ -696,7 +696,7 @@ } } -void do_cross_effect_float(float facf0, float facf1, int x, int y, +void do_cross_effect_float(float facf0, float facf1, int x, int y, float *rect1, float *rect2, float *out) { float fac1, fac2, fac3, fac4; @@ -746,8 +746,8 @@ /* carefull: also used by speed effect! */ static void do_cross_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3, struct ImBuf *out) { if (out->rect_float) { @@ -793,9 +793,9 @@ valid_gamma = gamma; valid_inv_gamma = 1.0 / gamma; colour_step = 1.0 / RE_GAMMA_TABLE_SIZE; - inv_colour_step = (float) RE_GAMMA_TABLE_SIZE; + inv_colour_step = (float) RE_GAMMA_TABLE_SIZE; - /* We could squeeze out the two range tables to gain some memory. */ + /* We could squeeze out the two range tables to gain some memory. */ for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++) { colour_domain_table[i] = i * colour_step; gamma_range_table[i] = pow(colour_domain_table[i], @@ -828,7 +828,7 @@ { int i; float res = 0.0; - + i = floor(c * inv_colour_step); /* Clip to range [0,1]: outside, just do the complete calculation. */ /* We may have some performance problems here. Stretching up the LUT */ @@ -836,9 +836,9 @@ /* Negative colours are explicitly handled. */ if (i < 0) res = -pow(abs(c), valid_gamma); else if (i >= RE_GAMMA_TABLE_SIZE ) res = pow(c, valid_gamma); - else res = gamma_range_table[i] + - ( (c - colour_domain_table[i]) * gamfactor_table[i]); - + else res = gamma_range_table[i] + + ( (c - colour_domain_table[i]) * gamfactor_table[i]); + return res; } /* end of float gammaCorrect(float col) */ @@ -853,9 +853,9 @@ /* Negative colours are explicitly handled. */ if (i < 0) res = -pow(abs(col), valid_inv_gamma); else if (i >= RE_GAMMA_TABLE_SIZE) res = pow(col, valid_inv_gamma); - else res = inv_gamma_range_table[i] + + else res = inv_gamma_range_table[i] + ( (col - colour_domain_table[i]) * inv_gamfactor_table[i]); - + return res; } /* end of float invGammaCorrect(float col) */ @@ -864,7 +864,7 @@ { float val, igamma= 1.0f/gamma; int a; - + gamtab= MEM_mallocN(65536*sizeof(short), "initGaus2"); igamtab1= MEM_mallocN(256*sizeof(short), "initGaus2"); @@ -872,10 +872,10 @@ for(a=0; a<65536; a++) { val= a; val/= 65535.0; - + if(gamma==2.0) val= sqrt(val); else if(gamma!=1.0) val= pow(val, igamma); - + gamtab[a]= (65535.99*val); } /* inverse gamtab1 : in byte, out short */ @@ -922,16 +922,16 @@ } } -static void do_gammacross_effect_byte(float facf0, float facf1, - int x, int y, - char *rect1, - char *rect2, +static void do_gammacross_effect_byte(float facf0, float facf1, + int x, int y, + char *rect1, + char *rect2, char *out) { int fac1, fac2, col; int xo; char *rt1, *rt2, *rt; - + xo= x; rt1= (char *)rect1; rt2= (char *)rect2; @@ -978,9 +978,9 @@ } -static void do_gammacross_effect_float(float facf0, float facf1, - int x, int y, - float *rect1, float *rect2, +static void do_gammacross_effect_float(float facf0, float facf1, + int x, int y, + float *rect1, float *rect2, float *out) { float fac1, fac2, col; @@ -1001,7 +1001,7 @@ while(x--) { *rt= gammaCorrect( - fac1 * invGammaCorrect(*rt1) + fac1 * invGammaCorrect(*rt1) + fac2 * invGammaCorrect(*rt2)); rt1++; rt2++; rt++; } @@ -1013,7 +1013,7 @@ while(x--) { col= gammaCorrect( - fac1*invGammaCorrect(*rt1) + fac1*invGammaCorrect(*rt1) + fac2*invGammaCorrect(*rt2)); rt1++; rt2++; rt++; @@ -1022,8 +1022,8 @@ } static void do_gammacross_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3, struct ImBuf *out) { if (out->rect_float) { @@ -1044,8 +1044,8 @@ ADD ********************************************************************** */ -static void do_add_effect_byte(float facf0, float facf1, int x, int y, - unsigned char *rect1, unsigned char *rect2, +static void do_add_effect_byte(float facf0, float facf1, int x, int y, + unsigned char *rect1, unsigned char *rect2, unsigned char *out) { int col, xo, fac1, fac3; @@ -1096,8 +1096,8 @@ } } -static void do_add_effect_float(float facf0, float facf1, int x, int y, - float *rect1, float *rect2, +static void do_add_effect_float(float facf0, float facf1, int x, int y, + float *rect1, float *rect2, float *out) { int xo; @@ -1134,8 +1134,8 @@ } static void do_add_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3, struct ImBuf *out) { if (out->rect_float) { @@ -1156,8 +1156,8 @@ SUB ********************************************************************** */ -static void do_sub_effect_byte(float facf0, float facf1, - int x, int y, +static void do_sub_effect_byte(float facf0, float facf1, + int x, int y, char *rect1, char *rect2, char *out) { int col, xo, fac1, fac3; @@ -1208,8 +1208,8 @@ } } -static void do_sub_effect_float(float facf0, float facf1, int x, int y, - float *rect1, float *rect2, +static void do_sub_effect_float(float facf0, float facf1, int x, int y, + float *rect1, float *rect2, float *out) { int xo; @@ -1246,8 +1246,8 @@ } static void do_sub_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3, struct ImBuf *out) { if (out->rect_float) { @@ -1271,8 +1271,8 @@ #define XOFF 8 #define YOFF 8 -static void do_drop_effect_byte(float facf0, float facf1, int x, int y, - unsigned char *rect2i, unsigned char *rect1i, +static void do_drop_effect_byte(float facf0, float facf1, int x, int y, + unsigned char *rect2i, unsigned char *rect1i, unsigned char *outi) { int height, width, temp, fac, fac1, fac2; @@ -1311,8 +1311,8 @@ memcpy(out, rt1, sizeof(int)*YOFF*width); } -static void do_drop_effect_float(float facf0, float facf1, int x, int y, - float *rect2i, float *rect1i, +static void do_drop_effect_float(float facf0, float facf1, int x, int y, + float *rect2i, float *rect1i, float *outi) { int height, width; @@ -1354,8 +1354,8 @@ static void do_drop_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf * ibuf3, struct ImBuf *out) { @@ -1376,8 +1376,8 @@ MUL ********************************************************************** */ -static void do_mul_effect_byte(float facf0, float facf1, int x, int y, - unsigned char *rect1, unsigned char *rect2, +static void do_mul_effect_byte(float facf0, float facf1, int x, int y, + unsigned char *rect1, unsigned char *rect2, unsigned char *out) { int xo, fac1, fac3; @@ -1425,8 +1425,8 @@ } } -static void do_mul_effect_float(float facf0, float facf1, int x, int y, - float *rect1, float *rect2, +static void do_mul_effect_float(float facf0, float facf1, int x, int y, + float *rect1, float *rect2, float *out) { int xo; @@ -1475,8 +1475,8 @@ } static void do_mul_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3, struct ImBuf *out) { if (out->rect_float) { @@ -1493,12 +1493,551 @@ } /* ********************************************************************** + PUSH + ********************************************************************** */ + +static void init_push_effect(Sequence *seq) +{ + if(seq->effectdata)MEM_freeN(seq->effectdata); + seq->effectdata = MEM_callocN(sizeof(struct PushVars), "pushvars"); +} + +static int num_inputs_push() +{ + return 1; +} + +static void free_push_effect(Sequence *seq) +{ + if(seq->effectdata)MEM_freeN(seq->effectdata); + seq->effectdata = 0; +} + +static void copy_push_effect(Sequence *dst, Sequence *src) +{ + dst->effectdata = MEM_dupallocN(src->effectdata); +} + + +static void do_push_effect_byte(Sequence *seq, float facf0, float facf1, + int x, int y, + unsigned char *rect1, + unsigned char *rect2, unsigned char *out) +{ + int xo, yo, position, position2, offset, offset2, line, nb, size; + char *rt1, *rt2, *rt3, *rt4, *rt; + rt = (char *)out; + xo = x; + yo = y; + + PushVars *push = (PushVars *)seq->effectdata; + nb = push->pushnb; + switch (push->pushtype) { + + case DO_LEFT_PUSH: + position = (int)(facf0 * xo); + offset = (xo - position) * 4; + for (y=0; yeffectdata; + nb = push->pushnb; + switch (push->pushtype) { + + case DO_LEFT_PUSH: + position = facf0 * xo; + offset = (xo - position) * 4; + for (y=0; yrect_float) { + do_push_effect_float(seq, + facf0, facf1, x, y, + ibuf1->rect_float, ibuf2->rect_float, + out->rect_float); + } else { + do_push_effect_byte(seq, + facf0, facf1, x, y, + (char*) ibuf1->rect, (char*) ibuf2->rect, + (char*) out->rect); + } +} + +/* ********************************************************************** WIPE ********************************************************************** */ // This function calculates the blur band for the wipe effects static float in_band(float width,float dist, float perc,int side,int dir){ - + float t1,t2,alpha,percwidth; if(width == 0) return (float)side; @@ -1506,29 +2045,29 @@ percwidth = width * perc; else percwidth = width * (1 - perc); - + if(width < dist) return side; - + t1 = dist / width; //percentange of width that is t2 = 1 / width; //amount of alpha per % point - + if(side == 1) alpha = (t1*t2*100) + (1-perc); // add point's alpha contrib to current position in wipe else alpha = (1-perc) - (t1*t2*100); - + if(dir == 0) alpha = 1-alpha; return alpha; } -static float check_zone(int x, int y, int xo, int yo, - Sequence *seq, float facf0) +static float check_zone(int x, int y, int xo, int yo, + Sequence *seq, float facf0) { float posx, posy,hyp,hyp2,angle,hwidth,b1,b2,b3,pointdist; /*some future stuff - float hyp3,hyp4,b4,b5 + float hyp3,hyp4,b4,b5 */ float temp1,temp2,temp3,temp4; //some placeholder variables float halfx = xo/2; @@ -1555,8 +2094,8 @@ switch (wipe->wipetype) { case DO_SINGLE_WIPE: width = (int)(wipe->edgeWidth*((xo+yo)/2.0)); - hwidth = (float)width/2.0; - + hwidth = (float)width/2.0; + if (angle == 0.0)angle = 0.000001; b1 = posy - (-angle)*posx; b2 = y - (-angle)*x; @@ -1566,26 +2105,26 @@ b1 = b2; b2 = temp1; } - if(wipe->forward){ + if(wipe->forward){ if(b1 < b2) output = in_band(width,hyp,facf0,1,1); else output = in_band(width,hyp,facf0,0,1); } - else{ + else{ if(b1 < b2) output = in_band(width,hyp,facf0,0,1); else output = in_band(width,hyp,facf0,1,1); } break; - - + + case DO_DOUBLE_WIPE: if(!wipe->forward)facf0 = 1-facf0; // Go the other direction width = (int)(wipe->edgeWidth*((xo+yo)/2.0)); // calculate the blur width - hwidth = (float)width/2.0; + hwidth = (float)width/2.0; if (angle == 0)angle = 0.000001; b1 = posy/2 - (-angle)*posx/2; b3 = (yo-posy/2) - (-angle)*(xo-posx/2); @@ -1593,7 +2132,7 @@ hyp = abs(angle*x+y+(-posy/2-angle*posx/2))/sqrt(angle*angle+1); hyp2 = abs(angle*x+y+(-(yo-posy/2)-angle*(xo-posx/2)))/sqrt(angle*angle+1); - + temp1 = xo*(1-facf0/2)-xo*facf0/2; temp2 = yo*(1-facf0/2)-yo*facf0/2; pointdist = sqrt(temp1*temp1 + temp2*temp2); @@ -1604,8 +2143,8 @@ } else if(b2 > b1 && b2 > b3 ){ if(hwidth < pointdist) - output = in_band(hwidth,hyp2,facf0,0,1); - } + output = in_band(hwidth,hyp2,facf0,0,1); + } else{ if( hyp < hwidth && hyp2 > hwidth ) output = in_band(hwidth,hyp,facf0,1,1); @@ -1615,7 +2154,7 @@ output = in_band(hwidth,hyp2,facf0,1,1) * in_band(hwidth,hyp,facf0,1,1); } if(!wipe->forward)output = 1-output; - break; + break; case DO_CLOCK_WIPE: /* temp1: angle of effect center in rads @@ -1626,11 +2165,11 @@ output = 1-facf0; widthf = wipe->edgeWidth*2*3.14159; temp1 = 2 * 3.14159 * facf0; - + if(wipe->forward){ temp1 = 2*3.14159-temp1; } - + x = x - halfx; y = y - halfy; @@ -1641,7 +2180,7 @@ temp2 += 3.14159; else if(x >= 0 && y <= 0) temp2 = 2*3.14159 - temp2; - + if(wipe->forward){ temp3 = temp1-(widthf/2)*facf0; temp4 = temp1+(widthf/2)*(1-facf0); @@ -1652,8 +2191,8 @@ } if (temp3 < 0) temp3 = 0; if (temp4 > 2*3.14159) temp4 = 2*3.14159; - - + + if(temp2 < temp3) output = 0; else if (temp2 > temp4) @@ -1671,11 +2210,11 @@ /* BOX WIPE IS NOT WORKING YET */ /* case DO_CROSS_WIPE: */ /* BOX WIPE IS NOT WORKING YET */ - /* case DO_BOX_WIPE: + /* case DO_BOX_WIPE: if(invert)facf0 = 1-facf0; width = (int)(wipe->edgeWidth*((xo+yo)/2.0)); - hwidth = (float)width/2.0; + hwidth = (float)width/2.0; if (angle == 0)angle = 0.000001; b1 = posy/2 - (-angle)*posx/2; b3 = (yo-posy/2) - (-angle)*(xo-posx/2); @@ -1683,7 +2222,7 @@ hyp = abs(angle*x+y+(-posy/2-angle*posx/2))/sqrt(angle*angle+1); hyp2 = abs(angle*x+y+(-(yo-posy/2)-angle*(xo-posx/2)))/sqrt(angle*angle+1); - + temp1 = xo*(1-facf0/2)-xo*facf0/2; temp2 = yo*(1-facf0/2)-yo*facf0/2; pointdist = sqrt(temp1*temp1 + temp2*temp2); @@ -1694,8 +2233,8 @@ } else if(b2 > b1 && b2 > b3 ){ if(hwidth < pointdist) - output = in_band(hwidth,hyp2,facf0,0,1); - } + output = in_band(hwidth,hyp2,facf0,0,1); + } else{ if( hyp < hwidth && hyp2 > hwidth ) output = in_band(hwidth,hyp,facf0,1,1); @@ -1712,15 +2251,15 @@ hyp = abs(angle*x+y+(-posy/2-angle*posx/2))/sqrt(angle*angle+1); hyp2 = abs(angle*x+y+(-(yo-posy/2)-angle*(xo-posx/2)))/sqrt(angle*angle+1); - + if(b2 < b1 && b2 < b3 ){ if(hwidth < pointdist) output *= in_band(hwidth,hyp,facf0,0,1); } else if(b2 > b1 && b2 > b3 ){ if(hwidth < pointdist) - output *= in_band(hwidth,hyp2,facf0,0,1); - } + output *= in_band(hwidth,hyp2,facf0,0,1); + } else{ if( hyp < hwidth && hyp2 > hwidth ) output *= in_band(hwidth,hyp,facf0,1,1); @@ -1729,30 +2268,30 @@ else output *= in_band(hwidth,hyp2,facf0,1,1) * in_band(hwidth,hyp,facf0,1,1); } - + break;*/ case DO_IRIS_WIPE: if(xo > yo) yo = xo; else xo = yo; - + if(!wipe->forward) facf0 = 1-facf0; width = (int)(wipe->edgeWidth*((xo+yo)/2.0)); - hwidth = (float)width/2.0; - - temp1 = (halfx-(halfx)*facf0); + hwidth = (float)width/2.0; + + temp1 = (halfx-(halfx)*facf0); pointdist = sqrt(temp1*temp1 + temp1*temp1); - + temp2 = sqrt((halfx-x)*(halfx-x) + (halfy-y)*(halfy-y)); if(temp2 > pointdist) output = in_band(hwidth,fabs(temp2-pointdist),facf0,0,1); else output = in_band(hwidth,fabs(temp2-pointdist),facf0,1,1); - + if(!wipe->forward) output = 1-output; - + break; } if (output < 0) output = 0; @@ -1782,9 +2321,9 @@ dst->effectdata = MEM_dupallocN(src->effectdata); } -static void do_wipe_effect_byte(Sequence *seq, float facf0, float facf1, - int x, int y, - unsigned char *rect1, +static void do_wipe_effect_byte(Sequence *seq, float facf0, float facf1, + int x, int y, + unsigned char *rect1, unsigned char *rect2, unsigned char *out) { int xo, yo; @@ -1835,9 +2374,9 @@ } } -static void do_wipe_effect_float(Sequence *seq, float facf0, float facf1, - int x, int y, - float *rect1, +static void do_wipe_effect_float(Sequence *seq, float facf0, float facf1, + int x, int y, + float *rect1, float *rect2, float *out) { int xo, yo; @@ -1889,8 +2428,8 @@ } static void do_wipe_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3, struct ImBuf *out) { if (out->rect_float) { @@ -1920,15 +2459,15 @@ scale->ScaleyIni = 1; scale->ScalexFin = 1; scale->ScaleyFin = 1; - + scale->xIni=0; scale->xFin=0; scale->yIni=0; scale->yFin=0; - + scale->rotIni=0; scale->rotFin=0; - + } static int num_inputs_transform() @@ -1963,24 +2502,24 @@ /* sample area entirely outside image? */ if(x2<0 || x1>in->x-1 || y2<0 || y1>in->y-1) return; - + /* sample including outside of edges of image */ if(x1<0 || y1<0) row1= empty; else row1= in->rect_float + in->x * y1 * 4 + 4*x1; - + if(x1<0 || y2>in->y-1) row2= empty; else row2= in->rect_float + in->x * y2 * 4 + 4*x1; - + if(x2>in->x-1 || y1<0) row3= empty; else row3= in->rect_float + in->x * y1 * 4 + 4*x2; - + if(x2>in->x-1 || y2>in->y-1) row4= empty; else row4= in->rect_float + in->x * y2 * 4 + 4*x2; - + a= u-floor(u); b= v-floor(v); a_b= a*b; ma_b= (1.0f-a)*b; a_mb= a*(1.0f-b); ma_mb= (1.0f-a)*(1.0f-b); - + out[0]= ma_mb*row1[0] + a_mb*row3[0] + ma_b*row2[0]+ a_b*row4[0]; out[1]= ma_mb*row1[1] + a_mb*row3[1] + ma_b*row2[1]+ a_b*row4[1]; out[2]= ma_mb*row1[2] + a_mb*row3[2] + ma_b*row2[2]+ a_b*row4[2]; @@ -1988,13 +2527,13 @@ } -static void do_transform_effect_float(Sequence * seq,float facf0, int x, int y, +static void do_transform_effect_float(Sequence * seq,float facf0, int x, int y, struct ImBuf *ibuf1,float *out) { int xo, yo, xi, yi; float xs,ys,factxScale,factyScale,tx,ty,rad,s,c,xaux,yaux,factRot,px,py; TransformVars *scale; - + scale = (TransformVars *)seq->effectdata; xo = x; yo = y; @@ -2033,11 +2572,11 @@ /*interpolate*/ bilinear_interpolation_transform_float(ibuf1,out, xs,ys); - + out+=4; } - } - + } + } /* function assumes out to be zero'ed, only does RGBA */ @@ -2060,7 +2599,7 @@ /* sample area entirely outside image? */ if(x2<0 || x1>x-1 || y2<0 || y1>y-1) return; - + /* sample including outside of edges of image */ if(x1<0 || y1<0){ row1R = 0; @@ -2068,69 +2607,69 @@ row1B = 0; row1A = 0; } - else{ + else{ row1R= in[x * y1 * 4 + 4 * x1]; row1G= in[x * y1 * 4 + 4 * x1 + 1]; row1B= in[x * y1 * 4 + 4 * x1 + 2]; row1A= in[x * y1 * 4 + 4 * x1 + 3]; } - + if(x1<0 || y2>y-1){ row2R = 0; row2G = 0; row2B = 0; row2A = 0; } - else{ + else{ row2R= in[x * y2 * 4 + 4 * x1]; row2G= in[x * y2 * 4 + 4 * x1 + 1]; row2B= in[x * y2 * 4 + 4 * x1 + 2]; row2A= in[x * y2 * 4 + 4 * x1 + 3]; } - + if(x2>x-1 || y1<0){ row3R = 0; row3G = 0; row3B = 0; row3A = 0; } - else{ + else{ row3R= in[x * y1 * 4 + 4 * x2]; row3G= in[x * y1 * 4 + 4 * x2 + 1]; row3B= in[x * y1 * 4 + 4 * x2 + 2]; row3A= in[x * y1 * 4 + 4 * x2 + 3]; } - + if(x2>x-1 || y2>y-1){ row4R = 0; row4G = 0; row4B = 0; row4A = 0; } - else{ + else{ row4R= in[x * y2 * 4 + 4 * x2]; row4G= in[x * y2 * 4 + 4 * x2 + 1]; row4B= in[x * y2 * 4 + 4 * x2 + 2]; row4A= in[x * y2 * 4 + 4 * x2 + 3]; } - + a= u-floor(u); b= v-floor(v); a_b= a*b; ma_b= (1-a)*b; a_mb= a*(1-b); ma_mb= (1-a)*(1-b); - + out[0]= (int)(ma_mb*row1R + a_mb*row3R + ma_b*row2R + a_b*row4R); out[1]= (int)(ma_mb*row1G + a_mb*row3G + ma_b*row2G + a_b*row4G); out[2]= (int)(ma_mb*row1B + a_mb*row3B + ma_b*row2B + a_b*row4B); out[3]= (int)(ma_mb*row1A + a_mb*row3A + ma_b*row2A + a_b*row4A); } -static void do_transform_effect_byte(Sequence * seq,float facf0, int x, int y, +static void do_transform_effect_byte(Sequence * seq,float facf0, int x, int y, unsigned char *ibuf1,unsigned char *out) { int xo, yo, xi, yi; float xs,ys,factxScale,factyScale,tx,ty,rad,s,c,xaux,yaux,factRot,px,py; TransformVars *scale; - + scale = (TransformVars *)seq->effectdata; xo = x; yo = y; @@ -2169,15 +2708,15 @@ /*interpolate*/ bilinear_interpolation_transform_byte(ibuf1,out, xs,ys,x,y); - + out+=4; } - } + } } static void do_transform_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3, struct ImBuf *out) { if (out->rect_float) { @@ -2558,7 +3097,7 @@ } } -static void RVAddBitmaps_float (float* a, float* b, float* c, +static void RVAddBitmaps_float (float* a, float* b, float* c, int width, int height) { int x,y,index; @@ -2576,8 +3115,8 @@ /* For each pixel whose total luminance exceeds the threshold, */ /* Multiply it's value by BOOST and add it to the output map */ -static void RVIsolateHighlights_byte (unsigned char* in, unsigned char* out, - int width, int height, int threshold, +static void RVIsolateHighlights_byte (unsigned char* in, unsigned char* out, + int width, int height, int threshold, float boost, float clamp) { int x,y,index; @@ -2606,8 +3145,8 @@ } } -static void RVIsolateHighlights_float (float* in, float* out, - int width, int height, float threshold, +static void RVIsolateHighlights_float (float* in, float* out, + int width, int height, float threshold, float boost, float clamp) { int x,y,index; @@ -2669,8 +3208,8 @@ } //void do_glow_effect(Cast *cast, float facf0, float facf1, int xo, int yo, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *outbuf, ImBuf *use) -static void do_glow_effect_byte(Sequence *seq, float facf0, float facf1, - int x, int y, char *rect1, +static void do_glow_effect_byte(Sequence *seq, float facf0, float facf1, + int x, int y, char *rect1, char *rect2, char *out) { unsigned char *outbuf=(unsigned char *)out; @@ -2683,8 +3222,8 @@ RVAddBitmaps_byte (inbuf , outbuf, outbuf, x, y); } -static void do_glow_effect_float(Sequence *seq, float facf0, float facf1, - int x, int y, +static void do_glow_effect_float(Sequence *seq, float facf0, float facf1, + int x, int y, float *rect1, float *rect2, float *out) { float *outbuf = out; @@ -2698,8 +3237,8 @@ } static void do_glow_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3, struct ImBuf *out) { if (out->rect_float) { @@ -2722,10 +3261,10 @@ static void init_solid_color(Sequence *seq) { SolidColorVars *cv; - + if(seq->effectdata)MEM_freeN(seq->effectdata); seq->effectdata = MEM_callocN(sizeof(struct SolidColorVars), "solidcolor"); - + cv = (SolidColorVars *)seq->effectdata; cv->col[0] = cv->col[1] = cv->col[2] = 0.5; } @@ -2753,8 +3292,8 @@ } static void do_solid_color(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3, struct ImBuf *out) { SolidColorVars *cv = (SolidColorVars *)seq->effectdata; @@ -2764,19 +3303,19 @@ if (out->rect) { rect = (unsigned char *)out->rect; - - for(y=0; yy; y++) { + + for(y=0; yy; y++) { for(x=0; xx; x++, rect+=4) { rect[0]= (char)(cv->col[0]*255); rect[1]= (char)(cv->col[1]*255); rect[2]= (char)(cv->col[2]*255); rect[3]= 255; - } + } } } else if (out->rect_float) { rect_float = out->rect_float; - - for(y=0; yy; y++) { + + for(y=0; yy; y++) { for(x=0; xx; x++, rect_float+=4) { rect_float[0]= cv->col[0]; rect_float[1]= cv->col[1]; @@ -2795,7 +3334,7 @@ SpeedControlVars * v; if(seq->effectdata) MEM_freeN(seq->effectdata); - seq->effectdata = MEM_callocN(sizeof(struct SpeedControlVars), + seq->effectdata = MEM_callocN(sizeof(struct SpeedControlVars), "speedcontrolvars"); v = (SpeedControlVars *)seq->effectdata; @@ -2857,22 +3396,22 @@ v->length = seq->len; - v->frameMap = MEM_callocN(sizeof(float) * v->length, + v->frameMap = MEM_callocN(sizeof(float) * v->length, "speedcontrol frameMap"); } fallback_fac = 1.0; - + /* if there is no IPO, try to make retiming easy by stretching the strip */ if (!seq->ipo && seq->seq1 && seq->seq1->enddisp != seq->seq1->start && seq->seq1->len != 0) { - fallback_fac = (float) seq->seq1->len / + fallback_fac = (float) seq->seq1->len / (float) (seq->seq1->enddisp - seq->seq1->start); /* FIXME: this strip stretching gets screwed by stripdata handling one layer up. - + So it currently works by enlarging, never by shrinking! (IPOs still work, if used correctly) @@ -2898,7 +3437,7 @@ div= v->length / 100.0f; if(div==0.0) return; } - + calc_ipo(seq->ipo, ctime/div); execute_ipo((ID *)seq, seq->ipo); } else { @@ -2926,11 +3465,11 @@ div= v->length / 100.0f; if(div==0.0) return; } - + calc_ipo(seq->ipo, ctime/div); execute_ipo((ID *)seq, seq->ipo); } - + if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) { seq->facf0 *= v->length; } @@ -2951,8 +3490,8 @@ simply reuse do_cross_effect for blending... static void do_speed_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, + float facf0, float facf1, int x, int y, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3, struct ImBuf *out) { @@ -3032,15 +3571,15 @@ } static void do_overdrop_effect(struct Sequence * seq, int cfra, - float fac, float facf, - int x, int y, struct ImBuf * ibuf1, - struct ImBuf * ibuf2, - struct ImBuf * ibuf3, + float fac, float facf, + int x, int y, struct ImBuf * ibuf1, + struct ImBuf * ibuf2, + struct ImBuf * ibuf3, struct ImBuf * out) { - do_drop_effect(seq, cfra, fac, facf, x, y, + do_drop_effect(seq, cfra, fac, facf, x, y, ibuf1, ibuf2, ibuf3, out); - do_alphaover_effect(seq, cfra, fac, facf, x, y, + do_alphaover_effect(seq, cfra, fac, facf, x, y, ibuf1, ibuf2, ibuf3, out); } @@ -3145,6 +3684,15 @@ rval.execute = do_plugin_effect; rval.early_out = do_plugin_early_out; rval.get_default_fac = get_default_fac_fade; + break; + case SEQ_PUSH: + rval.init = init_push_effect; + rval.num_inputs = num_inputs_push; + rval.free = free_push_effect; + rval.copy = copy_push_effect; + rval.early_out = early_out_fade; + rval.get_default_fac = get_default_fac_fade; + rval.execute = do_push_effect; break; }