lovr/src/loaders/texture.h

26 lines
644 B
C
Raw Normal View History

2017-04-02 12:55:21 +00:00
#include "filesystem/blob.h"
2017-01-09 05:29:16 +00:00
#include <stdint.h>
2016-11-26 07:54:45 +00:00
2017-02-19 09:54:58 +00:00
#pragma once
typedef enum {
FORMAT_RED,
FORMAT_RG,
FORMAT_RGB,
FORMAT_RGBA
} TextureFormat;
typedef struct {
void* data;
int width;
int height;
int channels;
TextureFormat format;
} TextureData;
2017-02-03 23:16:30 +00:00
TextureData* lovrTextureDataGetBlank(int width, int height, uint8_t value, TextureFormat format);
2017-02-06 04:30:17 +00:00
TextureData* lovrTextureDataGetEmpty(int width, int height, TextureFormat format);
2017-04-02 12:55:21 +00:00
TextureData* lovrTextureDataFromBlob(Blob* blob);
2017-02-06 04:30:17 +00:00
void lovrTextureDataResize(TextureData* textureData, int width, int height, uint8_t value);
2017-02-19 09:54:58 +00:00
void lovrTextureDataDestroy(TextureData* textureData);