#include #include "vis.h" #include "rappapi.h" // Forward declaration void sample_Effect(int stepno, RappaFrameInfo *rfip, VisData *pVD); RappaPluginInfo rpi = { 1, // Version - currently 1 64, // Some number of steps 2, // Number of inputs 1, // End input, the second one sample_Effect, "Sample", // The display name "Sample" // The internal name }; extern "C" DLLEXPORT RappaPluginInfo * QueryRappaPlugin(void) { return &rpi; } void sample_Effect(int stepno, RappaFrameInfo *rfip, VisData *pVD) { int switch_pos; int y; // This is the scan line after which we will switch back // to the original vis switch_pos = rfip->height * stepno / rpi.nsteps; // First draw the top in the new vis for (y = 0; y < switch_pos; y++) memcpy(&(rfip->output[y * rfip->pitch]), &(rfip->inputs[1][y * rfip->pitch]), rfip->width * sizeof(unsigned long)); // Now draw the rest in the old vis for (; y < rfip->height; y++) memcpy(&(rfip->output[y * rfip->pitch]), &(rfip->inputs[0][y * rfip->pitch]), rfip->width * sizeof(unsigned long)); }