Skip to content

Commit

Permalink
Use IMATH_NAMESPACE in place of Imath (#1613)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-targett authored Jun 3, 2023
1 parent 62bd64d commit 45c6cfd
Show file tree
Hide file tree
Showing 26 changed files with 118 additions and 118 deletions.
6 changes: 3 additions & 3 deletions src/opentimelineio/clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Clip::available_range(ErrorStatus* error_status) const
return active_media->available_range().value();
}

optional<Imath::Box2d>
optional<IMATH_NAMESPACE::Box2d>
Clip::available_image_bounds(ErrorStatus* error_status) const
{
auto active_media = media_reference();
Expand All @@ -194,7 +194,7 @@ Clip::available_image_bounds(ErrorStatus* error_status) const
ErrorStatus::CANNOT_COMPUTE_BOUNDS,
"No image bounds set on clip",
this);
return optional<Imath::Box2d>();
return optional<IMATH_NAMESPACE::Box2d>();
}

if (!active_media->available_image_bounds())
Expand All @@ -203,7 +203,7 @@ Clip::available_image_bounds(ErrorStatus* error_status) const
ErrorStatus::CANNOT_COMPUTE_BOUNDS,
"No image bounds set on media reference on clip",
this);
return optional<Imath::Box2d>();
return optional<IMATH_NAMESPACE::Box2d>();
}

return active_media->available_image_bounds();
Expand Down
2 changes: 1 addition & 1 deletion src/opentimelineio/clip.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Clip : public Item
TimeRange
available_range(ErrorStatus* error_status = nullptr) const override;

optional<Imath::Box2d>
optional<IMATH_NAMESPACE::Box2d>
available_image_bounds(ErrorStatus* error_status) const override;

protected:
Expand Down
4 changes: 2 additions & 2 deletions src/opentimelineio/composable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ Composable::duration(ErrorStatus* error_status) const
return RationalTime();
}

optional<Imath::Box2d>
optional<IMATH_NAMESPACE::Box2d>
Composable::available_image_bounds(ErrorStatus* error_status) const
{
*error_status = ErrorStatus::NOT_IMPLEMENTED;
return optional<Imath::Box2d>();
return optional<IMATH_NAMESPACE::Box2d>();
}

}} // namespace opentimelineio::OPENTIMELINEIO_VERSION
2 changes: 1 addition & 1 deletion src/opentimelineio/composable.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Composable : public SerializableObjectWithMetadata

virtual RationalTime duration(ErrorStatus* error_status = nullptr) const;

virtual optional<Imath::Box2d>
virtual optional<IMATH_NAMESPACE::Box2d>
available_image_bounds(ErrorStatus* error_status) const;

protected:
Expand Down
12 changes: 6 additions & 6 deletions src/opentimelineio/deserialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,14 @@ SerializableObject::Reader::_decode(_Resolver& resolver)
else if (schema_name_and_version == "V2d.1")
{
double x, y;
return _fetch("x", &x) && _fetch("y", &y) ? any(Imath::V2d(x, y))
return _fetch("x", &x) && _fetch("y", &y) ? any(IMATH_NAMESPACE::V2d(x, y))
: any();
}
else if (schema_name_and_version == "Box2d.1")
{
Imath::V2d min, max;
IMATH_NAMESPACE::V2d min, max;
return _fetch("min", &min) && _fetch("max", &max)
? any(Imath::Box2d(std::move(min), std::move(max)))
? any(IMATH_NAMESPACE::Box2d(std::move(min), std::move(max)))
: any();
}
else
Expand Down Expand Up @@ -743,13 +743,13 @@ SerializableObject::Reader::read(std::string const& key, AnyVector* value)
}

bool
SerializableObject::Reader::read(std::string const& key, Imath::V2d* value)
SerializableObject::Reader::read(std::string const& key, IMATH_NAMESPACE::V2d* value)
{
return _fetch(key, value);
}

bool
SerializableObject::Reader::read(std::string const& key, Imath::Box2d* value)
SerializableObject::Reader::read(std::string const& key, IMATH_NAMESPACE::Box2d* value)
{
return _fetch(key, value);
}
Expand Down Expand Up @@ -817,7 +817,7 @@ SerializableObject::Reader::read(
bool
SerializableObject::Reader::read(
std::string const& key,
optional<Imath::Box2d>* value)
optional<IMATH_NAMESPACE::Box2d>* value)
{
return _read_optional(key, value);
}
Expand Down
2 changes: 1 addition & 1 deletion src/opentimelineio/externalReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ExternalReference::ExternalReference(
std::string const& target_url,
optional<TimeRange> const& available_range,
AnyDictionary const& metadata,
optional<Imath::Box2d> const& available_image_bounds)
optional<IMATH_NAMESPACE::Box2d> const& available_image_bounds)
: Parent(std::string(), available_range, metadata, available_image_bounds)
, _target_url(target_url)
{}
Expand Down
2 changes: 1 addition & 1 deletion src/opentimelineio/externalReference.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ExternalReference final : public MediaReference
std::string const& target_url = std::string(),
optional<TimeRange> const& available_range = nullopt,
AnyDictionary const& metadata = AnyDictionary(),
optional<Imath::Box2d> const& available_image_bounds = nullopt);
optional<IMATH_NAMESPACE::Box2d> const& available_image_bounds = nullopt);

