Tuesday, 15 January 2013

c++ - QDataStream and byte order in Big Endian -



c++ - QDataStream and byte order in Big Endian -

i have programme sends images on network. manually create pixels (using qrgb class) , insert them qdatastream. quite easy when there 16 or 32 bits per pixel (i can insert quint16 or quint32), in rgb888 (24 bits per pixel) have utilize 3 quint8 variables. i'm not sure order of bytes when qdatastream has:

// output qdatastream object output.setbyteorder(qdatastream::bigendian);

should insert in order correctly read stream later?

// red, greenish , bluish quints8 output << blue; output << green; output << red;

edit: know setting bigendian doesn't matter when utilize quint8 want set colors in such order, in case when qt makes byte resorting (quint32 , setbyteorder).

c++ qt rgb big-endian qdatastream

No comments:

Post a Comment