MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / GetBoxValues

Method GetBoxValues

src/TrackedObjectBBox.cpp:498–522  ·  view source on GitHub ↗

Return a map that contains the bounding box properties and it's keyframes indexed by their names

Source from the content-addressed store, hash-verified

496
497// Return a map that contains the bounding box properties and it's keyframes indexed by their names
498std::map<std::string, float> TrackedObjectBBox::GetBoxValues(int64_t frame_number) const {
499
500 // Create the map
501 std::map<std::string, float> boxValues;
502
503 // Get bounding box of the current frame
504 BBox box = GetBox(frame_number);
505
506 // Save the bounding box properties
507 boxValues["cx"] = box.cx;
508 boxValues["cy"] = box.cy;
509 boxValues["w"] = box.width;
510 boxValues["h"] = box.height;
511 boxValues["ang"] = box.angle;
512
513 // Save the keyframes values
514 boxValues["sx"] = this->scale_x.GetValue(frame_number);
515 boxValues["sy"] = this->scale_y.GetValue(frame_number);
516 boxValues["dx"] = this->delta_x.GetValue(frame_number);
517 boxValues["dy"] = this->delta_y.GetValue(frame_number);
518 boxValues["r"] = this->rotation.GetValue(frame_number);
519
520
521 return boxValues;
522}

Callers 2

get_transformMethod · 0.45
KeyFrame.cppFile · 0.45

Calls 1

GetValueMethod · 0.80

Tested by

no test coverage detected