Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/imbuf/intern/targa.c')
-rw-r--r--source/blender/imbuf/intern/targa.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c
index 0949a431293..9d92d146f50 100644
--- a/source/blender/imbuf/intern/targa.c
+++ b/source/blender/imbuf/intern/targa.c
@@ -122,7 +122,7 @@ static bool makebody_tga(ImBuf *ibuf, FILE *file, int (*out)(unsigned int, FILE
register int copy, bytes;
register unsigned int *rect, *rectstart, *temp;
int y;
-
+
for (y = 0; y < ibuf->y; y++) {
bytes = ibuf->x - 1;
rectstart = rect = ibuf->rect + (y * ibuf->x);
@@ -253,7 +253,7 @@ int imb_savetarga(struct ImBuf *ibuf, const char *name, int flags)
char buf[20] = {0};
FILE *fildes;
bool ok = false;
-
+
(void)flags; /* unused */
buf[16] = (ibuf->planes + 0x7) & ~0x7;
@@ -265,7 +265,7 @@ int imb_savetarga(struct ImBuf *ibuf, const char *name, int flags)
}
if (ibuf->foptions.flag & RAWTGA) buf[2] &= ~8;
-
+
buf[8] = 0;
buf[9] = 0;
buf[10] = 0;
@@ -308,7 +308,7 @@ int imb_savetarga(struct ImBuf *ibuf, const char *name, int flags)
break;
}
}
-
+
fclose(fildes);
return ok;
}
@@ -353,7 +353,7 @@ static int checktarga(TARGA *tga, const unsigned char *mem)
int imb_is_a_targa(const unsigned char *buf)
{
TARGA tga;
-
+
return checktarga(&tga, buf);
}
@@ -378,13 +378,13 @@ static void decodetarga(struct ImBuf *ibuf, const unsigned char *mem, size_t mem
int count, col, size;
unsigned int *rect;
uchar *cp = (uchar *) &col;
-
+
if (ibuf == NULL) return;
if (ibuf->rect == NULL) return;
size = ibuf->x * ibuf->y;
rect = ibuf->rect;
-
+
/* set alpha */
cp[0] = 0xff;
cp[1] = cp[2] = 0;
@@ -573,10 +573,10 @@ ImBuf *imb_loadtarga(const unsigned char *mem, size_t mem_size, int flags, char
if (tga.imgtyp < 4)
ibuf->foptions.flag |= RAWTGA;
mem = mem + 18 + tga.numid;
-
+
cp[0] = 0xff;
cp[1] = cp[2] = 0;
-
+
if (tga.mapsize) {
/* load color map */
/*mincol = tga.maporig;*/ /*UNUSED*/
@@ -609,7 +609,7 @@ ImBuf *imb_loadtarga(const unsigned char *mem, size_t mem_size, int flags, char
}
cmap[count] = cp_data;
}
-
+
size = 0;
for (int cmap_index = cmap_max - 1; cmap_index > 0; cmap_index >>= 1) {
size++;
@@ -620,7 +620,7 @@ ImBuf *imb_loadtarga(const unsigned char *mem, size_t mem_size, int flags, char
cmap[0] &= BIG_LONG(0x00ffffffl);
}
}
-
+
if (flags & IB_test) {
if (cmap) {
MEM_freeN(cmap);
@@ -630,7 +630,7 @@ ImBuf *imb_loadtarga(const unsigned char *mem, size_t mem_size, int flags, char
if (tga.imgtyp != 1 && tga.imgtyp != 9) { /* happens sometimes (beuh) */
if (cmap) {
- MEM_freeN(cmap);
+ MEM_freeN(cmap);
cmap = NULL;
}
}
@@ -653,7 +653,7 @@ ImBuf *imb_loadtarga(const unsigned char *mem, size_t mem_size, int flags, char
else if (tga.pixsize <= 32) decodetarga(ibuf, mem, mem_size, 3);
break;
}
-
+
if (cmap) {
/* apply color map */
rect = ibuf->rect;
@@ -666,7 +666,7 @@ ImBuf *imb_loadtarga(const unsigned char *mem, size_t mem_size, int flags, char
MEM_freeN(cmap);
}
-
+
if (tga.pixsize == 16) {
unsigned int col;
rect = ibuf->rect;
@@ -685,29 +685,29 @@ ImBuf *imb_loadtarga(const unsigned char *mem, size_t mem_size, int flags, char
}
ibuf->planes = 24;
}
-
+
if (tga.imgtyp == 3 || tga.imgtyp == 11) {
uchar *crect;
unsigned int *lrect, col;
-
+
crect = (uchar *) ibuf->rect;
lrect = (unsigned int *) ibuf->rect;
-
+
for (size = ibuf->x * ibuf->y; size > 0; size--) {
col = *lrect++;
-
+
crect[0] = 255;
crect[1] = crect[2] = crect[3] = col;
crect += 4;
}
}
-
+
if (tga.imgdes & 0x20) {
IMB_flipy(ibuf);
}
if (ibuf->rect)
IMB_convert_rgba_to_abgr(ibuf);
-
+
return ibuf;
}