<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ippiFilterPrewittHorizBorder_32f_C1R in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiFilterPrewittHorizBorder-32f-C1R/m-p/1643922#M28906</link>
    <description>&lt;P&gt;Need to use,&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;ippiFilterPrewittHorizBorder_32f_C1R,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;tried it one of sample program, but it always gives&amp;nbsp;One or more input pointers are NULL error.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Validated src &amp;amp; dst images &amp;amp; roi as well.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="cpp"&gt;int main() {
    // Define image dimensions
    const int width = 512;
    const int height = 512;

    // Allocate memory for source and destination images
    Ipp32f* psrc=new (std::nothrow) Ipp32f[width * height]; // Source image (grayscale)
    Ipp32f* pDst = new (std::nothrow) Ipp32f[width * height]; // Destination image (filtered)

    // Check for memory allocation success
    if (psrc== nullptr) {
        std::cerr &amp;lt;&amp;lt; "Memory allocation for source image failed!" &amp;lt;&amp;lt; std::endl;
        return -1;
    }
    if (pDst == nullptr) {
        std::cerr &amp;lt;&amp;lt; "Memory allocation for destination image failed!" &amp;lt;&amp;lt; std::endl;
        delete[] pSrc;  // Clean up previously allocated memory
        return -1;
    }

    // Initialize source image with some data (example: simple gradient)
    for (int i = 0; i &amp;lt; height; ++i) {
        for (int j = 0; j &amp;lt; width; ++j) {
            pSrc[i * width + j] = static_cast&amp;lt;Ipp32f&amp;gt;((j + i) % 256); // Simple data initialization
        }
    }

    // Define region of interest
    IppiSize roiSize = {width, height}; // Full image
    int srcStep = width * sizeof(Ipp32f); // Step size in bytes for source image
    int dstStep = width * sizeof(Ipp32f); // Step size in bytes for destination image

    // Check ROI dimensions and step sizes
    std::cout &amp;lt;&amp;lt; "ROI Size: " &amp;lt;&amp;lt; roiSize.width &amp;lt;&amp;lt; "x" &amp;lt;&amp;lt; roiSize.height &amp;lt;&amp;lt; std::endl;
    std::cout &amp;lt;&amp;lt; "Source Step: " &amp;lt;&amp;lt; srcStep &amp;lt;&amp;lt; ", Destination Step: " &amp;lt;&amp;lt; dstStep &amp;lt;&amp;lt; std::endl;

    // Apply the Prewitt horizontal filter
    IppStatus status = ippiFilterPrewittHorizBorder_32f_C1R(
        pSrc,                 // Source pointer
        srcStep,             // Source step
        pDst,                 // Destination pointer
        dstStep,             // Destination step
        roiSize,             // ROI size
        ippMskSize3x3,
        ippBorderConst,      // Border type
        0.0f,                 // Constant border value
        nullptr
     );

    // Check for errors
    if (status != ippStsNoErr) {
        std::cerr &amp;lt;&amp;lt; "Error applying Prewitt horizontal filter: " &amp;lt;&amp;lt; status &amp;lt;&amp;lt; std::endl;
        // Output additional debugging information
        switch (status) {
            case ippStsNullPtrErr:
                std::cerr &amp;lt;&amp;lt; "One or more input pointers are NULL." &amp;lt;&amp;lt; std::endl;
                break;
            case ippStsSizeErr:
                std::cerr &amp;lt;&amp;lt; "ROI size is incorrect." &amp;lt;&amp;lt; std::endl;
                break;
            case ippStsStepErr:
                std::cerr &amp;lt;&amp;lt; "Step size is incorrect." &amp;lt;&amp;lt; std::endl;
                break;
            default:
                std::cerr &amp;lt;&amp;lt; "An unexpected error occurred." &amp;lt;&amp;lt; std::endl;
        }
    } else {
        std::cout &amp;lt;&amp;lt; "Prewitt horizontal filter applied successfully!" &amp;lt;&amp;lt; std::endl;
    }

    // Clean up
    delete[] pSrc;
    delete[] pDst;

    return 0;
}&lt;/LI-CODE&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 18 Nov 2024 10:47:08 GMT</pubDate>
    <dc:creator>Kim9</dc:creator>
    <dc:date>2024-11-18T10:47:08Z</dc:date>
    <item>
      <title>ippiFilterPrewittHorizBorder_32f_C1R</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiFilterPrewittHorizBorder-32f-C1R/m-p/1643922#M28906</link>
      <description>&lt;P&gt;Need to use,&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;ippiFilterPrewittHorizBorder_32f_C1R,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;tried it one of sample program, but it always gives&amp;nbsp;One or more input pointers are NULL error.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Validated src &amp;amp; dst images &amp;amp; roi as well.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="cpp"&gt;int main() {
    // Define image dimensions
    const int width = 512;
    const int height = 512;

    // Allocate memory for source and destination images
    Ipp32f* psrc=new (std::nothrow) Ipp32f[width * height]; // Source image (grayscale)
    Ipp32f* pDst = new (std::nothrow) Ipp32f[width * height]; // Destination image (filtered)

    // Check for memory allocation success
    if (psrc== nullptr) {
        std::cerr &amp;lt;&amp;lt; "Memory allocation for source image failed!" &amp;lt;&amp;lt; std::endl;
        return -1;
    }
    if (pDst == nullptr) {
        std::cerr &amp;lt;&amp;lt; "Memory allocation for destination image failed!" &amp;lt;&amp;lt; std::endl;
        delete[] pSrc;  // Clean up previously allocated memory
        return -1;
    }

    // Initialize source image with some data (example: simple gradient)
    for (int i = 0; i &amp;lt; height; ++i) {
        for (int j = 0; j &amp;lt; width; ++j) {
            pSrc[i * width + j] = static_cast&amp;lt;Ipp32f&amp;gt;((j + i) % 256); // Simple data initialization
        }
    }

    // Define region of interest
    IppiSize roiSize = {width, height}; // Full image
    int srcStep = width * sizeof(Ipp32f); // Step size in bytes for source image
    int dstStep = width * sizeof(Ipp32f); // Step size in bytes for destination image

    // Check ROI dimensions and step sizes
    std::cout &amp;lt;&amp;lt; "ROI Size: " &amp;lt;&amp;lt; roiSize.width &amp;lt;&amp;lt; "x" &amp;lt;&amp;lt; roiSize.height &amp;lt;&amp;lt; std::endl;
    std::cout &amp;lt;&amp;lt; "Source Step: " &amp;lt;&amp;lt; srcStep &amp;lt;&amp;lt; ", Destination Step: " &amp;lt;&amp;lt; dstStep &amp;lt;&amp;lt; std::endl;

    // Apply the Prewitt horizontal filter
    IppStatus status = ippiFilterPrewittHorizBorder_32f_C1R(
        pSrc,                 // Source pointer
        srcStep,             // Source step
        pDst,                 // Destination pointer
        dstStep,             // Destination step
        roiSize,             // ROI size
        ippMskSize3x3,
        ippBorderConst,      // Border type
        0.0f,                 // Constant border value
        nullptr
     );

    // Check for errors
    if (status != ippStsNoErr) {
        std::cerr &amp;lt;&amp;lt; "Error applying Prewitt horizontal filter: " &amp;lt;&amp;lt; status &amp;lt;&amp;lt; std::endl;
        // Output additional debugging information
        switch (status) {
            case ippStsNullPtrErr:
                std::cerr &amp;lt;&amp;lt; "One or more input pointers are NULL." &amp;lt;&amp;lt; std::endl;
                break;
            case ippStsSizeErr:
                std::cerr &amp;lt;&amp;lt; "ROI size is incorrect." &amp;lt;&amp;lt; std::endl;
                break;
            case ippStsStepErr:
                std::cerr &amp;lt;&amp;lt; "Step size is incorrect." &amp;lt;&amp;lt; std::endl;
                break;
            default:
                std::cerr &amp;lt;&amp;lt; "An unexpected error occurred." &amp;lt;&amp;lt; std::endl;
        }
    } else {
        std::cout &amp;lt;&amp;lt; "Prewitt horizontal filter applied successfully!" &amp;lt;&amp;lt; std::endl;
    }

    // Clean up
    delete[] pSrc;
    delete[] pDst;

    return 0;
}&lt;/LI-CODE&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Nov 2024 10:47:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiFilterPrewittHorizBorder-32f-C1R/m-p/1643922#M28906</guid>
      <dc:creator>Kim9</dc:creator>
      <dc:date>2024-11-18T10:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: ippiFilterPrewittHorizBorder_32f_C1R</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiFilterPrewittHorizBorder-32f-C1R/m-p/1646045#M28915</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;have you got chance to check our sample at here?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.intel.com/content/www/us/en/docs/ipp/developer-guide-reference/2022-0/filterprewitthorizborder.html" target="_blank"&gt;FilterPrewittHorizBorder&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before using this function, y, it need to allocate a buffer,&amp;nbsp; it needs to use&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="option"&gt;FilterPrewittHorizBorderGetBufferSize&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; to get the buffer size, and then use provide the buffer for this function.&amp;nbsp; In the code before, only a NULL pointer is provided.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;Chao&lt;/P&gt;
&lt;DIV id="GUID-7A995011-7F9F-40C0-AB81-ABE208363E1B" class="section"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 27 Nov 2024 13:52:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiFilterPrewittHorizBorder-32f-C1R/m-p/1646045#M28915</guid>
      <dc:creator>Chao_Y_Intel</dc:creator>
      <dc:date>2024-11-27T13:52:55Z</dc:date>
    </item>
  </channel>
</rss>

