Skip to content

Commit

Permalink
added AddInvert and Curtain using SubFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
lostjared committed Jan 10, 2019
1 parent d19477b commit 05a7eec
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 5 deletions.
Binary file not shown.
8 changes: 4 additions & 4 deletions Acid.Cam.v2.OSX/ac-filter1.cpp

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions Acid.Cam.v2.OSX/ac-filter14.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,13 @@ void ac::ColorTransition(cv::Mat &frame) {
}
}
}
AddInvert(frame);
}

void ac::ColorTransitionMedian(cv::Mat &frame) {
ColorTransition(frame);
MedianBlend(frame);
AddInvert(frame);
}

void ac::ColorTransitionRandom(cv::Mat &frame) {
Expand Down Expand Up @@ -448,11 +450,13 @@ void ac::ColorTransitionRandom(cv::Mat &frame) {
}
}
}
AddInvert(frame);
}

void ac::ColorTransitionRandomMedian(cv::Mat &frame) {
ColorTransitionRandom(frame);
MedianBlend(frame);
AddInvert(frame);
}

void ac::ColorTransitionSubFilter(cv::Mat &frame) {
Expand All @@ -464,6 +468,7 @@ void ac::ColorTransitionSubFilter(cv::Mat &frame) {
ColorTransitionRandomMedian(copy2);
AlphaBlend(copy1, copy2, frame, 0.5);
MedianBlend(frame);
AddInvert(frame);
}

void ac::ColorTransitionImageSubFilter(cv::Mat &frame) {
Expand All @@ -474,4 +479,50 @@ void ac::ColorTransitionImageSubFilter(cv::Mat &frame) {
CallFilter(subfilter, copy1);
CallFilter(subfilter, copy2);
AlphaBlend(copy1, copy2, frame, 0.5);
AddInvert(frame);
}

void ac::CurtainSubFilter(cv::Mat &frame) {
if(subfilter == -1 || ac::draw_strings[subfilter] == "CurtainSubFilter")
return;
if(testSize(frame) == false)
return;
static int start = 0;
static int direction = 1;
static double alpha = 1.0, alpha_max = 7.0;
cv::Mat frame_copy = frame.clone();
CallFilter(subfilter, frame_copy);
for(int z = 0; z < frame.rows; ++z) {
if(direction == 1) {
for(int i = 0; i < start; ++i) {
cv::Vec3b &pixel = frame.at<cv::Vec3b>(z, i);
cv::Vec3b copy_pix = frame_copy.at<cv::Vec3b>(z, i);
for(int j = 0; j < 3; ++j) {
pixel[j] ^= static_cast<unsigned char>(copy_pix[j]+pixel[j]);
}
}
} else {

for(int i = frame.cols-1; i > start; --i) {
cv::Vec3b &pixel = frame.at<cv::Vec3b>(z, i);
cv::Vec3b copy_pix = frame_copy.at<cv::Vec3b>(z, i);
for(int j = 0; j < 3; ++j)
pixel[j] ^= static_cast<unsigned char>(copy_pix[j]+pixel[j]);
}
}
}
if(direction == 1) {
start += 40;
if(start > frame.cols-1) {
direction = 0;
}
} else {
start -= 40;
if(start <= 1) {
direction = 1;
}
}
static int dir = 1;
procPos(dir, alpha, alpha_max);
AddInvert(frame);
}
2 changes: 1 addition & 1 deletion Acid.Cam.v2.OSX/ac-filtercat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace ac {
std::vector<std::string> svSquare {"SquareSwap","SquareSwap4x2","SquareSwap8x4", "SquareSwap16x8","SquareSwap64x32", "SquareBars","SquareBars8","SquareSwapRand16x8","SquareVertical8","SquareVertical16","SquareVertical_Roll","SquareSwapSort_Roll","SquareVertical_RollReverse","SquareSwapSort_RollReverse", "RandomFilteredSquare","RandomQuads","QuadRandomFilter", "RollRandom", "GridFilter8x", "GridFilter16x", "GridFilter8xBlend", "GridRandom", "GridRandomPixel", "PixelatedSquare", "SmoothSourcePixel", "ColorLines", "Curtain", "RandomCurtain", "RandomCurtainVertical", "CurtainVertical", "SlideFilter","SlideFilterXor", "RandomSlideFilter", "SlideUpDown", "SlideUpDownXor", "SlideUpDownRandom", "SlideSubFilter", "SlideSubUpDownFilter", "FourSquare", "EightSquare", "DiagonalSquare", "DiagonalSquareRandom", "SquareStretchDown", "SquareStretchRight", "SquareStretchUp", "SquareStretchLeft", "ExpandSquareBlendSubFilter", "ExpandSquareSubFilter", "ExpandSquareVerticalSubFilter"};


std::vector<std::string> vSub { "SlideSubFilter", "SubFilter", "ResizeSoftFeedbackSubFilter", "SoftFeedbackSubFilter", "SoftFeedbackResizeSubFilter", "SoftFeedbackResizeSubFilter64", "SoftFeedbackReszieSubFilter64_Negate", "SoftFeedbackReszieSubFilter64_Mirror", "Bitwise_XOR_AlphaSubFilter", "AlphaBlendSubFilter", "GradientSubFilterXor", "XorBlend_SubFilter", "SmoothSubFilterAlphaBlend", "SmoothSubFilterXorBlend", "IntertwineSubFilter", "EveryOtherSubFilter", "RandomSubFilterRandomTimes", "AddToFrameSubFilter", "SmoothSubFilter", "EnergizeSubFilter", "SmoothSubFilter16", "EnergizeSubFilter16", "EnergizeSubFilter32", "SmoothSubFilter32", "HalfAddSubFilter", "HalfXorSubFilter", "ChannelMedianSubFilter", "PixelatedSubFilterSort", "FilteredDifferenceSubFilter", "ExpandSquareSubFilter", "ExpandSquareBlendSubFilter", "ExpandSquareVerticalSubFilter", "MirrorEnergizeSubFilter", "InterRGB_SubFilter", "InterSmoothSubFilter", "StoredFramesAlphaBlend_SubFilter", "BlendSubFilter", "BlendAlphaSubFilter", "Blend_AlphaSubFilter", "FrameMedianBlendSubFilter", "FrameBlurSubFilter", "ImageBlendSubFilter", "ImageBlendXorSubFilter", "ImageCollectionSubFilter", "SubFilterMedianBlend", "DarkCollectionSubFilter", "FlipMedianSubFilter", "FlipMirrorSubFilter", "BlendCombinedValueSubFilter", "BlendSubFilterAlpha", "CollectionXorSourceSubFilter", "BlendReverseSubFilter", "SmoothBlendReverseSubFilter", "MedianBlendBufferSubFilter", "RGBBlendSubFilter", "XorOppositeSubFilter", "BlendSmoothSubFilter", "BlurSmoothSubFilter", "BlurFlipSubFilter", "MedianBlendSubFilterEx", "ShiftFrameSmoothSubFilter", "ShiftFrameStaticXorSubFilter", "RandomSubFilter", "BlendWithFrameSubFilter", "AlphaBlendWithFrameSubFilter", "AlphaXorBlendWithFrameSubFilter", "XorBlendSubFilter", "SmoothMedianRotateSubFilter", "XorSubFilter", "XorAlphaSubFilter", "BlurXorAlphaSubFilter", "ImageAlphaXorMedianSubFilter", "ImageSmoothAlphaXorSubFilter", "ImageXorSubFilter", "ImageAlphaXorSubFilter", "BlendWithRainbowSubFilter","BlendWithJetSubFilter", "ColormapBlendSubFilter", "RandomColorMapAlphaBlendSubFilter", "RandomOrderMedianBlendSubFilter", "MirrorOrderSubFilter","FilterStrobeSubFilter", "BlendImageWithSubFilter", "BlendImageWithSubFilterAlpha", "AndImageSubFilterXor", "AlphaBlendImageSubFilterXor", "AlphaBlendImageSubFilterXorRev", "ParticleReleaseSubFilter", "ParticleReleaseImageSubFilter", "ImageEnergySubFilter", "ImageDistortionSubFilter", "ReverseSubFilterBlend", "ReverseSubFilterXor", "ImageReverseSubFilter", "ImageSmoothMedianSubFilter", "MatrixCollectionSubFilter", "MatrixCollectionImageSubFilter", "TrailsSubFilter", "TrailsSubFilter32", "CompareWithSubFilter", "ColorTransitionSubFilter"};
std::vector<std::string> vSub { "SlideSubFilter", "SubFilter", "ResizeSoftFeedbackSubFilter", "SoftFeedbackSubFilter", "SoftFeedbackResizeSubFilter", "SoftFeedbackResizeSubFilter64", "SoftFeedbackReszieSubFilter64_Negate", "SoftFeedbackReszieSubFilter64_Mirror", "Bitwise_XOR_AlphaSubFilter", "AlphaBlendSubFilter", "GradientSubFilterXor", "XorBlend_SubFilter", "SmoothSubFilterAlphaBlend", "SmoothSubFilterXorBlend", "IntertwineSubFilter", "EveryOtherSubFilter", "RandomSubFilterRandomTimes", "AddToFrameSubFilter", "SmoothSubFilter", "EnergizeSubFilter", "SmoothSubFilter16", "EnergizeSubFilter16", "EnergizeSubFilter32", "SmoothSubFilter32", "HalfAddSubFilter", "HalfXorSubFilter", "ChannelMedianSubFilter", "PixelatedSubFilterSort", "FilteredDifferenceSubFilter", "ExpandSquareSubFilter", "ExpandSquareBlendSubFilter", "ExpandSquareVerticalSubFilter", "MirrorEnergizeSubFilter", "InterRGB_SubFilter", "InterSmoothSubFilter", "StoredFramesAlphaBlend_SubFilter", "BlendSubFilter", "BlendAlphaSubFilter", "Blend_AlphaSubFilter", "FrameMedianBlendSubFilter", "FrameBlurSubFilter", "ImageBlendSubFilter", "ImageBlendXorSubFilter", "ImageCollectionSubFilter", "SubFilterMedianBlend", "DarkCollectionSubFilter", "FlipMedianSubFilter", "FlipMirrorSubFilter", "BlendCombinedValueSubFilter", "BlendSubFilterAlpha", "CollectionXorSourceSubFilter", "BlendReverseSubFilter", "SmoothBlendReverseSubFilter", "MedianBlendBufferSubFilter", "RGBBlendSubFilter", "XorOppositeSubFilter", "BlendSmoothSubFilter", "BlurSmoothSubFilter", "BlurFlipSubFilter", "MedianBlendSubFilterEx", "ShiftFrameSmoothSubFilter", "ShiftFrameStaticXorSubFilter", "RandomSubFilter", "BlendWithFrameSubFilter", "AlphaBlendWithFrameSubFilter", "AlphaXorBlendWithFrameSubFilter", "XorBlendSubFilter", "SmoothMedianRotateSubFilter", "XorSubFilter", "XorAlphaSubFilter", "BlurXorAlphaSubFilter", "ImageAlphaXorMedianSubFilter", "ImageSmoothAlphaXorSubFilter", "ImageXorSubFilter", "ImageAlphaXorSubFilter", "BlendWithRainbowSubFilter","BlendWithJetSubFilter", "ColormapBlendSubFilter", "RandomColorMapAlphaBlendSubFilter", "RandomOrderMedianBlendSubFilter", "MirrorOrderSubFilter","FilterStrobeSubFilter", "BlendImageWithSubFilter", "BlendImageWithSubFilterAlpha", "AndImageSubFilterXor", "AlphaBlendImageSubFilterXor", "AlphaBlendImageSubFilterXorRev", "ParticleReleaseSubFilter", "ParticleReleaseImageSubFilter", "ImageEnergySubFilter", "ImageDistortionSubFilter", "ReverseSubFilterBlend", "ReverseSubFilterXor", "ImageReverseSubFilter", "ImageSmoothMedianSubFilter", "MatrixCollectionSubFilter", "MatrixCollectionImageSubFilter", "TrailsSubFilter", "TrailsSubFilter32", "CompareWithSubFilter", "ColorTransitionSubFilter", "CurtainSubFilter"};


void SortFilters() {
Expand Down
1 change: 1 addition & 0 deletions Acid.Cam.v2.OSX/ac.h
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ namespace ac {
void ColorTransitionRandomMedian(cv::Mat &frame);
void ColorTransitionSubFilter(cv::Mat &frame);
void ColorTransitionImageSubFilter(cv::Mat &frame);
void CurtainSubFilter(cv::Mat &frame);
// No filter (do nothing)
void NoFilter(cv::Mat &frame);
// Alpha blend with original image
Expand Down

0 comments on commit 05a7eec

Please sign in to comment.