style: unify identifier naming per updated conventions
Automated with clang-tidy readability-identifier-naming (config added to .clang-tidy) plus scripted passes, per the updated rules now documented in CONTRIBUTING.md: - types (class/struct/enum/alias/template params): PascalCase - functions, variables, members: snake_case (incl. rational -> Rational) - private/protected members: trailing underscore; static member variables likewise (instance_, available_themes_) - constants and enum values: snake_case (kLinear -> k_linear, F32P -> f32p); ALL_CAPS reserved for macros - macros: OAK_ prefix (OLIVE_ADD_TEST/OLIVE_ASSERT/OLIVE_CONFIG -> OAK_ADD_TEST/OAK_ASSERT/OAK_CONFIG, GL_PREAMBLE -> OAK_GL_PREAMBLE, include guards -> OAK_*) - file names: all lowercase (Current/Plugin/OliveHost/OliveClip/ OlivePluginInstance -> current/plugin/olivehost/oliveclip/ oliveplugininstance) - getters share the member name sans underscore, setters set_foo() - Qt and third-party (OpenFX) virtual overrides and framework callbacks keep their original names (exempt in .clang-tidy) Manual follow-ups required where automation could not reach: - string-based QMetaObject/SIGNAL/SLOT references updated to renamed methods (AddTask, CreatedFile, DeleteSpecificFile, moveSelectionUp, ...) - macro bodies referencing renamed methods (OLIVE_CONFIG, NODE_DEFAULT_DESTRUCTOR, MANAGEDDISPLAYWIDGET_*) - self-shadowing locals renamed where signals/methods became same-named (size_changed, worker_count, selected_items, import param, filters) - third_party OFX member/namespace usages restored (OFX::Host::*, _created, _clipPrefsDirty, createInstance, clearPersistentMessage) - STL protocol aliases restored (const_iterator) with .clang-tidy ignore rules; qHash overloads restored Full build and test suite pass: ctest 4/4, ~1960 gtest cases green.
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
|
||||
#include "ofxImageEffect.h"
|
||||
#include "ofxhClip.h"
|
||||
#include "pluginSupport/OliveClip.h"
|
||||
#include "pluginSupport/oliveclip.h"
|
||||
#include "pluginSupport/image.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
olive::VideoParams MakeParams(int width, int height,
|
||||
olive::VideoParams make_params(int width, int height,
|
||||
olive::core::PixelFormat format, int channels,
|
||||
bool premultiplied)
|
||||
{
|
||||
@@ -25,19 +25,19 @@ TEST(PluginSupportImage, AllocateFromParamsSetsProperties)
|
||||
{
|
||||
OFX::Host::ImageEffect::ClipDescriptor desc(kOfxImageEffectOutputClipName);
|
||||
olive::VideoParams params =
|
||||
MakeParams(640, 480, olive::core::PixelFormat::U8, 4, true);
|
||||
make_params(640, 480, olive::core::PixelFormat::u8, 4, true);
|
||||
olive::plugin::OliveClipInstance clip(nullptr, desc, params);
|
||||
|
||||
olive::plugin::Image image(clip);
|
||||
OfxRectI bounds = { 0, 0, 640, 480 };
|
||||
OfxRectI rod = bounds;
|
||||
image.AllocateFromParams(params, bounds, rod, true);
|
||||
image.allocate_from_params(params, bounds, rod, true);
|
||||
|
||||
EXPECT_NE(image.data(), nullptr);
|
||||
EXPECT_EQ(image.width(), 640);
|
||||
EXPECT_EQ(image.height(), 480);
|
||||
EXPECT_EQ(image.row_bytes(), 640 * 4);
|
||||
EXPECT_EQ(image.pixel_format(), olive::core::PixelFormat::U8);
|
||||
EXPECT_EQ(image.pixel_format(), olive::core::PixelFormat::u8);
|
||||
EXPECT_EQ(image.channel_count(), 4);
|
||||
EXPECT_TRUE(image.premultiplied_alpha());
|
||||
}
|
||||
@@ -46,21 +46,21 @@ TEST(PluginSupportImage, EnsureAllocatedFromParamsClearsAndResizes)
|
||||
{
|
||||
OFX::Host::ImageEffect::ClipDescriptor desc(kOfxImageEffectOutputClipName);
|
||||
olive::VideoParams params =
|
||||
MakeParams(64, 32, olive::core::PixelFormat::U8, 3, false);
|
||||
make_params(64, 32, olive::core::PixelFormat::u8, 3, false);
|
||||
olive::plugin::OliveClipInstance clip(nullptr, desc, params);
|
||||
|
||||
olive::plugin::Image image(clip);
|
||||
OfxRectI bounds = { 0, 0, 64, 32 };
|
||||
OfxRectI rod = bounds;
|
||||
image.AllocateFromParams(params, bounds, rod, true);
|
||||
image.allocate_from_params(params, bounds, rod, true);
|
||||
ASSERT_NE(image.data(), nullptr);
|
||||
image.data()[0] = 0xAB;
|
||||
|
||||
image.EnsureAllocatedFromParams(params, bounds, rod, true);
|
||||
image.ensure_allocated_from_params(params, bounds, rod, true);
|
||||
EXPECT_EQ(image.data()[0], 0);
|
||||
|
||||
OfxRectI new_bounds = { 0, 0, 16, 16 };
|
||||
image.EnsureAllocatedFromParams(params, new_bounds, rod, false);
|
||||
image.ensure_allocated_from_params(params, new_bounds, rod, false);
|
||||
EXPECT_EQ(image.width(), 16);
|
||||
EXPECT_EQ(image.height(), 16);
|
||||
}
|
||||
@@ -69,7 +69,7 @@ TEST(PluginSupportImage, PropertyFallbacks)
|
||||
{
|
||||
OFX::Host::ImageEffect::ClipDescriptor desc(kOfxImageEffectOutputClipName);
|
||||
olive::VideoParams params =
|
||||
MakeParams(1, 1, olive::core::PixelFormat::INVALID, 0, false);
|
||||
make_params(1, 1, olive::core::PixelFormat::invalid, 0, false);
|
||||
olive::plugin::OliveClipInstance clip(nullptr, desc, params);
|
||||
|
||||
olive::plugin::Image image(clip);
|
||||
@@ -83,7 +83,7 @@ TEST(PluginSupportImage, PropertyFallbacks)
|
||||
image.setIntProperty(kOfxImagePropBounds, 42, 2);
|
||||
image.setIntProperty(kOfxImagePropBounds, 70, 3);
|
||||
|
||||
EXPECT_EQ(image.pixel_format(), olive::core::PixelFormat::F16);
|
||||
EXPECT_EQ(image.pixel_format(), olive::core::PixelFormat::f16);
|
||||
EXPECT_EQ(image.channel_count(), 3);
|
||||
EXPECT_TRUE(image.premultiplied_alpha());
|
||||
EXPECT_EQ(image.width(), 32);
|
||||
@@ -94,13 +94,13 @@ TEST(PluginSupportImage, AllocateSetsOfxProperties)
|
||||
{
|
||||
OFX::Host::ImageEffect::ClipDescriptor desc(kOfxImageEffectOutputClipName);
|
||||
olive::VideoParams params =
|
||||
MakeParams(8, 6, olive::core::PixelFormat::F16, 4, false);
|
||||
make_params(8, 6, olive::core::PixelFormat::f16, 4, false);
|
||||
olive::plugin::OliveClipInstance clip(nullptr, desc, params);
|
||||
|
||||
olive::plugin::Image image(clip);
|
||||
OfxRectI bounds = { 2, 3, 10, 9 };
|
||||
OfxRectI rod = { 0, 0, 12, 12 };
|
||||
image.Allocate(8, 6, olive::core::PixelFormat::F16, 4, false, bounds, rod,
|
||||
image.allocate(8, 6, olive::core::PixelFormat::f16, 4, false, bounds, rod,
|
||||
true);
|
||||
|
||||
EXPECT_NE(image.data(), nullptr);
|
||||
@@ -132,16 +132,16 @@ TEST(PluginSupportImage, EnsureAllocatedPreservesWithoutClear)
|
||||
{
|
||||
OFX::Host::ImageEffect::ClipDescriptor desc(kOfxImageEffectOutputClipName);
|
||||
olive::VideoParams params =
|
||||
MakeParams(4, 4, olive::core::PixelFormat::U8, 3, false);
|
||||
make_params(4, 4, olive::core::PixelFormat::u8, 3, false);
|
||||
olive::plugin::OliveClipInstance clip(nullptr, desc, params);
|
||||
|
||||
olive::plugin::Image image(clip);
|
||||
OfxRectI bounds = { 0, 0, 4, 4 };
|
||||
OfxRectI rod = bounds;
|
||||
image.AllocateFromParams(params, bounds, rod, true);
|
||||
image.allocate_from_params(params, bounds, rod, true);
|
||||
ASSERT_NE(image.data(), nullptr);
|
||||
image.data()[0] = 0x5A;
|
||||
|
||||
image.EnsureAllocatedFromParams(params, bounds, rod, false);
|
||||
image.ensure_allocated_from_params(params, bounds, rod, false);
|
||||
EXPECT_EQ(image.data()[0], 0x5A);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user