std::string target_url() const noexcept { return _target_url; }

Expand Down
2 changes: 1 addition & 1 deletion src/opentimelineio/generatorReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GeneratorReference::GeneratorReference(
optional<TimeRange> const& available_range,
AnyDictionary const& parameters,
AnyDictionary const& metadata,
optional<Imath::Box2d> const& available_image_bounds)
optional<IMATH_NAMESPACE::Box2d> const& available_image_bounds)
: Parent(name, available_range, metadata, available_image_bounds)
, _generator_kind(generator_kind)
, _parameters(parameters)
Expand Down
2 changes: 1 addition & 1 deletion src/opentimelineio/generatorReference.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class GeneratorReference final : public MediaReference
optional<TimeRange> const& available_range = nullopt,
AnyDictionary const& parameters = AnyDictionary(),
AnyDictionary const& metadata = AnyDictionary(),
optional<Imath::Box2d> const& available_image_bounds = nullopt);
optional<IMATH_NAMESPACE::Box2d> const& available_image_bounds = nullopt);

std::string generator_kind() const noexcept { return _generator_kind; }

Expand Down
2 changes: 1 addition & 1 deletion src/opentimelineio/imageSequenceReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ImageSequenceReference::ImageSequenceReference(
MissingFramePolicy const missing_frame_policy,
optional<TimeRange> const& available_range,
AnyDictionary const& metadata,
optional<Imath::Box2d> const& available_image_bounds)
optional<IMATH_NAMESPACE::Box2d> const& available_image_bounds)
: Parent(std::string(), available_range, metadata, available_image_bounds)
, _target_url_base(target_url_base)
, _name_prefix(name_prefix)
Expand Down
2 changes: 1 addition & 1 deletion src/opentimelineio/imageSequenceReference.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ImageSequenceReference final : public MediaReference
MissingFramePolicy::error,
optional<TimeRange> const& available_range = nullopt,
AnyDictionary const& metadata = AnyDictionary(),
optional<Imath::Box2d> const& available_image_bounds = nullopt);
optional<IMATH_NAMESPACE::Box2d> const& available_image_bounds = nullopt);

std::string target_url_base() const noexcept { return _target_url_base; }

Expand Down
2 changes: 1 addition & 1 deletion src/opentimelineio/mediaReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ MediaReference::MediaReference(
std::string const& name,
optional<TimeRange> const& available_range,
AnyDictionary const& metadata,
optional<Imath::Box2d> const& available_image_bounds)
optional<IMATH_NAMESPACE::Box2d> const& available_image_bounds)
: Parent(name, metadata)
, _available_range(available_range)
, _available_image_bounds(available_image_bounds)
Expand Down
8 changes: 4 additions & 4 deletions src/opentimelineio/mediaReference.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class MediaReference : public SerializableObjectWithMetadata
std::string const& name = std::string(),
optional<TimeRange> const& available_range = nullopt,
AnyDictionary const& metadata = AnyDictionary(),
optional<Imath::Box2d> const& available_image_bounds = nullopt);
optional<IMATH_NAMESPACE::Box2d> const& available_image_bounds = nullopt);

optional<TimeRange> available_range() const noexcept
{
Expand All @@ -41,13 +41,13 @@ class MediaReference : public SerializableObjectWithMetadata

virtual bool is_missing_reference() const;

optional<Imath::Box2d> available_image_bounds() const
optional<IMATH_NAMESPACE::Box2d> available_image_bounds() const
{
return _available_image_bounds;
}

void set_available_image_bounds(
optional<Imath::Box2d> const& available_image_bounds)
optional<IMATH_NAMESPACE::Box2d> const& available_image_bounds)
{
_available_image_bounds = available_image_bounds;
}
Expand All @@ -60,7 +60,7 @@ class MediaReference : public SerializableObjectWithMetadata

private:
optional<TimeRange> _available_range;
optional<Imath::Box2d> _available_image_bounds;
optional<IMATH_NAMESPACE::Box2d> _available_image_bounds;
};

}} // namespace opentimelineio::OPENTIMELINEIO_VERSION
2 changes: 1 addition & 1 deletion src/opentimelineio/missingReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ MissingReference::MissingReference(
std::string const& name,
optional<TimeRange> const& available_range,
AnyDictionary const& metadata,
optional<Imath::Box2d> const& available_image_bounds)
optional<IMATH_NAMESPACE::Box2d> const& available_image_bounds)
: Parent(name, available_range, metadata, available_image_bounds)
{}

