// Fade options: // The type of fade to do: // -1 = user attribute-only fade - see fadeRGBI. // 0 = attribute-only fade via black, using nearest RGBI colour to proper // fade. // 1 = same as 0 but only looks at luminosity of RGBI colour to form ramp. // Gives more visible steps but they're strange neon colours. // 2 = same as 0 but avoids repeating colours unless doing so would make the // luminance non-monotonic. Gives more visible steps than 0 but less // strange colours than 2. // 3 = same as 0 but instead of fading via black, fades via the RGBI colour // that is closest to the mid-point of the transition. // 4 = same as 1 but uses midpoints like 3. // 5 = same as 2 but uses midpoints like 3. // 6 = RGB fade using characters in characterSet. // 7 = same as 6 but without gamma correction (uses sRGB cube instead of // linear RGB cube). Possibly decreases banding at the expense of less // accurate colours. Probably not noticably different from 6. fadeNumber = 6; // For attribute-only fades (numbers 0-5), this is the number of steps in each // half of the transition (e.g. from initial picture to black). One extra step // is needed to set the character. // RGB fades (for now) always use 8 transitional steps plus a final step to // the end picture. fadeHalfSteps = 5; // Number of (60Hz) frames taken to fade any given character cell. The larger // this number, the "wider" the transition "band". This doesn't have an effect // on the speed unless it's higher than wipeFrames (in which case no frame // will perform all steps) or smaller than the number of steps (in which case // a more complicated assembly routine will need to be used). fadeFrames = 90; // Which characters are used for fades 6 and 7. characterSet = "b1/8e/b0/1d/14/7f"; // User attribute fade pattern for fadeNumber -1. Each row is a step and has // the RGBI colours in order as a hex digit for each. For example, the // following fade zeros the bits in order B, I, G, R: fadeRGBI = "0000000000000000" + "0000444400004444" + "0022446600224466" + "0022446688aaccee" + "0123456789abcdef"; // Wipe options: // Type type of wipe to do: // 0 = vertical, top-to-bottom. // 1 = random (same as 2 but with smoothness 0). // 2 = blobby // 3 = gradientMap wipeNumber = 2; // Smoothness for wipe number 2. Lower numbers give smaller "grains". smoothness = 40000000; // Number of (60Hz) frames taken to wipe any given sub-band over the entire // image. The transition takes fadeFrames+wipeFrames frames in total. wipeFrames = 229; // Gradient map bitmap (a 24-bit .png file, only green channel is used). Must // be 80x100. gradientMap = "gradientMap.png"; // Computing how many wipeFrames we need: // fadeNumber 0-2: 547 updates possible per frame. // fadeNumber 3-5: Not yet calculated, will be slightly slower than 0-2 but // not massively so. // fadeNumber 6: 314 updates possible per frame. // smallest value for wipeFrames = 8000*fadeSteps / updatesPerFrame // Examples: // fadeNumber 0-2 with fadeHalfSteps = 5: // wipeFrames >= 8000*(5*2+1) / 547 = 160 // fadeNumber 6-7: // wipeFrames >= 8000*9 / 314 = 229 // These numbers are preliminary and will change, though not by a huge amount. // Memory/disk usage: // Fades 0-2 use a single table of 256*fadeHalfSteps bytes. // Fades 3-5 use a single table of 4096*fadeHalfSteps bytes, plus 4000 bytes // on disk (and 8000 bytes in RAM) per image pair. // Fades 6-7 use 2.5kB of fixed tables plus 9000 bytes on disk per image plus // 32000 bytes of RAM per image pair. // Each wipe pattern will take 16000 bytes on disk and in RAM. // We will also need ~10kB of RAM for a frame's worth of unrolled code.