36 if (ibuf ==
nullptr) {
39 if (ibuf->
rect ==
nullptr) {
68 if ((mem[0] !=
'D') || (mem[1] !=
'D') || (mem[2] !=
'S') || (mem[3] !=
' ')) {
72 if ((mem[4] != 124) || mem[5] || mem[6] || mem[7]) {
83 struct ImBuf *ibuf =
nullptr;
85 unsigned char bits_per_pixel;
88 unsigned int numpixels = 0;
90 unsigned char *cp = (
unsigned char *)&
col;
111 printf(
"DDS: not valid; header follows\n");
116 printf(
"DDS: format not supported\n");
119 if ((dds.
width() > 65535) || (dds.
height() > 65535)) {
120 printf(
"DDS: dimensions too large\n");
131 for (
unsigned int i = 0; i < numpixels; i++) {
133 if (pixel.
a != 255) {
140 if (ibuf ==
nullptr) {
144 ibuf->
ftype = IMB_FTYPE_DDS;
152 if (ibuf->
rect ==
nullptr) {
159 for (
unsigned int i = 0; i < numpixels; i++) {
void BLI_kdtree_nd_() free(KDTree *tree)
static const uint FOURCC_DDS
int FlipDXTCImage(unsigned int width, unsigned int height, unsigned int levels, int fourcc, uint8_t *data, int data_size, unsigned int *r_num_valid_levels)
Header file for allocimbuf.c.
@ COLOR_ROLE_DEFAULT_BYTE
struct ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
bool imb_addrectImBuf(struct ImBuf *ibuf)
void IMB_flipy(struct ImBuf *ibuf)
Contains defines and structs used throughout the imbuf module.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void mipmap(Image *img, uint f, uint m)
void * readData(uint &size)
const Color32 * pixels() const
void colorspace_set_default_role(char *colorspace, int size, int role)
bool imb_is_a_dds(const unsigned char *mem, const size_t size)
struct ImBuf * imb_load_dds(const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
bool imb_save_dds(struct ImBuf *ibuf, const char *name, int)
wchar_t * alloc_utf16_from_8(const char *in8, size_t add)