stb_image

#include 
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"

int main(int argc, const char * argv[]) {
    int width, height, nrChannels;
    unsigned char *data = stbi_load("test.jpg", &width, &height, &nrChannels, 0);
    printf("w %d, h %d, c %d\n", width, height, nrChannels);
    
    return 0;
}

你可能感兴趣的:(stb_image)