TransformFrame * DotaAnimParser::newKeyframes(int zOrder, unsigned char opacity, float x, float y, float skX, float skY, float scX, float scY, const std::string& sound) { TransformFrame *frame = new TransformFrame(); frame->duration = (int)(round(1 * 1000.f / _frameRate)); if (!sound.empty()) frame->sound = sound; frame->visible = true; // NaN:no tween, 10:auto tween, [-1, 0):ease in, 0:line easing, (0, 1]:ease out, (1, 2]:ease in out frame->tweenEasing = AUTO_TWEEN_EASING; frame->tweenRotate = 0; frame->tweenScale = true; frame->displayIndex = 0; frame->zOrder = zOrder; setTransform(frame->global, x, y, skX, skY, scX, scY); setPivot(frame->pivot, 0, 0); // copy frame->transform = frame->global; frame->scaleOffset.x = 0.f; frame->scaleOffset.y = 0.f; if (opacity != 255) { frame->color = new ColorTransform(); setColorTransform(*frame->color, opacity); } return frame; }
void libcdr::CDRParserState::setColorTransform(librevenge::RVNGInputStream *input) { if (!input) return; unsigned long numBytesRead = 0; const unsigned char *tmpProfile = input->read((unsigned long)-1, numBytesRead); if (!numBytesRead) return; std::vector<unsigned char> profile(numBytesRead); memcpy(&profile[0], tmpProfile, numBytesRead); setColorTransform(profile); }