Ejemplo n.º 1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="samplingDivider"></param>
 /// <param name="morphingMethod"></param>
 public CvAdaptiveSkinDetector(int samplingDivider, MorphingMethod morphingMethod)
 {
     ptr = CppInvoke.CvAdaptiveSkinDetector_new(samplingDivider, morphingMethod);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="samplingDivider"></param>
 /// <param name="morphingMethod"></param>
 public CvAdaptiveSkinDetector(int samplingDivider, MorphingMethod morphingMethod)
 {
     ptr = NativeMethods.contrib_CvAdaptiveSkinDetector_new(samplingDivider, (int)morphingMethod);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create an Adaptive Skin Detector
 /// </summary>
 /// <param name="samplingDivider">Use 1 for default</param>
 /// <param name="morphingMethod">The morphine method for the skin detector</param>
 public AdaptiveSkinDetector(int samplingDivider, MorphingMethod morphingMethod)
 {
    _ptr = CvInvoke.CvAdaptiveSkinDetectorCreate(samplingDivider, morphingMethod);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create an Adaptive Skin Detector
 /// </summary>
 /// <param name="samplingDivider">Use 1 for default</param>
 /// <param name="morphingMethod">The morphine method for the skin detector</param>
 public AdaptiveSkinDetector(int samplingDivider, MorphingMethod morphingMethod)
 {
     _ptr = CvAdaptiveSkinDetectorCreate(samplingDivider, morphingMethod);
 }
Ejemplo n.º 5
0
 private extern static IntPtr CvAdaptiveSkinDetectorCreate(int samplingDivider, MorphingMethod morphingMethod);
Ejemplo n.º 6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="samplingDivider"></param>
 /// <param name="morphingMethod"></param>
 public CvAdaptiveSkinDetector(
     int samplingDivider           = 1,
     MorphingMethod morphingMethod = MorphingMethod.None)
 {
     ptr = NativeMethods.contrib_CvAdaptiveSkinDetector_new(samplingDivider, (int)morphingMethod);
 }
Ejemplo n.º 7
0
 private static extern IntPtr CvAdaptiveSkinDetectorCreate(int samplingDivider, MorphingMethod morphingMethod);
Ejemplo n.º 8
0
        /// <summary>
        /// Reads the unmanaged data from the native value.
        /// </summary>
        /// <param name="nativeValue">Input native value</param>
        void IMarshalable <Mesh, AiMesh> .FromNative(ref AiMesh nativeValue)
        {
            ClearBuffers();

            int vertexCount = (int)nativeValue.NumVertices;

            m_name          = nativeValue.Name.GetString();
            m_materialIndex = (int)nativeValue.MaterialIndex;
            m_morphing      = nativeValue.Morphing;

            //Load Per-vertex components
            if (vertexCount > 0)
            {
                //Positions
                if (nativeValue.Vertices != IntPtr.Zero)
                {
                    m_vertices.AddRange(MemoryHelper.FromNativeArray <Vector3D>(nativeValue.Vertices, vertexCount));
                }

                //Normals
                if (nativeValue.Normals != IntPtr.Zero)
                {
                    m_normals.AddRange(MemoryHelper.FromNativeArray <Vector3D>(nativeValue.Normals, vertexCount));
                }

                //Tangents
                if (nativeValue.Tangents != IntPtr.Zero)
                {
                    m_tangents.AddRange(MemoryHelper.FromNativeArray <Vector3D>(nativeValue.Tangents, vertexCount));
                }

                //BiTangents
                if (nativeValue.BiTangents != IntPtr.Zero)
                {
                    m_bitangents.AddRange(MemoryHelper.FromNativeArray <Vector3D>(nativeValue.BiTangents, vertexCount));
                }

                //Vertex Color channels
                for (int i = 0; i < nativeValue.Colors.Length; i++)
                {
                    IntPtr colorPtr = nativeValue.Colors[i];

                    if (colorPtr != IntPtr.Zero)
                    {
                        m_colors[i].AddRange(MemoryHelper.FromNativeArray <Color4D>(colorPtr, vertexCount));
                    }
                }

                //Texture coordinate channels
                for (int i = 0; i < nativeValue.TextureCoords.Length; i++)
                {
                    IntPtr texCoordsPtr = nativeValue.TextureCoords[i];

                    if (texCoordsPtr != IntPtr.Zero)
                    {
                        m_texCoords[i].AddRange(MemoryHelper.FromNativeArray <Vector3D>(texCoordsPtr, vertexCount));
                    }
                }

                //UV components for each tex coordinate channel
                for (int i = 0; i < nativeValue.NumUVComponents.Length; i++)
                {
                    m_texComponentCount[i] = (int)nativeValue.NumUVComponents[i];
                }
            }

            //Faces
            if (nativeValue.NumFaces > 0 && nativeValue.Faces != IntPtr.Zero)
            {
                m_faces.AddRange(MemoryHelper.FromNativeArray <Face, AiFace>(nativeValue.Faces, (int)nativeValue.NumFaces));
            }

            //Bones
            if (nativeValue.NumBones > 0 && nativeValue.Bones != IntPtr.Zero)
            {
                m_bones.AddRange(MemoryHelper.FromNativeArray <Bone, AiBone>(nativeValue.Bones, (int)nativeValue.NumBones, true));
            }

            //Attachment meshes
            if (nativeValue.NumAnimMeshes > 0 && nativeValue.AnimMeshes != IntPtr.Zero)
            {
                m_meshAttachments.AddRange(MemoryHelper.FromNativeArray <MeshAnimationAttachment, AiAnimMesh>(nativeValue.AnimMeshes, (int)nativeValue.NumAnimMeshes, true));
            }
        }