[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12251] trunk/blender/source/blender: Peach request
Campbell Barton
cbarton at metavr.com
Thu Oct 11 01:34:40 CEST 2007
Revision: 12251
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12251
Author: campbellbarton
Date: 2007-10-11 01:34:40 +0200 (Thu, 11 Oct 2007)
Log Message:
-----------
Peach request
new option for the image sequencer's image strips, flip x/y, (useful when making animatics to test the direction characters walk across the screen)
added IMB_flipy was alredy there, needed to add IMB_flipx.
Modified Paths:
--------------
trunk/blender/source/blender/imbuf/IMB_imbuf.h
trunk/blender/source/blender/imbuf/intern/rotate.c
trunk/blender/source/blender/makesdna/DNA_sequence_types.h
trunk/blender/source/blender/src/drawseq.c
trunk/blender/source/blender/src/sequence.c
Modified: trunk/blender/source/blender/imbuf/IMB_imbuf.h
===================================================================
--- trunk/blender/source/blender/imbuf/IMB_imbuf.h 2007-10-10 22:24:26 UTC (rev 12250)
+++ trunk/blender/source/blender/imbuf/IMB_imbuf.h 2007-10-10 23:34:40 UTC (rev 12251)
@@ -418,7 +418,15 @@
void IMB_convert_bgra_to_rgba(int size, unsigned int *rect);
/**
+ * Flip the image X/Y
*
+ * @attention Defined in imageprocess.c
+ */
+void IMB_xflip(struct ImBuf *ibuf);
+void IMB_yflip(struct ImBuf *ibuf);
+
+/**
+ *
* @attention defined in scaling.c
*/
struct ImBuf *IMB_scalefastfieldImBuf(struct ImBuf *ibuf,
Modified: trunk/blender/source/blender/imbuf/intern/rotate.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/rotate.c 2007-10-10 22:24:26 UTC (rev 12250)
+++ trunk/blender/source/blender/imbuf/intern/rotate.c 2007-10-10 23:34:40 UTC (rev 12251)
@@ -86,3 +86,29 @@
MEM_freeN(line);
if(linef) MEM_freeN(linef);
}
+
+void IMB_flipx(struct ImBuf * ibuf)
+{
+ short x, y, xr, xl, yi;
+ unsigned int px;
+ float px_f[4];
+
+ if (ibuf == NULL) return;
+ if (ibuf->rect == NULL) return;
+
+ x = ibuf->x;
+ y = ibuf->y;
+ for(yi=y-1;yi>=0;yi--) {
+ for(xr=x-1, xl=0; xr>=xl; xr--, xl++) {
+ px = ibuf->rect[(x*yi)+xr];
+ ibuf->rect[(x*yi)+xr] = ibuf->rect[(x*yi)+xl];
+ ibuf->rect[(x*yi)+xl] = px;
+
+ if (ibuf->rect_float) {
+ memcpy(&px_f, &ibuf->rect_float[((x*yi)+xr)*4], 4*sizeof(float));
+ memcpy(&ibuf->rect_float[((x*yi)+xr)*4], &ibuf->rect_float[((x*yi)+xl)*4], 4*sizeof(float));
+ memcpy(&ibuf->rect_float[((x*yi)+xl)*4], &px_f, 4*sizeof(float));
+ }
+ }
+ }
+}
Modified: trunk/blender/source/blender/makesdna/DNA_sequence_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_sequence_types.h 2007-10-10 22:24:26 UTC (rev 12250)
+++ trunk/blender/source/blender/makesdna/DNA_sequence_types.h 2007-10-10 23:34:40 UTC (rev 12251)
@@ -205,6 +205,8 @@
#define SEQ_IPO_FRAME_LOCKED 256
#define SEQ_EFFECT_NOT_LOADED 512
#define SEQ_FLAG_DELETE 1024
+#define SEQ_FLIPX 2048
+#define SEQ_FLIPY 4096
/* seq->type WATCH IT: SEQ_EFFECT BIT is used to determine if this is an effect strip!!! */
#define SEQ_IMAGE 0
Modified: trunk/blender/source/blender/src/drawseq.c
===================================================================
--- trunk/blender/source/blender/src/drawseq.c 2007-10-10 22:24:26 UTC (rev 12250)
+++ trunk/blender/source/blender/src/drawseq.c 2007-10-10 23:34:40 UTC (rev 12251)
@@ -1117,12 +1117,16 @@
}
else if(last_seq->type==SEQ_IMAGE) {
- 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, "");
+ uiDefBut(block, LABEL, 0, "Type: Image", 10,160,150,20, 0, 0, 0, 0, 0, "");
+ uiDefBut(block, TEX, B_NOP, "Name: ", 10,140,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");
+ uiDefButBitS(block, TOG, SEQ_MAKE_PREMUL, SEQ_BUT_RELOAD, "Convert to Premul", 10,110,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,90,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "For video movies to remove fields");
+
+ uiDefButBitS(block, TOG, SEQ_FLIPX, SEQ_BUT_RELOAD, "FlipX", 10,70,75,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Flip on the X axis");
+ uiDefButBitS(block, TOG, SEQ_FLIPY, SEQ_BUT_RELOAD, "FlipY", 85,70,75,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Flip on the Y axis");
+
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");
Modified: trunk/blender/source/blender/src/sequence.c
===================================================================
--- trunk/blender/source/blender/src/sequence.c 2007-10-10 22:24:26 UTC (rev 12250)
+++ trunk/blender/source/blender/src/sequence.c 2007-10-10 23:34:40 UTC (rev 12251)
@@ -779,6 +779,8 @@
seq->strip->orx= se->ibuf->x;
seq->strip->ory= se->ibuf->y;
if(seq->flag & SEQ_FILTERY) IMB_filtery(se->ibuf);
+ if(seq->flag & SEQ_FLIPX) IMB_flipx(se->ibuf);
+ if(seq->flag & SEQ_FLIPY) IMB_flipy(se->ibuf);
if(seq->mul==0.0) seq->mul= 1.0;
if(seq->mul != 1.0) multibuf(se->ibuf, seq->mul);
}
More information about the Bf-blender-cvs
mailing list