|
37 | 37 | #import "opentimelineio.h" |
38 | 38 | #import "opentime.h" |
39 | 39 | #import "errorStruct.h" |
40 | | -#import "CxxBox.h" |
41 | 40 | #import "CxxVectorProperty.h" |
42 | 41 |
|
43 | 42 | namespace otio = opentimelineio::OPENTIMELINEIO_VERSION; |
@@ -632,30 +631,30 @@ void media_reference_clear_available_range(CxxRetainer* self) { |
632 | 631 | SO_cast<otio::MediaReference>(self)->set_available_range(std::nullopt); |
633 | 632 | } |
634 | 633 |
|
635 | | -bool media_reference_available_image_bounds(CxxRetainer* self, CxxBox2D* ib) { |
| 634 | +bool media_reference_available_image_bounds(CxxRetainer* self, CGRect* rect) { |
636 | 635 | std::optional<IMATH_NAMESPACE::Box2d> iBox2D = SO_cast<otio::MediaReference>(self)->available_image_bounds(); |
637 | 636 |
|
638 | | - if (iBox2D && ib) { |
639 | | - ib->minX = iBox2D->min.x; |
640 | | - ib->minY = iBox2D->min.y; |
641 | | - ib->maxX = iBox2D->max.x; |
642 | | - ib->maxX = iBox2D->max.y; |
| 637 | + if (iBox2D && rect) { |
| 638 | + rect->origin.x = iBox2D->min.x; |
| 639 | + rect->origin.y = iBox2D->min.y; |
| 640 | + rect->size.width = iBox2D->max.x - iBox2D->min.x; |
| 641 | + rect->size.height = iBox2D->max.y - iBox2D->max.y; |
643 | 642 |
|
644 | 643 | return true; |
645 | 644 | } |
646 | 645 |
|
647 | | - ib = NULL; |
| 646 | + rect = NULL; |
648 | 647 |
|
649 | 648 | return false; |
650 | 649 | } |
651 | 650 |
|
652 | | -void media_reference_set_available_image_bounds(CxxRetainer* self, CxxBox2D image_bounds) { |
| 651 | +void media_reference_set_available_image_bounds(CxxRetainer* self, CGRect image_bounds) { |
653 | 652 | std::optional<IMATH_NAMESPACE::Box2d> iBox2D = std::optional<IMATH_NAMESPACE::Box2d>(); |
654 | 653 |
|
655 | | - iBox2D->min.x = image_bounds.minX; |
656 | | - iBox2D->min.y = image_bounds.minY; |
657 | | - iBox2D->max.x = image_bounds.maxX; |
658 | | - iBox2D->max.y = image_bounds.maxX; |
| 654 | + iBox2D->min.x = image_bounds.origin.x; |
| 655 | + iBox2D->min.y = image_bounds.origin.y; |
| 656 | + iBox2D->max.x = image_bounds.size.width + image_bounds.origin.x; |
| 657 | + iBox2D->max.y = image_bounds.size.height + image_bounds.origin.y; |
659 | 658 |
|
660 | 659 | SO_cast<otio::MediaReference>(self)->set_available_image_bounds(iBox2D); |
661 | 660 | } |
|
0 commit comments