Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Mog

Pages: [1]
1
Graphics / Re: How to convert my PixelArray ?
« on: October 03, 2014, 07:46:33 pm »
Awesome, thanks a lot !  ;D

2
Graphics / How to convert my PixelArray ?
« on: October 03, 2014, 06:40:26 pm »
Hello everyone, I've a project where I have to compress an image. Everything is ok except the displaying of the image (after decompression).
To have my pixelArray, I made:
struct Pixel
{
        uint8_t B, G, R;
};

Pixel** pixelArray = new Pixel*[bmpHeader.ImageWidth];
        for (int i = 0; i < bmpHeader.ImageWidth; ++i)
                pixelArray[i] = new Pixel[bmpHeader.ImageHeight];
 
Do not care about what is bmpHeader, that just give the size of the image.

Now I would like to display it with SFML, I think texture.update() would work fine but I don't know how to convert Pixel** to sf::Uint8*, and are we oblige to use rbga ? (because I don't use transparency)

Can you please tell me how  sf::Uint8* works ? Or even better, can you guide me to convert Pixel** to  sf::Uint8* ?

Thanks a lot !

Pages: [1]