コード例 #1
0
std::ostream &
operator<<(std::ostream & os,const FgImage<T> & img)
{
    return
        os << "dimensions: " << img.dims()
        << " bounds: " << fgBounds(img.m_data);
}
コード例 #2
0
FgMatrixC<T,dim,2>
fgCubeBounds(const vector<FgMatrixC<T,dim,1> > & verts,T padRatio=1)
{
    FgMatrixC<T,dim,2>  ret;
    FgMatrixC<T,dim,2>  bounds = fgBounds(verts);
    FgMatrixC<T,dim,1>  lo = bounds.colVec(0),
                        hi = bounds.colVec(1),
                        centre = (lo + hi) * T(0.5);
    T                   hsize = fgMaxElem(hi - lo) * 0.5f * padRatio;
    ret = fgConcatHoriz(centre-FgMatrixC<T,dim,1>(hsize),centre+FgMatrixC<T,dim,1>(hsize));
    return ret;
}
コード例 #3
0
inline FgMatrixC<T,1,2>
fgBounds(const FgMatrixV<T> & mat)
{
    return fgBounds(mat.dataVec());
}
コード例 #4
0
FgMatrixC<T,dim,1>
fgBoundsCentre(const std::vector<FgMatrixC<T,dim,1> > & verts)
{
    FgMatrixC<T,dim,2>  bounds = fgBounds(verts);
    return (bounds.colVector[0] + bounds.colVec(1)) * 0.5;
}
コード例 #5
0
FgMatrixC<T,nrows,1>
fgDims(const std::vector<FgMatrixC<T,nrows,1> > & vec)
{
    FgMatrixC<T,nrows,2>    bounds = fgBounds(vec);
    return (bounds.colVec(1)-bounds.colVec(0));
}