Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Algoritm for collect UChar* from a QImage Object
Forum Updated to NodeBB v4.3 + New Features

Algoritm for collect UChar* from a QImage Object

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.1k 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.
  • W Offline
    W Offline
    wwolff
    wrote on last edited by
    #1

    Hi!

    I need perform some custom operations between the texture creation process in OpenGL, but the bindtexture operation in Qt encapsulate all this operations(Like WrapS ant WrapT texture coordinates).

    It means i will need call the OpenGL bind and create Mipmaps myself without Qt , and to do that i will need access to the UChar data inside a QImage previously loaded.

    Looking at the QImage Object, it exposes the UChar* data in a different fashion, where we have "Lines" of data instead of have a big block of data.

    Anyone there have an already done alogorithm to read an entire image from a QImage object in a unsigned char* array?

    Kind Regards.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bnogal
      wrote on last edited by
      #2

      image->bits()

      I dont think Qt devs would store each line in a different memory section...
      First line pointer valid too, or it should be.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        Indeed. However, note that there might be padding between scanlines depending on your image size and format.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved