Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-10-11 03:34:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-10-11 03:34:40 +0400
commit4a43099c5a61f302654b7f309572505894357227 (patch)
tree7863c7e2fd9a52d456ccb0b92f816d6f2e769729 /source
parent5f6d775e0c9247d2f5979670037ca5468ee67b40 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/imbuf/IMB_imbuf.h8
-rw-r--r--source/blender/imbuf/intern/rotate.c26
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h2
-rw-r--r--source/blender/src/drawseq.c12
-rw-r--r--source/blender/src/sequence.c2
5 files changed, 46 insertions, 4 deletions
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index e56fb5a776d..11cdebe70c3 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -418,6 +418,14 @@ void bilinear_interpolation(struct ImBuf *in, struct ImBuf *out, float u, float
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
*/
diff --git a/source/blender/imbuf/intern/rotate.c b/source/blender/imbuf/intern/rotate.c
index 13edfbf0a33..4654dd6aefa 100644
--- a/source/blender/imbuf/intern/rotate.c
+++ b/source/blender/imbuf/intern/rotate.c
@@ -86,3 +86,29 @@ void IMB_flipy(struct ImBuf * ibuf)
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));
+ }
+ }
+ }
+}
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index 5db102e9868..f1abc2dc0c8 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -205,6 +205,8 @@ typedef struct SpeedControlVars {
#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
diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c
index af08af30fc8..7986a6da19a 100644
--- a/source/blender/src/drawseq.c
+++ b/source/blender/src/drawseq.c
@@ -1117,12 +1117,16 @@ static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES
}
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");
diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c
index e55cea7de59..f9ad78dc732 100644
--- a/source/blender/src/sequence.c
+++ b/source/blender/src/sequence.c
@@ -779,6 +779,8 @@ static void do_build_seq_ibuf(Sequence * seq, int cfra)
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);
}