Expand Down
2 changes: 1 addition & 1 deletion src/opentimelineio/missingReference.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MissingReference final : public MediaReference
std::string const& name = std::string(),
optional<TimeRange> const& available_range = nullopt,
AnyDictionary const& metadata = AnyDictionary(),
optional<Imath::Box2d> const& available_image_bounds = nullopt);
optional<IMATH_NAMESPACE::Box2d> const& available_image_bounds = nullopt);

bool is_missing_reference() const override;

Expand Down
12 changes: 6 additions & 6 deletions src/opentimelineio/safely_typed_any.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ create_safely_typed_any(TimeTransform&& value)
}

any
create_safely_typed_any(Imath::V2d&& value)
create_safely_typed_any(IMATH_NAMESPACE::V2d&& value)
{
return any(value);
}

any
create_safely_typed_any(Imath::Box2d&& value)
create_safely_typed_any(IMATH_NAMESPACE::Box2d&& value)
{
return any(value);
}
Expand Down Expand Up @@ -143,16 +143,16 @@ safely_cast_time_transform_any(any const& a)
return any_cast<TimeTransform>(a);
}

Imath::V2d
IMATH_NAMESPACE::V2d
safely_cast_point_any(any const& a)
{
return any_cast<Imath::V2d>(a);
return any_cast<IMATH_NAMESPACE::V2d>(a);
}

Imath::Box2d
IMATH_NAMESPACE::Box2d
safely_cast_box_any(any const& a)
{
return any_cast<Imath::Box2d>(a);
return any_cast<IMATH_NAMESPACE::Box2d>(a);
}

AnyDictionary
Expand Down
8 changes: 4 additions & 4 deletions src/opentimelineio/safely_typed_any.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ any create_safely_typed_any(std::string&&);
any create_safely_typed_any(RationalTime&&);
any create_safely_typed_any(TimeRange&&);
any create_safely_typed_any(TimeTransform&&);
any create_safely_typed_any(Imath::V2d&&);
any create_safely_typed_any(Imath::Box2d&&);
any create_safely_typed_any(IMATH_NAMESPACE::V2d&&);
any create_safely_typed_any(IMATH_NAMESPACE::Box2d&&);
any create_safely_typed_any(AnyVector&&);
any create_safely_typed_any(AnyDictionary&&);
any create_safely_typed_any(SerializableObject*);
Expand All @@ -51,8 +51,8 @@ std::string safely_cast_string_any(any const& a);
RationalTime safely_cast_rational_time_any(any const& a);
TimeRange safely_cast_time_range_any(any const& a);
TimeTransform safely_cast_time_transform_any(any const& a);
Imath::V2d safely_cast_point_any(any const& a);
Imath::Box2d safely_cast_box_any(any const& a);
IMATH_NAMESPACE::V2d safely_cast_point_any(any const& a);
IMATH_NAMESPACE::Box2d safely_cast_box_any(any const& a);

SerializableObject* safely_cast_retainer_any(any const& a);

Expand Down
12 changes: 6 additions & 6 deletions src/opentimelineio/serializableObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ class SerializableObject
bool read(std::string const& key, RationalTime* dest);
bool read(std::string const& key, TimeRange* dest);
bool read(std::string const& key, class TimeTransform* dest);
bool read(std::string const& key, Imath::V2d* value);
bool read(std::string const& key, Imath::Box2d* value);
bool read(std::string const& key, IMATH_NAMESPACE::V2d* value);
bool read(std::string const& key, IMATH_NAMESPACE::Box2d* value);
bool read(std::string const& key, AnyVector* dest);
bool read(std::string const& key, AnyDictionary* dest);
bool read(std::string const& key, any* dest);
Expand All @@ -109,7 +109,7 @@ class SerializableObject
bool read(std::string const& key, optional<RationalTime>* dest);
bool read(std::string const& key, optional<TimeRange>* dest);
bool read(std::string const& key, optional<TimeTransform>* dest);
bool read(std::string const& key, optional<Imath::Box2d>* value);
bool read(std::string const& key, optional<IMATH_NAMESPACE::Box2d>* value);

// skipping std::string because we translate null into the empty
// string, so the conversion is somewhat ambiguous
Expand Down Expand Up @@ -415,11 +415,11 @@ class SerializableObject
void write(std::string const& key, std::string const& value);
void write(std::string const& key, RationalTime value);
void write(std::string const& key, TimeRange value);
void write(std::string const& key, Imath::V2d value);
void write(std::string const& key, Imath::Box2d value);
void write(std::string const& key, IMATH_NAMESPACE::V2d value);
void write(std::string const& key, IMATH_NAMESPACE::Box2d value);
void write(std::string const& key, optional<RationalTime> value);
void write(std::string const& key, optional<TimeRange> value);
void write(std::string const& key, optional<Imath::Box2d> value);
void write(std::string const& key, optional<IMATH_NAMESPACE::Box2d> value);
void write(std::string const& key, class TimeTransform value);
void write(std::string const& key, SerializableObject const* value);
void write(std::string const& key, SerializableObject* value)
Expand Down
Loading

0 comments on commit 45c6cfd

Please sign in to comment.