#include <iostream>
#include <fstream>
#include <stbi/stb_image.h>
const unsigned char * loadfile(const std::string &file, int &size)
{
std::ifstream fs(file.c_str(), std::ios::binary);
fs.seekg(, std::ios::end);
size = fs.tellg();
char * data = new char[size + ];
fs.seekg();
fs.read(data, size);
fs.close();
data[size] = ;
return (unsigned char *)data;
}
int main()
{
int w;
int h;
int channels;
int size;
const unsigned char * data = loadfile("D:/1.jpg", size);
const unsigned char * logo = stbi_load_from_memory(data, size, &w, &h, &channels, );
for (int i = ; i < ; ++i)
{
std::cout << (int)logo[i] << std::endl;
}
}