Example #1
0
        /// <summary>
        /// Creates a Huffman table in a format that is suitable for the encoder.
        /// </summary>
        /// <param name="pRawHuffmanTable">Huffman table formated as specified in the JPEG standard.</param>
        /// <param name="eTableType">Enum specifying type of table (nppiDCTable or nppiACTable).</param>
        /// <param name="pHuffmanSpec">Pointer to the Huffman table for the decoder</param>
        /// <returns>Huffman table for the encoder</returns>
        public static void EncodeHuffmanSpecInit(byte[] pRawHuffmanTable, NppiHuffmanTableType eTableType, NppiEncodeHuffmanSpec pHuffmanSpec)
        {
            NppStatus status;

            status = NPPNativeMethods.NPPi.CompressionDCT.nppiEncodeHuffmanSpecInit_JPEG(pRawHuffmanTable, eTableType, pHuffmanSpec);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiEncodeHuffmanSpecInit_JPEG", status));
            NPPException.CheckNppStatus(status, null);
        }
Example #2
0
        /// <summary>
        /// Allocates memory and creates a Huffman table in a format that is suitable for the encoder.
        /// </summary>
        /// <param name="pRawHuffmanTable">Huffman table formated as specified in the JPEG standard.</param>
        /// <param name="eTableType">Enum specifying type of table (nppiDCTable or nppiACTable).</param>
        /// <returns>Huffman table for the encoder.</returns>
        public static NppiEncodeHuffmanSpec EncodeHuffmanSpecInitAlloc(byte[] pRawHuffmanTable, NppiHuffmanTableType eTableType)
        {
            NppiEncodeHuffmanSpec spec = new NppiEncodeHuffmanSpec();
            NppStatus             status;

            status = NPPNativeMethods.NPPi.CompressionDCT.nppiEncodeHuffmanSpecInitAlloc_JPEG(pRawHuffmanTable, eTableType, ref spec);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiEncodeHuffmanSpecInitAlloc_JPEG", status));
            NPPException.CheckNppStatus(status, null);
            return(spec);
        }
Example #3
0
 public static extern NppStatus nppiEncodeHuffmanSpecInitAlloc_JPEG(
     IntPtr pRawHuffmanTable,
     NppiHuffmanTableType eTableType,
     IntPtr ppHuffmanSpec);
Example #4
0
 public static extern NppStatus nppiDecodeHuffmanSpecInitHost_JPEG(
     IntPtr pRawHuffmanTable,
     NppiHuffmanTableType eTableType,
     IntPtr pHuffmanSpec);
Example #5
0
 /// <summary>
 /// Creates a Huffman table in a format that is suitable for the encoder.
 /// </summary>
 /// <param name="pRawHuffmanTable">Huffman table formated as specified in the JPEG standard.</param>
 /// <param name="eTableType">Enum specifying type of table (nppiDCTable or nppiACTable).</param>
 /// <param name="pHuffmanSpec">Pointer to the Huffman table for the decoder</param>
 /// <returns>Huffman table for the encoder</returns>
 public static void EncodeHuffmanSpecInit_JPEG(byte[] pRawHuffmanTable, NppiHuffmanTableType eTableType, NppiEncodeHuffmanSpec pHuffmanSpec)
 {
     NppStatus status;
     status = NPPNativeMethods.NPPi.CompressionDCT.nppiEncodeHuffmanSpecInit_JPEG(pRawHuffmanTable, eTableType, pHuffmanSpec);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiEncodeHuffmanSpecInit_JPEG", status));
     NPPException.CheckNppStatus(status, null);
 }
Example #6
0
 /// <summary>
 /// Allocates memory and creates a Huffman table in a format that is suitable for the encoder.
 /// </summary>
 /// <param name="pRawHuffmanTable">Huffman table formated as specified in the JPEG standard.</param>
 /// <param name="eTableType">Enum specifying type of table (nppiDCTable or nppiACTable).</param>
 /// <returns>Huffman table for the encoder.</returns>
 public static NppiEncodeHuffmanSpec EncodeHuffmanSpecInitAllocHost_JPEG(byte[] pRawHuffmanTable, NppiHuffmanTableType eTableType)
 {
     NppiEncodeHuffmanSpec spec = new NppiEncodeHuffmanSpec();
     NppStatus status;
     status = NPPNativeMethods.NPPi.CompressionDCT.nppiEncodeHuffmanSpecInitAlloc_JPEG(pRawHuffmanTable, eTableType, ref spec);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiEncodeHuffmanSpecInitAlloc_JPEG", status));
     NPPException.CheckNppStatus(status, null);
     return spec;
 }