本文整理汇总了C++中MLSignal::getSize方法的典型用法代码示例。如果您正苦于以下问题:C++ MLSignal::getSize方法的具体用法?C++ MLSignal::getSize怎么用?C++ MLSignal::getSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MLSignal
的用法示例。
在下文中一共展示了MLSignal::getSize方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sigLerp
// TODO SSE
void MLSignal::sigLerp(const MLSignal& b, const MLSignal& mix)
{
int n = min(mSize, b.getSize());
n = min(n, mix.getSize());
for(int i = 0; i < n; ++i)
{
mDataAligned[i] = lerp(mDataAligned[i], b.mDataAligned[i], mix.mDataAligned[i]);
}
setConstant(false);
}
示例2: sigClamp
// TODO SSE
void MLSignal::sigClamp(const MLSignal& a, const MLSignal& b)
{
int n = min(mSize, a.getSize());
n = min(n, b.getSize());
for(int i = 0; i < n; ++i)
{
MLSample f = mDataAligned[i];
mDataAligned[i] = clamp(f, a.mDataAligned[i], b.mDataAligned[i]);
}
setConstant(false);
}
示例3: sigMax
void MLSignal::sigMax(const MLSignal& b)
{
int n = min(mSize, b.getSize());
for(int i = 0; i < n; ++i)
{
MLSample f = mDataAligned[i];
mDataAligned[i] = max(f, b.mDataAligned[i]);
}
setConstant(false);
}
示例4: copy
void MLSignal::copy(const MLSignal& b)
{
const bool kb = b.isConstant();
if (kb)
{
setToConstant(b.mDataAligned[0]);
}
else
{
const int n = min(mSize, b.getSize());
std::copy(b.mDataAligned, b.mDataAligned + n, mDataAligned);
setConstant(false);
}
}
示例5: setFrame
// setFrame() - set the 2D frame i to the incoming signal.
void MLSignal::setFrame(int i, const MLSignal& src)
{
// only valid for 3D signals
assert(is3D());
// source must be 2D
assert(src.is2D());
// src signal should match our dimensions
if((src.getWidth() != mWidth) || (src.getHeight() != mHeight))
{
return;
}
MLSample* pDestFrame = mDataAligned + plane(i);
const MLSample* pSrc = src.getConstBuffer();
std::copy(pSrc, pSrc + src.getSize(), pDestFrame);
}
示例6: divide
// TODO SSE
void MLSignal::divide(const MLSignal& b)
{
const bool ka = isConstant();
const bool kb = b.isConstant();
if (ka && kb)
{
setToConstant(mDataAligned[0] + b.mDataAligned[0]);
}
else
{
const int n = min(mSize, b.getSize());
if (ka && !kb)
{
MLSample fa = mDataAligned[0];
for(int i = 0; i < n; ++i)
{
mDataAligned[i] = fa / b[i];
}
}
else if (!ka && kb)
{
MLSample fb = b[0];
for(int i = 0; i < n; ++i)
{
mDataAligned[i] /= fb;
}
}
else
{
for(int i = 0; i < n; ++i)
{
mDataAligned[i] /= b.mDataAligned[i];
}
}
setConstant(false);
}
}