4
I have to turn one QVector
2d in a QImage
to display the image on a label. The QVector
in the case of an array of integers with a value of 0 to 255 representing an image in PGM or PPM, this vector makes gray scale or RGB transformations that are necessary for PDI exercises, but to make it a little easier and make generic methods easier to use I decided to put the image in a Qimage and present the changes.
Doubt is how I can transport QVector<QVector<int> >
to the QImage
, where you can add the file format information, in case P2
and P3
, comment line, number of rows and columns and color scale.
It would be something like this:
P2
# Comentário do arquivo
número de linhas número de colunas
255
vetor 2d com as informações da imagem.