Skip to content

Instantly share code, notes, and snippets.

/****************************************************************************************\
* Perspective Transform *
\****************************************************************************************/
template<typename T> static void
perspectiveTransform_( const T* src, T* dst, const double* m, int len, int scn, int dcn )
{
const double eps = FLT_EPSILON;
int i;
import Cocoa
private func rowIndexForLayer(at rowIndex: Int, in layers: [Layer]) -> Int {
return layers.count - 1 - rowIndex
}
private func outlineViewRowIndex(for path: IndexPath, parent: LayerContainer) -> Int {
let layerIndex = path.last!
return rowIndexForLayer(at: layerIndex, in: parent.layers)
}