CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: VeNiX

Search: Search took 0.03 seconds.

  1. Replies
    16
    Views
    4,672

    Re: Optimizing jpeg recovery code

    So I should use sprintf() outside of the while loop to initialize all filenames first? or did you mean I should use something else entirely?

    Thanks for the help.
  2. Replies
    16
    Views
    4,672

    Re: Optimizing jpeg recovery code

    I'm using Linux as my primary system and clang as a compiler...

    Anyway, thanks for the knowledge about dealing with slack space. As for searching blocks byte by byte at first, in the class we were...
  3. Replies
    16
    Views
    4,672

    Re: Optimizing jpeg recovery code

    The first condition for found and num makes sure I don't write anything to a file that isn't open (because I haven't found the first jpeg yet).

    As to your second suggestion, that is definitely...
  4. Replies
    16
    Views
    4,672

    Re: Optimizing jpeg recovery code

    Looks like you clicked on an ad, just click the download button at the center of the page... the one with the big blue arrow pointing at it.
  5. Replies
    16
    Views
    4,672

    Optimizing jpeg recovery code

    Hello guys,

    I'm taking a CS course and we've been tasked with creating a program that recovers jpegs from a formatted CF card which uses the FAT file system with a block size of 512 bytes, the...
  6. Replies
    12
    Views
    18,535

    Re: Resizing BMP Files

    Done, I can probably check if the compiler optimized this already by looking at buffer's memory address, no?
  7. Replies
    12
    Views
    18,535

    Re: Resizing BMP Files

    Many thanks for the insights, I've understood what you meant about fread() and iterator and adjusted my code accordingly:



    // loop over input file's scanlines
    for (int i = 0,...
  8. Replies
    12
    Views
    18,535

    Re: Resizing BMP Files

    Now that I've actually fixed the algorithm I can throw the whole if-else construct away since it handles a factor of 1 correctly too.
  9. Replies
    12
    Views
    18,535

    Re: Resizing BMP Files

    Much thanks for the help... I've managed to tweak my algorithm to get it right.



    else
    {
    int paddingIn = (4 - (bi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4;
    int...
  10. Replies
    12
    Views
    18,535

    Re: Resizing BMP Files

    Isn't that a job for the header file to handle? essentially since I say that width is say 6 pixels, the renderer will be expecting a width that is a multiple of 4, so it expects 6 pixels plus 2...
  11. Replies
    12
    Views
    18,535

    Re: Resizing BMP Files

    Well, now the new bmp file is even more messy than before... I'm really confused because I think I've translated my pseudocode correctly, maybe I need to approach the problem differently.
  12. Replies
    12
    Views
    18,535

    Re: Resizing BMP Files

    I did have some pseudocode, and it changed as I started coding, right now it goes like this:




    loop over height of original bmp
    loop over width of original bmp
    store each pixel...
  13. Replies
    12
    Views
    18,535

    Resizing BMP Files [Solved]

    Hey guys,

    I'm currently studying a CS course, and I have a problem set I can't seem to solve, we're required to make a small program that takes 3 arguments: (factor, file.bmp, file2.bmp) and...
  14. Re: Simulation: Tortoise & Hare race (srand question)

    Much thanks Peter for the explanation, I guess that's what Vladimir was trying to tell me but I didn't follow.
  15. Re: Simulation: Tortoise & Hare race (srand question)

    That's not the issue, it's when the program terminates, then I relaunch it again... I get maybe 3-4 repeated sequences if I place srand() inside the functions.
  16. Simulation: Tortoise & Hare race (srand question)

    Hello guys,

    I'm a new member here, and I'm currently trying to learn C++ by myself, I have some minor experience with programming through the C language.

    I've been using a book to learn the...
Results 1 to 16 of 16





Click Here to Expand Forum to Full Width

Featured