#pragma once #include "../shape/Point.h" #include #include "../shape/Shape.h" #include "../svg/SvgParser.h" #include "../shape/Line.h" class OscirenderAudioProcessor; class ImageParser { public: ImageParser(OscirenderAudioProcessor& p, juce::String fileName, juce::MemoryBlock image); ~ImageParser(); void setFrame(int index); Point getSample(); private: void findNearestNeighbour(int searchRadius, float thresholdPow, int stride, bool invert); void resetPosition(); float getPixelValue(int x, int y, bool invert); void findWhite(double thresholdPow, bool invert); bool isOverThreshold(double pixel, double thresholdValue); int jumpFrequency(); OscirenderAudioProcessor& audioProcessor; juce::Random rng; int frameIndex = 0; std::vector> frames; std::vector visited; int currentX, currentY; int width, height; int count = 0; };