Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. 32 bits processor and single bit bitmap

32 bits processor and single bit bitmap

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsdata-structuresquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vaclav_
    wrote on last edited by
    #1

    I am hoping I do not get flamed for asking this here, but I am looking for answer and "use blink without delay" is not it. I need to build, for emulation purpose, single bit B&W bitmap. I like to start with 100x100 size. Now since the processor I am using is 32 bits processor how should I organize the bits array - 8 bits wide or 32 bits wide or does it matter as long as I process it correctly? I do understand that "real" bitmap provides some fills to make the array fit into selected width. Thanks for your time. Cheers Vaclav

    A L 2 Replies Last reply
    0
    • V Vaclav_

      I am hoping I do not get flamed for asking this here, but I am looking for answer and "use blink without delay" is not it. I need to build, for emulation purpose, single bit B&W bitmap. I like to start with 100x100 size. Now since the processor I am using is 32 bits processor how should I organize the bits array - 8 bits wide or 32 bits wide or does it matter as long as I process it correctly? I do understand that "real" bitmap provides some fills to make the array fit into selected width. Thanks for your time. Cheers Vaclav

      A Offline
      A Offline
      Albert Holguin
      wrote on last edited by
      #2

      Vaclav_Sal wrote:

      Now since the processor I am using is 32 bits processor how should I organize the bits array - 8 bits wide or 32 bits wide or does it matter as long as I process it correctly?

      Doesn't really matter... the only thing that really matters is that it rests on an 8bit boundary, because computers can handle that more efficiently than anything else (since RAM is allocated on 8bit boundaries). edit: What I mean by resting on an 8bit boundary means that if the sample resolution you're dealing with is one bit (or three bits) you'd still want to pack that to 8bits (fill the non-used bits even though you're not using them).

      1 Reply Last reply
      0
      • V Vaclav_

        I am hoping I do not get flamed for asking this here, but I am looking for answer and "use blink without delay" is not it. I need to build, for emulation purpose, single bit B&W bitmap. I like to start with 100x100 size. Now since the processor I am using is 32 bits processor how should I organize the bits array - 8 bits wide or 32 bits wide or does it matter as long as I process it correctly? I do understand that "real" bitmap provides some fills to make the array fit into selected width. Thanks for your time. Cheers Vaclav

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I would suggest that you make it 100 bits wide, rounded to the nearest 32 (i.e. 4 words). That will ensure that each row is aligned on a 32-bit boundary which is most efficient for this architecture.

        A 1 Reply Last reply
        0
        • L Lost User

          I would suggest that you make it 100 bits wide, rounded to the nearest 32 (i.e. 4 words). That will ensure that each row is aligned on a 32-bit boundary which is most efficient for this architecture.

          A Offline
          A Offline
          Albert Holguin
          wrote on last edited by
          #4

          Well, if you have to access each bit independently (i.e. sample-wise), bit packing is still way more efficient than doing block-wise packing.

          L 1 Reply Last reply
          0
          • A Albert Holguin

            Well, if you have to access each bit independently (i.e. sample-wise), bit packing is still way more efficient than doing block-wise packing.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Sorry, not sure what that means in relation to my suggestion.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups