Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6637315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:17:55+00:00 2026-05-25T23:17:55+00:00

Is there a fastest way to convert a IplImage type from OpenCV to ALLEGRO_BITMAP

  • 0

Is there a fastest way to convert a IplImage type from OpenCV to ALLEGRO_BITMAP type from Allegro 5.0.x than just putting every pixel from one to another?

Like 2 for loops like this:

void iplImageToBitmap(IplImage *source, ALLEGRO_BITMAP* dest) {
    if(source!= NULL && dest!= NULL) {
        al_set_target_bitmap(dest);
        int height = source->height;
        int width = source->width;
        int x,y;

        for( y=0; y < height ; y++ ) {
            uchar* ptr = (uchar*) (
                source->imageData + y * source->widthStep
                );
            for( x=0; x < width; x++ ) {
                al_put_pixel(x,y,al_map_rgb(ptr[3*x+2],ptr[3*x+1],ptr[3*x]));
            }
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:17:56+00:00Added an answer on May 25, 2026 at 11:17 pm

    Use al_lock_bitmap to get an ALLEGRO_LOCKED_REGION, then set the pixel data as described. Then unlock it with al_unlock_bitmap.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the fastest way (if there is any other) to convert a std::vector
In a recent question I asked about the fastest way to convert a large
Let's say I have a Dictionary<String, Guid> What is the fastest way to convert
What's the fastest way to convert a string represented by (const char*, size_t) to
what's the fastest way to get only the important_stuff part from a string like
What is the fastest way to deploy a Java HttpServlet ? Is there a
What is the absolute fastest way to read and write strings from a file
Is there a fastest way to compare two strings (using the space for a
Possible Duplicate: Fastest way to retrieve a <title> in PHP Suppose there is a
What is the fastest way of transferring few thousand rows of data from one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.