summaryrefslogtreecommitdiff
path: root/glitcher/src
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2014-03-04 09:11:07 +0000
committerComment <tim@gray.(none)>2014-03-04 09:11:07 +0000
commit598b4ac2377c6359323f54d570b704f5d912f483 (patch)
treeff2f04b292d7f01f9bc62fb0b2a36fad1467de4e /glitcher/src
parent8a0124c0853f025555aa21f3190f47b99f419647 (diff)
scaling weird
Diffstat (limited to 'glitcher/src')
-rw-r--r--glitcher/src/audioGlitcher.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/glitcher/src/audioGlitcher.h b/glitcher/src/audioGlitcher.h
index f8b7e36..cf88471 100644
--- a/glitcher/src/audioGlitcher.h
+++ b/glitcher/src/audioGlitcher.h
@@ -101,8 +101,8 @@ class audioGlitcher {
dstTri[i].y=srcTri[i].y+(tY*dstX.cols); //use cols for equiv coords
//rotate and scale around centre
//transform to centre
- dstTri[i].x-=(oX*dstX.cols);
- dstTri[i].y-=(oY*dstX.cols);
+ dstTri[i].x-=(oX*(dstX.cols));
+ dstTri[i].y-=(oY*(dstX.cols));
dstTri[i].x*=s;
dstTri[i].y*=s;
@@ -114,8 +114,8 @@ class audioGlitcher {
dstTri[i].y=dy;
//transform back
- dstTri[i].x+=(oX*dstX.cols);
- dstTri[i].y+=(oY*dstX.cols);
+ dstTri[i].x+=(oX*(dstX.cols));
+ dstTri[i].y+=(oY*(dstX.cols));
}
cv::Mat trans_mat=getAffineTransform(srcTri,dstTri);
@@ -148,7 +148,7 @@ class audioGlitcher {
}
}
-/*
+
float* psx = (float*)scaledstX.data;
float* psy = (float*)scaledstY.data;
@@ -159,11 +159,11 @@ class audioGlitcher {
cerr<<"dest: <7,5> "<<dx[5*16+7]<<","<<dy[5*16+7]<<endl;
cerr<<"dest: <8,6> "<<dx[6*16+8]<<","<<dy[6*16+8]<<endl;
cerr<<"Map at <256,192> "<<psx[192*512+256]<<","<<psy[192*512+256]<<endl;
-*/
+
cv::Mat buf = buffer.getCvImage();
cv::Mat dstbuf;
- cv::remap(buf,dstbuf,scaledstX,scaledstY, cv::INTER_LINEAR, cv::BORDER_WRAP); //, cv::Scalar(0,0, 0) );
+ cv::remap(buf,dstbuf,scaledstX,scaledstY, cv::INTER_NEAREST, cv::BORDER_REPLICATE); //, cv::Scalar(0,0, 0) );
tmp = IplImage(dstbuf);
//buffer=tmp;