L
L
larikojaan2020-12-19 10:39:10
C++ / C#
larikojaan, 2020-12-19 10:39:10

What is the best way to convert an image to unsigned char?

Good afternoon! Please tell me, there is a structure for storing information about the myRGB image - three ints (red, green, blue, respectively), without an alpha channel. There is a task to present this image as an unsigned char, the height and width of the image are known (int height, int width respectively), and also to somehow access each of the pixels, understanding it by components. What is the easiest and best way to do this? Convert accordingly and get the value. Thank you!

std::vector <std::vector <myType::myRGB>>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-12-19
@firedragon

Let it be uint32 width and height, then array width * height * 3 uchar well, or steal bmp

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question