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 6084743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:33:31+00:00 2026-05-23T11:33:31+00:00

I have some 6k pictures in binary format (uint8), where I process the picture

  • 0

I have some 6k pictures in binary format (uint8), where I process the picture in blocks of 30 or so lines at time. The implication is that I end up having to skip through most of the file until I to get to the position I need to. So far the fastest thing seems to be to read the unnecessary part into a temporary variable and delete the variable afterwards, however logically this doesn’t seem like the most efficient way.

ifstream img;
int startingPixel = N;
for(int frame=0;frame<numFrames;frame++){
    img.open("myfileAsFunctionOfFrame.bin",ios::in | ios::binary);
    img.read((char*) &tempArray[0], startingPixel*sizeof(uint8));
    img.read((char*) &myArray[frame*pixelsToRead], pixelsToRead*sizeof(uint8));
    img.close();
}
delete [] tempArray;

I tried using img.ignore(), but that made it slower.

Any suggestions?

  • 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-23T11:33:32+00:00Added an answer on May 23, 2026 at 11:33 am

    Use the seekg method. It was made for exactly what you’re trying to do.
    http://www.cplusplus.com/reference/iostream/istream/seekg/

    Hope it helps

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

Sidebar

Related Questions

I have some Tkinter canvas and some picture of lines and text on it.
We have some input data that sometimes appears with &nbsp characters on the end.
In my Hibernated system, I have a class Picture that has some simple data,
I have some pictures that are online, the images are simple http://domain.com/pic.jpg for example;
Let's say we have an SDK in C++ that accepts some binary data (like
I have grid with some pictures, I edit my picture and I save my
We have some examples of pictures. And we have on input set of pictures.
I have an existing database containing some pictures in blob fields. For a web
I have some UI in VB 2005 that looks great in XP Style, but
I have a simple request: I have to put some pictures (some small resolution,

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.