Skip to content

Commit

Permalink
Changed how Image objects are handled
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMohawkNinja committed Oct 25, 2020
1 parent 74cec97 commit 230fe11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
Binary file modified WallFade
Binary file not shown.
19 changes: 6 additions & 13 deletions WallFade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ string::size_type confIndex;
stringstream stream;
ColorRGB AVG, oldAVG[maxMonitors];
ColorRGB ColorSample[30][30], oldColorSample[30][30];
Image background;
Image lastbackground;
Image background, lastbackground;
Image A, B, maskA, maskB, compResult;
Display* d=XOpenDisplay(NULL);
Screen* s=DefaultScreenOfDisplay(d);

Expand Down Expand Up @@ -708,9 +708,8 @@ int main(int argc, char **argv)
{
output(stdout,"Compositing transition step %d... ",(int)i);

Image A(newpic);
Image B(picpath+".cache/resizeOld"+to_string(S)+".jpg");
Image compResult;
A=Image(newpic);
B=Image(picpath+".cache/resizeOld"+to_string(S)+".jpg");

if(i<=steps)
{
Expand All @@ -729,8 +728,8 @@ int main(int argc, char **argv)
color="FF";
}

Image maskA(Geometry(bgW,bgH), Color("#"+color+color+color));
Image maskB(Geometry(bgW,bgH), Color("#"+invertHex(color)+invertHex(color)+invertHex(color)));
maskA=Image(Geometry(bgW,bgH),Color("#"+color+color+color));
maskB=Image(Geometry(bgW,bgH),Color("#"+invertHex(color)+invertHex(color)+invertHex(color)));

A.composite(maskA,0,0,Magick::CopyAlphaCompositeOp);
B.composite(maskB,0,0,Magick::CopyAlphaCompositeOp);
Expand All @@ -742,12 +741,6 @@ int main(int argc, char **argv)
//system(("composite -blend "+to_string((100/steps)*i)+" "+newpic+" "+picpath+".cache/resizeOld"+to_string(S)+".jpg"+" "+picpath+".cache/transition"+to_string(i)+".jpg").c_str());
output(stdout,"Done!\n");

A=NULL;
B=NULL;
maskA=NULL;
maskB=NULL;
compResult=NULL;

usleep(delay/steps);
}

Expand Down

0 comments on commit 230fe11

Please sign in to comment.