void Image::resize(unsigned int width, unsigned int height) { if (width == m_width && height == m_height) return; if (m_pixels) { delete [] m_pixels; m_pixels = NULL; } m_width = width; m_height = height; m_pixels = new Pixel[pixelCount()]; memset(m_pixels, 0, pixelCount() * sizeof(m_pixels[0])); }
void Layer::renderComposite() { if (orientation == ORIENTATION_LINEAR) { renderCompositeLinear(); } else { renderCompositeFloor(); } effectStep(effect)(meta, pixelCount()); }
void Layer::renderPreview(CRGB * preview) { CRGB nxt; effectPixel(effect)(meta, &nxt, 0, pixelCount()); *preview = blend(*preview, nxt, 127); effectStep(effect)(meta, pixelCount()); }
void Layer::setTransition(byte id) { transititionIdx = id; transitionInit(transititionIdx)(tmeta, pixelCount()); }
void Layer::initEffect() { orientation = getEffectOrientation(effect); if (orientation == ORIENTATION_NIL) orientation = static_cast<Orientation>(random8(NUM_ORIENTATIONS)); effectInit(effect)(meta, pixelCount()); }