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:
-rw-r--r--source/blender/imbuf/CMakeLists.txt4
-rw-r--r--source/blender/imbuf/IMB_imbuf.h6
-rw-r--r--source/blender/imbuf/intern/IMB_anim.h8
-rw-r--r--source/blender/imbuf/intern/IMB_indexer.h2
-rw-r--r--source/blender/imbuf/intern/allocimbuf.c38
-rw-r--r--source/blender/imbuf/intern/anim_movie.c122
-rw-r--r--source/blender/imbuf/intern/bmp.c10
-rw-r--r--source/blender/imbuf/intern/cache.c2
-rw-r--r--source/blender/imbuf/intern/cineon/CMakeLists.txt2
-rw-r--r--source/blender/imbuf/intern/cineon/cineon_dpx.c2
-rw-r--r--source/blender/imbuf/intern/cineon/logImageCore.c6
-rw-r--r--source/blender/imbuf/intern/colormanagement.c2
-rw-r--r--source/blender/imbuf/intern/dds/BlockDXT.cpp80
-rw-r--r--source/blender/imbuf/intern/dds/BlockDXT.h38
-rw-r--r--source/blender/imbuf/intern/dds/CMakeLists.txt4
-rw-r--r--source/blender/imbuf/intern/dds/Color.h4
-rw-r--r--source/blender/imbuf/intern/dds/ColorBlock.cpp56
-rw-r--r--source/blender/imbuf/intern/dds/ColorBlock.h18
-rw-r--r--source/blender/imbuf/intern/dds/DirectDrawSurface.cpp176
-rw-r--r--source/blender/imbuf/intern/dds/DirectDrawSurface.h30
-rw-r--r--source/blender/imbuf/intern/dds/Image.h26
-rw-r--r--source/blender/imbuf/intern/dds/PixelFormat.h8
-rw-r--r--source/blender/imbuf/intern/dds/dds_api.cpp2
-rw-r--r--source/blender/imbuf/intern/divers.c10
-rw-r--r--source/blender/imbuf/intern/filter.c24
-rw-r--r--source/blender/imbuf/intern/imageprocess.c28
-rw-r--r--source/blender/imbuf/intern/imbuf.h2
-rw-r--r--source/blender/imbuf/intern/indexer.c56
-rw-r--r--source/blender/imbuf/intern/iris.c60
-rw-r--r--source/blender/imbuf/intern/jp2.c118
-rw-r--r--source/blender/imbuf/intern/jpeg.c18
-rw-r--r--source/blender/imbuf/intern/openexr/CMakeLists.txt2
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp4
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.h2
-rw-r--r--source/blender/imbuf/intern/png.c12
-rw-r--r--source/blender/imbuf/intern/radiance_hdr.c12
-rw-r--r--source/blender/imbuf/intern/rectop.c28
-rw-r--r--source/blender/imbuf/intern/rotate.c6
-rw-r--r--source/blender/imbuf/intern/scaling.c112
-rw-r--r--source/blender/imbuf/intern/targa.c40
-rw-r--r--source/blender/imbuf/intern/thumbs.c2
-rw-r--r--source/blender/imbuf/intern/thumbs_blend.c2
-rw-r--r--source/blender/imbuf/intern/tiff.c50
-rw-r--r--source/blender/imbuf/intern/util.c6
-rw-r--r--source/blender/imbuf/readme.txt8
45 files changed, 624 insertions, 624 deletions
diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt
index e73f227dec8..44ff53cc020 100644
--- a/source/blender/imbuf/CMakeLists.txt
+++ b/source/blender/imbuf/CMakeLists.txt
@@ -23,7 +23,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-set(INC
+set(INC
.
../blenkernel
../blenlib
@@ -83,7 +83,7 @@ set(SRC
intern/IMB_filter.h
intern/IMB_indexer.h
intern/imbuf.h
-
+
# orphan include
../../../intern/ffmpeg/ffmpeg_compat.h
)
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index 4289f98643d..75f8df99e63 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -217,7 +217,7 @@ void IMB_blend_color_byte(unsigned char dst[4], unsigned char src1[4],
void IMB_blend_color_float(float dst[4], float src1[4], float src2[4],
IMB_BlendMode mode);
-void IMB_rectclip(struct ImBuf *dbuf, struct ImBuf *sbuf, int *destx,
+void IMB_rectclip(struct ImBuf *dbuf, struct ImBuf *sbuf, int *destx,
int *desty, int *srcx, int *srcy, int *width, int *height);
void IMB_rectcpy(struct ImBuf *drect, struct ImBuf *srect, int destx,
int desty, int srcx, int srcy, int width, int height);
@@ -322,7 +322,7 @@ int IMB_anim_get_preseek(struct anim *anim);
struct ImBuf *IMB_anim_absolute(
struct anim *anim, int position,
- IMB_Timecode_Type tc /* = 1 = IMB_TC_RECORD_RUN */,
+ IMB_Timecode_Type tc /* = 1 = IMB_TC_RECORD_RUN */,
IMB_Proxy_Size preview_size /* = 0 = IMB_PROXY_NONE */);
/**
@@ -433,7 +433,7 @@ bool IMB_isfloat(struct ImBuf *ibuf);
void IMB_de_interlace(struct ImBuf *ibuf);
void IMB_interlace(struct ImBuf *ibuf);
-/* create char buffer, color corrected if necessary, for ImBufs that lack one */
+/* create char buffer, color corrected if necessary, for ImBufs that lack one */
void IMB_rect_from_float(struct ImBuf *ibuf);
/* Create char buffer for part of the image, color corrected if necessary,
* Changed part will be stored in buffer. This is expected to be used for texture painting updates */
diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h
index 6fa31e122cc..804095a0727 100644
--- a/source/blender/imbuf/intern/IMB_anim.h
+++ b/source/blender/imbuf/intern/IMB_anim.h
@@ -103,7 +103,7 @@ struct anim {
int frs_sec;
double frs_sec_base;
int x, y;
-
+
/* for number */
char name[1024];
/* for sequence */
@@ -113,12 +113,12 @@ struct anim {
void *movie;
void *track;
void *params;
- int orientation;
+ int orientation;
size_t framesize;
int interlacing;
int preseek;
int streamindex;
-
+
/* avi */
struct _AviMovie *avi;
@@ -153,7 +153,7 @@ struct anim {
int proxies_tried;
int indices_tried;
-
+
struct anim *proxy_anim[IMB_PROXY_MAX_SLOT];
struct anim_index *curr_idx[IMB_TC_MAX_SLOT];
diff --git a/source/blender/imbuf/intern/IMB_indexer.h b/source/blender/imbuf/intern/IMB_indexer.h
index bac46740f0f..024801cb870 100644
--- a/source/blender/imbuf/intern/IMB_indexer.h
+++ b/source/blender/imbuf/intern/IMB_indexer.h
@@ -109,7 +109,7 @@ unsigned long long IMB_indexer_get_seek_pos_dts(
struct anim_index *idx, int frameno_index);
int IMB_indexer_get_frame_index(struct anim_index *idx, int frameno);
-unsigned long long IMB_indexer_get_pts(struct anim_index *idx,
+unsigned long long IMB_indexer_get_pts(struct anim_index *idx,
int frame_index);
int IMB_indexer_get_duration(struct anim_index *idx);
diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c
index faa0b5f7b6e..589955d2ab3 100644
--- a/source/blender/imbuf/intern/allocimbuf.c
+++ b/source/blender/imbuf/intern/allocimbuf.c
@@ -106,14 +106,14 @@ void imb_freemipmapImBuf(ImBuf *ibuf)
void imb_freerectfloatImBuf(ImBuf *ibuf)
{
if (ibuf == NULL) return;
-
+
if (ibuf->rect_float && (ibuf->mall & IB_rectfloat)) {
MEM_freeN(ibuf->rect_float);
ibuf->rect_float = NULL;
}
imb_freemipmapImBuf(ibuf);
-
+
ibuf->rect_float = NULL;
ibuf->mall &= ~IB_rectfloat;
}
@@ -126,7 +126,7 @@ void imb_freerectImBuf(ImBuf *ibuf)
if (ibuf->rect && (ibuf->mall & IB_rect))
MEM_freeN(ibuf->rect);
ibuf->rect = NULL;
-
+
imb_freemipmapImBuf(ibuf);
ibuf->mall &= ~IB_rect;
@@ -266,30 +266,30 @@ ImBuf *IMB_makeSingleUser(ImBuf *ibuf)
bool addzbufImBuf(ImBuf *ibuf)
{
if (ibuf == NULL) return false;
-
+
IMB_freezbufImBuf(ibuf);
-
+
if ((ibuf->zbuf = imb_alloc_pixels(ibuf->x, ibuf->y, 1, sizeof(unsigned int), __func__))) {
ibuf->mall |= IB_zbuf;
ibuf->flags |= IB_zbuf;
return true;
}
-
+
return false;
}
bool addzbuffloatImBuf(ImBuf *ibuf)
{
if (ibuf == NULL) return false;
-
+
IMB_freezbuffloatImBuf(ibuf);
-
+
if ((ibuf->zbuf_float = imb_alloc_pixels(ibuf->x, ibuf->y, 1, sizeof(float), __func__))) {
ibuf->mall |= IB_zbuffloat;
ibuf->flags |= IB_zbuffloat;
return true;
}
-
+
return false;
}
@@ -372,17 +372,17 @@ void *imb_alloc_pixels(unsigned int x,
bool imb_addrectfloatImBuf(ImBuf *ibuf)
{
if (ibuf == NULL) return false;
-
+
if (ibuf->rect_float)
imb_freerectfloatImBuf(ibuf); /* frees mipmap too, hrm */
-
+
ibuf->channels = 4;
if ((ibuf->rect_float = imb_alloc_pixels(ibuf->x, ibuf->y, 4, sizeof(float), __func__))) {
ibuf->mall |= IB_rectfloat;
ibuf->flags |= IB_rectfloat;
return true;
}
-
+
return false;
}
@@ -390,12 +390,12 @@ bool imb_addrectfloatImBuf(ImBuf *ibuf)
bool imb_addrectImBuf(ImBuf *ibuf)
{
if (ibuf == NULL) return false;
-
+
/* don't call imb_freerectImBuf, it frees mipmaps, this call is used only too give float buffers display */
if (ibuf->rect && (ibuf->mall & IB_rect))
MEM_freeN(ibuf->rect);
ibuf->rect = NULL;
-
+
if ((ibuf->rect = imb_alloc_pixels(ibuf->x, ibuf->y, 4, sizeof(unsigned char), __func__))) {
ibuf->mall |= IB_rect;
ibuf->flags |= IB_rect;
@@ -511,7 +511,7 @@ ImBuf *IMB_dupImBuf(const ImBuf *ibuf1)
ImBuf *ibuf2, tbuf;
int flags = 0;
int a, x, y;
-
+
if (ibuf1 == NULL) return NULL;
if (ibuf1->rect) flags |= IB_rect;
@@ -522,13 +522,13 @@ ImBuf *IMB_dupImBuf(const ImBuf *ibuf1)
x = ibuf1->x;
y = ibuf1->y;
if (ibuf1->flags & IB_fields) y *= 2;
-
+
ibuf2 = IMB_allocImBuf(x, y, ibuf1->planes, flags);
if (ibuf2 == NULL) return NULL;
if (flags & IB_rect)
memcpy(ibuf2->rect, ibuf1->rect, ((size_t)x) * y * sizeof(int));
-
+
if (flags & IB_rectfloat)
memcpy(ibuf2->rect_float, ibuf1->rect_float, ((size_t)ibuf1->channels) * x * y * sizeof(float));
@@ -550,7 +550,7 @@ ImBuf *IMB_dupImBuf(const ImBuf *ibuf1)
/* silly trick to copy the entire contents of ibuf1 struct over to ibuf */
tbuf = *ibuf1;
-
+
/* fix pointers */
tbuf.rect = ibuf2->rect;
tbuf.rect_float = ibuf2->rect_float;
@@ -560,7 +560,7 @@ ImBuf *IMB_dupImBuf(const ImBuf *ibuf1)
for (a = 0; a < IMB_MIPMAP_LEVELS; a++)
tbuf.mipmap[a] = NULL;
tbuf.dds_data.data = NULL;
-
+
/* set malloc flag */
tbuf.mall = ibuf2->mall;
tbuf.c_handle = NULL;
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index f842b69418e..290226acf78 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -325,7 +325,7 @@ static int startavi(struct anim *anim)
if (AVIFileGetStream(anim->pfile, &anim->pavi[i], 0L, i) != AVIERR_OK) {
break;
}
-
+
AVIStreamInfo(anim->pavi[i], &avis, sizeof(avis));
if ((avis.fccType == streamtypeVIDEO) && (firstvideo == -1)) {
if (streamcount > 0) {
@@ -382,7 +382,7 @@ static int startavi(struct anim *anim)
free_anim_avi(anim);
return -1;
}
-
+
anim->duration = anim->avi->header->TotalFrames;
anim->params = NULL;
@@ -407,7 +407,7 @@ static ImBuf *avi_fetchibuf(struct anim *anim, int position)
ImBuf *ibuf = NULL;
int *tmp;
int y;
-
+
if (anim == NULL) {
return NULL;
}
@@ -431,7 +431,7 @@ static ImBuf *avi_fetchibuf(struct anim *anim, int position)
tmp = AVI_read_frame(anim->avi, AVI_FORMAT_RGB32, position,
AVI_get_stream(anim->avi, AVIST_VIDEO, 0));
-
+
if (tmp == NULL) {
printf("Error reading frame from AVI: '%s'\n", anim->name);
IMB_freeImBuf(ibuf);
@@ -442,10 +442,10 @@ static ImBuf *avi_fetchibuf(struct anim *anim, int position)
memcpy(&(ibuf->rect)[((anim->y - y) - 1) * anim->x], &tmp[y * anim->x],
anim->x * 4);
}
-
+
MEM_freeN(tmp);
}
-
+
ibuf->rect_colorspace = colormanage_colorspace_get_named(anim->colorspace);
return ibuf;
@@ -619,7 +619,7 @@ static int startffmpeg(struct anim *anim)
anim->pCodecCtx->width,
anim->pCodecCtx->height),
"ffmpeg deinterlace"),
- anim->pCodecCtx->pix_fmt,
+ anim->pCodecCtx->pix_fmt,
anim->pCodecCtx->width,
anim->pCodecCtx->height);
}
@@ -630,7 +630,7 @@ static int startffmpeg(struct anim *anim)
else {
anim->preseek = 0;
}
-
+
anim->img_convert_ctx = sws_getContext(
anim->x,
anim->y,
@@ -640,7 +640,7 @@ static int startffmpeg(struct anim *anim)
AV_PIX_FMT_RGBA,
SWS_FAST_BILINEAR | SWS_PRINT_INFO | SWS_FULL_CHR_H_INT,
NULL, NULL, NULL);
-
+
if (!anim->img_convert_ctx) {
fprintf(stderr,
"Can't transform color space??? Bailing out...\n");
@@ -671,7 +671,7 @@ static int startffmpeg(struct anim *anim)
fprintf(stderr, "Warning: Could not set libswscale colorspace details.\n");
}
#endif
-
+
return (0);
}
@@ -691,7 +691,7 @@ static void ffmpeg_postprocess(struct anim *anim)
return;
}
- /* This means the data wasnt read properly,
+ /* This means the data wasnt read properly,
* this check stops crashing */
if (input->data[0] == 0 && input->data[1] == 0 &&
input->data[2] == 0 && input->data[3] == 0)
@@ -701,7 +701,7 @@ static void ffmpeg_postprocess(struct anim *anim)
return;
}
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
" POSTPROC: anim->pFrame planes: %p %p %p %p\n",
input->data[0], input->data[1], input->data[2],
input->data[3]);
@@ -738,7 +738,7 @@ static void ffmpeg_postprocess(struct anim *anim)
int x, y, h, w;
unsigned char *bottom;
unsigned char *top;
-
+
sws_scale(anim->img_convert_ctx,
(const uint8_t *const *)input->data,
input->linesize,
@@ -746,31 +746,31 @@ static void ffmpeg_postprocess(struct anim *anim)
anim->y,
dst2,
dstStride2);
-
+
bottom = (unsigned char *) ibuf->rect;
top = bottom + ibuf->x * (ibuf->y - 1) * 4;
-
+
h = (ibuf->y + 1) / 2;
w = ibuf->x;
-
+
for (y = 0; y < h; y++) {
unsigned char tmp[4];
unsigned int *tmp_l =
(unsigned int *) tmp;
-
+
for (x = 0; x < w; x++) {
tmp[0] = bottom[0];
tmp[1] = bottom[1];
tmp[2] = bottom[2];
tmp[3] = bottom[3];
-
+
bottom[0] = top[0];
bottom[1] = top[1];
bottom[2] = top[2];
bottom[3] = top[3];
-
+
*(unsigned int *) top = *tmp_l;
-
+
bottom += 4;
top += 4;
}
@@ -783,7 +783,7 @@ static void ffmpeg_postprocess(struct anim *anim)
int dstStride2[4] = { -dstStride[0], 0, 0, 0 };
uint8_t *dst2[4] = { dst[0] + (anim->y - 1) * dstStride[0],
0, 0, 0 };
-
+
sws_scale(anim->img_convert_ctx,
(const uint8_t *const *)input->data,
input->linesize,
@@ -820,21 +820,21 @@ static int ffmpeg_decode_video_frame(struct anim *anim)
av_free_packet(&anim->next_packet);
anim->next_packet.stream_index = -1;
}
-
+
while ((rval = av_read_frame(anim->pFormatCtx, &anim->next_packet)) >= 0) {
- av_log(anim->pFormatCtx,
- AV_LOG_DEBUG,
+ av_log(anim->pFormatCtx,
+ AV_LOG_DEBUG,
"%sREAD: strID=%d (VID: %d) dts=%lld pts=%lld "
"%s\n",
(anim->next_packet.stream_index == anim->videoStream)
? "->" : " ",
- anim->next_packet.stream_index,
+ anim->next_packet.stream_index,
anim->videoStream,
(anim->next_packet.dts == AV_NOPTS_VALUE) ? -1 :
(long long int)anim->next_packet.dts,
(anim->next_packet.pts == AV_NOPTS_VALUE) ? -1 :
(long long int)anim->next_packet.pts,
- (anim->next_packet.flags & AV_PKT_FLAG_KEY) ?
+ (anim->next_packet.flags & AV_PKT_FLAG_KEY) ?
" KEY" : "");
if (anim->next_packet.stream_index == anim->videoStream) {
anim->pFrameComplete = 0;
@@ -863,7 +863,7 @@ static int ffmpeg_decode_video_frame(struct anim *anim)
av_free_packet(&anim->next_packet);
anim->next_packet.stream_index = -1;
}
-
+
if (rval == AVERROR_EOF) {
/* this sets size and data fields to zero,
* which is necessary to decode the remaining data
@@ -918,14 +918,14 @@ static void ffmpeg_decode_video_frame_scan(
int count = 1000;
av_log(anim->pFormatCtx,
- AV_LOG_DEBUG,
- "SCAN start: considering pts=%lld in search of %lld\n",
+ AV_LOG_DEBUG,
+ "SCAN start: considering pts=%lld in search of %lld\n",
(long long int)anim->next_pts, (long long int)pts_to_search);
while (count > 0 && anim->next_pts < pts_to_search) {
av_log(anim->pFormatCtx,
- AV_LOG_DEBUG,
- " WHILE: pts=%lld in search of %lld\n",
+ AV_LOG_DEBUG,
+ " WHILE: pts=%lld in search of %lld\n",
(long long int)anim->next_pts, (long long int)pts_to_search);
if (!ffmpeg_decode_video_frame(anim)) {
break;
@@ -934,9 +934,9 @@ static void ffmpeg_decode_video_frame_scan(
}
if (count == 0) {
av_log(anim->pFormatCtx,
- AV_LOG_ERROR,
+ AV_LOG_ERROR,
"SCAN failed: completely lost in stream, "
- "bailing out at PTS=%lld, searching for PTS=%lld\n",
+ "bailing out at PTS=%lld, searching for PTS=%lld\n",
(long long int)anim->next_pts, (long long int)pts_to_search);
}
if (anim->next_pts == pts_to_search) {
@@ -995,7 +995,7 @@ static ImBuf *ffmpeg_fetchibuf(struct anim *anim, int position,
int64_t pts_to_search = 0;
double frame_rate;
double pts_time_base;
- long long st_time;
+ long long st_time;
struct anim_index *tc_index = 0;
AVStream *v_st;
int new_frame_index = 0; /* To quiet gcc barking... */
@@ -1025,7 +1025,7 @@ static ImBuf *ffmpeg_fetchibuf(struct anim *anim, int position,
tc_index, new_frame_index);
}
else {
- pts_to_search = (long long)
+ pts_to_search = (long long)
floor(((double) position) /
pts_time_base / frame_rate + 0.5);
@@ -1034,29 +1034,29 @@ static ImBuf *ffmpeg_fetchibuf(struct anim *anim, int position,
}
}
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: looking for PTS=%lld "
- "(pts_timebase=%g, frame_rate=%g, st_time=%lld)\n",
+ "(pts_timebase=%g, frame_rate=%g, st_time=%lld)\n",
(long long int)pts_to_search, pts_time_base, frame_rate, st_time);
- if (anim->last_frame &&
+ if (anim->last_frame &&
anim->last_pts <= pts_to_search && anim->next_pts > pts_to_search)
{
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: frame repeat: last: %lld next: %lld\n",
- (long long int)anim->last_pts,
+ (long long int)anim->last_pts,
(long long int)anim->next_pts);
IMB_refImBuf(anim->last_frame);
anim->curposition = position;
return anim->last_frame;
}
-
+
if (position > anim->curposition + 1 &&
anim->preseek &&
!tc_index &&
position - (anim->curposition + 1) < anim->preseek)
{
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: within preseek interval (no index)\n");
ffmpeg_decode_video_frame_scan(anim, pts_to_search);
@@ -1065,7 +1065,7 @@ static ImBuf *ffmpeg_fetchibuf(struct anim *anim, int position,
IMB_indexer_can_scan(tc_index, old_frame_index,
new_frame_index))
{
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: within preseek interval "
"(index tells us)\n");
@@ -1083,24 +1083,24 @@ static ImBuf *ffmpeg_fetchibuf(struct anim *anim, int position,
dts = IMB_indexer_get_seek_pos_dts(
tc_index, new_frame_index);
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"TC INDEX seek pos = %lld\n", pos);
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"TC INDEX seek dts = %llu\n", dts);
if (ffmpeg_seek_by_byte(anim->pFormatCtx)) {
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"... using BYTE pos\n");
- ret = av_seek_frame(anim->pFormatCtx,
+ ret = av_seek_frame(anim->pFormatCtx,
-1,
pos, AVSEEK_FLAG_BYTE);
av_update_cur_dts(anim->pFormatCtx, v_st, dts);
}
else {
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"... using DTS pos\n");
- ret = av_seek_frame(anim->pFormatCtx,
+ ret = av_seek_frame(anim->pFormatCtx,
anim->videoStream,
dts, AVSEEK_FLAG_BACKWARD);
}
@@ -1109,22 +1109,22 @@ static ImBuf *ffmpeg_fetchibuf(struct anim *anim, int position,
pos = (long long) (position - anim->preseek) *
AV_TIME_BASE / frame_rate;
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
- "NO INDEX seek pos = %lld, st_time = %lld\n",
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ "NO INDEX seek pos = %lld, st_time = %lld\n",
pos, (st_time != AV_NOPTS_VALUE) ? st_time : 0);
if (pos < 0) {
pos = 0;
}
-
+
if (st_time != AV_NOPTS_VALUE) {
pos += st_time;
}
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"NO INDEX final seek pos = %lld\n", pos);
- ret = av_seek_frame(anim->pFormatCtx, -1,
+ ret = av_seek_frame(anim->pFormatCtx, -1,
pos, AVSEEK_FLAG_BACKWARD);
}
@@ -1156,7 +1156,7 @@ static ImBuf *ffmpeg_fetchibuf(struct anim *anim, int position,
ffmpeg_decode_video_frame(anim);
}
else {
- av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+ av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: no seek necessary, just continue...\n");
}
@@ -1167,11 +1167,11 @@ static ImBuf *ffmpeg_fetchibuf(struct anim *anim, int position,
ffmpeg_postprocess(anim);
anim->last_pts = anim->next_pts;
-
+
ffmpeg_decode_video_frame(anim);
-
+
anim->curposition = position;
-
+
IMB_refImBuf(anim->last_frame);
return anim->last_frame;
@@ -1275,7 +1275,7 @@ struct ImBuf *IMB_anim_previewframe(struct anim *anim)
{
struct ImBuf *ibuf = NULL;
int position = 0;
-
+
ibuf = IMB_anim_absolute(anim, 0, IMB_TC_NONE, IMB_PROXY_NONE);
if (ibuf) {
IMB_freeImBuf(ibuf);
@@ -1363,7 +1363,7 @@ struct ImBuf *IMB_anim_absolute(struct anim *anim, int position,
if (ibuf) {
if (filter_y) IMB_filtery(ibuf);
BLI_snprintf(ibuf->name, sizeof(ibuf->name), "%s.%04d", anim->name, anim->curposition + 1);
-
+
}
return(ibuf);
}
@@ -1376,7 +1376,7 @@ int IMB_anim_get_duration(struct anim *anim, IMB_Timecode_Type tc)
if (tc == IMB_TC_NONE) {
return anim->duration;
}
-
+
idx = IMB_anim_open_index(anim, tc);
if (!idx) {
return anim->duration;
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c
index e63699ea5ba..edaa57eedf2 100644
--- a/source/blender/imbuf/intern/bmp.c
+++ b/source/blender/imbuf/intern/bmp.c
@@ -130,7 +130,7 @@ struct ImBuf *imb_bmp_decode(const unsigned char *mem, size_t size, int flags, c
unsigned short col;
double xppm, yppm;
bool top_to_bottom = false;
-
+
(void)size; /* unused */
if (checkbmp(mem) == 0) return(NULL);
@@ -248,7 +248,7 @@ struct ImBuf *imb_bmp_decode(const unsigned char *mem, size_t size, int flags, c
rect[0] = bmp[2];
rect[1] = bmp[1];
rect[2] = bmp[0];
-
+
rect[3] = 255;
rect += 4; bmp += 3;
}
@@ -277,7 +277,7 @@ struct ImBuf *imb_bmp_decode(const unsigned char *mem, size_t size, int flags, c
ibuf->ppm[1] = yppm;
ibuf->ftype = IMB_FTYPE_BMP;
}
-
+
return(ibuf);
}
@@ -297,7 +297,7 @@ static int putShortLSB(unsigned short us, FILE *ofile)
{
putc((us >> 0) & 0xFF, ofile);
return putc((us >> 8) & 0xFF, ofile);
-}
+}
/* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */
int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags)
@@ -306,7 +306,7 @@ int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags)
size_t bytesize, extrabytes, ptr;
uchar *data;
FILE *ofile;
-
+
(void)flags; /* unused */
extrabytes = (4 - ibuf->x * 3 % 4) % 4;
diff --git a/source/blender/imbuf/intern/cache.c b/source/blender/imbuf/intern/cache.c
index 759f8cc82c2..a36d82be7c7 100644
--- a/source/blender/imbuf/intern/cache.c
+++ b/source/blender/imbuf/intern/cache.c
@@ -280,7 +280,7 @@ static ImGlobalTile *imb_global_cache_get_tile(ImBuf *ibuf, int tx, int ty, ImGl
lookuptile.tx = tx;
lookuptile.ty = ty;
gtile = BLI_ghash_lookup(GLOBAL_CACHE.tilehash, &lookuptile);
-
+
if (gtile) {
/* found tile. however it may be in the process of being loaded
* by another thread, in that case we do stupid busy loop waiting
diff --git a/source/blender/imbuf/intern/cineon/CMakeLists.txt b/source/blender/imbuf/intern/cineon/CMakeLists.txt
index c96db4e4a3d..0a3c440d9a7 100644
--- a/source/blender/imbuf/intern/cineon/CMakeLists.txt
+++ b/source/blender/imbuf/intern/cineon/CMakeLists.txt
@@ -23,7 +23,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-set(INC
+set(INC
.
..
../..
diff --git a/source/blender/imbuf/intern/cineon/cineon_dpx.c b/source/blender/imbuf/intern/cineon/cineon_dpx.c
index 1d2ebf88a32..c116d32b2f0 100644
--- a/source/blender/imbuf/intern/cineon/cineon_dpx.c
+++ b/source/blender/imbuf/intern/cineon/cineon_dpx.c
@@ -106,7 +106,7 @@ static int imb_save_dpx_cineon(ImBuf *ibuf, const char *filename, int use_cineon
printf("DPX/Cineon: saving in memory is not supported.\n");
return 0;
}
-
+
logImageSetVerbose((G.debug & G_DEBUG) ? 1 : 0);
depth = (ibuf->planes + 7) >> 3;
diff --git a/source/blender/imbuf/intern/cineon/logImageCore.c b/source/blender/imbuf/intern/cineon/logImageCore.c
index bb72f675cb8..614323d0d11 100644
--- a/source/blender/imbuf/intern/cineon/logImageCore.c
+++ b/source/blender/imbuf/intern/cineon/logImageCore.c
@@ -917,7 +917,7 @@ static float *getLinToLogLut(LogImageFile *logImage, LogImageElement logElement)
float gain, negativeFilmGamma, offset, step;
unsigned int lutsize = (unsigned int)(logElement.maxValue + 1);
unsigned int i;
-
+
lut = MEM_mallocN(sizeof(float) * lutsize, "getLinToLogLut");
negativeFilmGamma = 0.6;
@@ -927,7 +927,7 @@ static float *getLinToLogLut(LogImageFile *logImage, LogImageElement logElement)
for (i = 0; i < lutsize; i++)
lut[i] = (logImage->referenceWhite + log10f(powf((i + offset) / gain, 1.7f / logImage->gamma)) / (step / negativeFilmGamma)) / logElement.maxValue;
-
+
return lut;
}
@@ -938,7 +938,7 @@ static float *getLogToLinLut(LogImageFile *logImage, LogImageElement logElement)
/* float filmGamma; unused */
unsigned int lutsize = (unsigned int)(logElement.maxValue + 1);
unsigned int i;
-
+
lut = MEM_mallocN(sizeof(float) * lutsize, "getLogToLinLut");
/* Building the Log -> Lin LUT */
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index 7c7c3a7ba45..86c0dd69930 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -2448,7 +2448,7 @@ const char *IMB_colormanagement_view_get_default_name(const char *display_name)
{
ColorManagedDisplay *display = colormanage_display_get_named(display_name);
ColorManagedView *view = NULL;
-
+
if (display)
view = colormanage_view_get_default(display);
diff --git a/source/blender/imbuf/intern/dds/BlockDXT.cpp b/source/blender/imbuf/intern/dds/BlockDXT.cpp
index 8e571483e08..170cf620701 100644
--- a/source/blender/imbuf/intern/dds/BlockDXT.cpp
+++ b/source/blender/imbuf/intern/dds/BlockDXT.cpp
@@ -33,7 +33,7 @@
*/
// Copyright NVIDIA Corporation 2007 -- Ignacio Castano <icastano@nvidia.com>
-//
+//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -42,10 +42,10 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
+//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -71,37 +71,37 @@ uint BlockDXT1::evaluatePalette(Color32 color_array[4]) const
color_array[0].g = (col0.g << 2) | (col0.g >> 4);
color_array[0].r = (col0.r << 3) | (col0.r >> 2);
color_array[0].a = 0xFF;
-
+
// @@ Same as above, but faster?
// Color32 c;
// c.u = ((col0.u << 3) & 0xf8) | ((col0.u << 5) & 0xfc00) | ((col0.u << 8) & 0xf80000);
// c.u |= (c.u >> 5) & 0x070007;
// c.u |= (c.u >> 6) & 0x000300;
// color_array[0].u = c.u;
-
+
color_array[1].r = (col1.r << 3) | (col1.r >> 2);
color_array[1].g = (col1.g << 2) | (col1.g >> 4);
color_array[1].b = (col1.b << 3) | (col1.b >> 2);
color_array[1].a = 0xFF;
-
+
// @@ Same as above, but faster?
// c.u = ((col1.u << 3) & 0xf8) | ((col1.u << 5) & 0xfc00) | ((col1.u << 8) & 0xf80000);
// c.u |= (c.u >> 5) & 0x070007;
// c.u |= (c.u >> 6) & 0x000300;
// color_array[1].u = c.u;
-
+
if ( col0.u > col1.u ) {
// Four-color block: derive the other two colors.
color_array[2].r = (2 * color_array[0].r + color_array[1].r) / 3;
color_array[2].g = (2 * color_array[0].g + color_array[1].g) / 3;
color_array[2].b = (2 * color_array[0].b + color_array[1].b) / 3;
color_array[2].a = 0xFF;
-
+
color_array[3].r = (2 * color_array[1].r + color_array[0].r) / 3;
color_array[3].g = (2 * color_array[1].g + color_array[0].g) / 3;
color_array[3].b = (2 * color_array[1].b + color_array[0].b) / 3;
color_array[3].a = 0xFF;
-
+
return 4;
}
else {
@@ -110,13 +110,13 @@ uint BlockDXT1::evaluatePalette(Color32 color_array[4]) const
color_array[2].g = (color_array[0].g + color_array[1].g) / 2;
color_array[2].b = (color_array[0].b + color_array[1].b) / 2;
color_array[2].a = 0xFF;
-
+
// Set all components to 0 to match DXT specs.
color_array[3].r = 0x00; // color_array[2].r;
color_array[3].g = 0x00; // color_array[2].g;
color_array[3].b = 0x00; // color_array[2].b;
color_array[3].a = 0x00;
-
+
return 3;
}
}
@@ -134,7 +134,7 @@ uint BlockDXT1::evaluatePaletteNV5x(Color32 color_array[4]) const
color_array[1].g = (col1.g << 2) | (col1.g >> 4);
color_array[1].b = (3 * col1.b * 22) / 8;
color_array[1].a = 0xFF;
-
+
int gdiff = color_array[1].g - color_array[0].g;
if ( col0.u > col1.u ) {
@@ -143,7 +143,7 @@ uint BlockDXT1::evaluatePaletteNV5x(Color32 color_array[4]) const
color_array[2].g = (256 * color_array[0].g + gdiff / 4 + 128 + gdiff * 80) / 256;
color_array[2].b = ((2 * col0.b + col1.b) * 22) / 8;
color_array[2].a = 0xFF;
-
+
color_array[3].r = ((2 * col1.r + col0.r) * 22) / 8;
color_array[3].g = (256 * color_array[1].g - gdiff / 4 + 128 - gdiff * 80) / 256;
color_array[3].b = ((2 * col1.b + col0.b) * 22) / 8;
@@ -157,13 +157,13 @@ uint BlockDXT1::evaluatePaletteNV5x(Color32 color_array[4]) const
color_array[2].g = (256 * color_array[0].g + gdiff / 4 + 128 + gdiff * 128) / 256;
color_array[2].b = ((col0.b + col1.b) * 33) / 8;
color_array[2].a = 0xFF;
-
+
// Set all components to 0 to match DXT specs.
color_array[3].r = 0x00; // color_array[2].r;
color_array[3].g = 0x00; // color_array[2].g;
color_array[3].b = 0x00; // color_array[2].b;
color_array[3].a = 0x00;
-
+
return 3;
}
}
@@ -175,18 +175,18 @@ void BlockDXT1::evaluatePalette3(Color32 color_array[4]) const
color_array[0].g = (col0.g << 2) | (col0.g >> 4);
color_array[0].r = (col0.r << 3) | (col0.r >> 2);
color_array[0].a = 0xFF;
-
+
color_array[1].r = (col1.r << 3) | (col1.r >> 2);
color_array[1].g = (col1.g << 2) | (col1.g >> 4);
color_array[1].b = (col1.b << 3) | (col1.b >> 2);
color_array[1].a = 0xFF;
-
+
// Three-color block: derive the other color.
color_array[2].r = (color_array[0].r + color_array[1].r) / 2;
color_array[2].g = (color_array[0].g + color_array[1].g) / 2;
color_array[2].b = (color_array[0].b + color_array[1].b) / 2;
color_array[2].a = 0xFF;
-
+
// Set all components to 0 to match DXT specs.
color_array[3].r = 0x00; // color_array[2].r;
color_array[3].g = 0x00; // color_array[2].g;
@@ -201,18 +201,18 @@ void BlockDXT1::evaluatePalette4(Color32 color_array[4]) const
color_array[0].g = (col0.g << 2) | (col0.g >> 4);
color_array[0].r = (col0.r << 3) | (col0.r >> 2);
color_array[0].a = 0xFF;
-
+
color_array[1].r = (col1.r << 3) | (col1.r >> 2);
color_array[1].g = (col1.g << 2) | (col1.g >> 4);
color_array[1].b = (col1.b << 3) | (col1.b >> 2);
color_array[1].a = 0xFF;
-
+
// Four-color block: derive the other two colors.
color_array[2].r = (2 * color_array[0].r + color_array[1].r) / 3;
color_array[2].g = (2 * color_array[0].g + color_array[1].g) / 3;
color_array[2].b = (2 * color_array[0].b + color_array[1].b) / 3;
color_array[2].a = 0xFF;
-
+
color_array[3].r = (2 * color_array[1].r + color_array[0].r) / 3;
color_array[3].g = (2 * color_array[1].g + color_array[0].g) / 3;
color_array[3].b = (2 * color_array[1].b + color_array[0].b) / 3;
@@ -225,7 +225,7 @@ void BlockDXT1::decodeBlock(ColorBlock *block) const
// Decode color block.
Color32 color_array[4];
evaluatePalette(color_array);
-
+
// Write color block.
for ( uint j = 0; j < 4; j++ ) {
for ( uint i = 0; i < 4; i++ ) {
@@ -281,7 +281,7 @@ void BlockDXT3::decodeBlock(ColorBlock *block) const
{
// Decode color.
color.decodeBlock(block);
-
+
// Decode alpha.
alpha.decodeBlock(block);
}
@@ -419,10 +419,10 @@ void AlphaBlockDXT5::decodeBlock(ColorBlock *block) const
{
uint8 alpha_array[8];
evaluatePalette(alpha_array);
-
+
uint8 index_array[16];
indices(index_array);
-
+
for (uint i = 0; i < 16; i++) {
block->color(i).a = alpha_array[index_array[i]];
}
@@ -431,26 +431,26 @@ void AlphaBlockDXT5::decodeBlock(ColorBlock *block) const
void AlphaBlockDXT5::flip4()
{
uint64 * b = (uint64 *)this;
-
+
// @@ The masks might have to be byte swapped.
uint64 tmp = (*b & (uint64)(0x000000000000FFFFLL));
tmp |= (*b & (uint64)(0x000000000FFF0000LL)) << 36;
tmp |= (*b & (uint64)(0x000000FFF0000000LL)) << 12;
tmp |= (*b & (uint64)(0x000FFF0000000000LL)) >> 12;
tmp |= (*b & (uint64)(0xFFF0000000000000LL)) >> 36;
-
+
*b = tmp;
}
void AlphaBlockDXT5::flip2()
{
uint * b = (uint *)this;
-
+
// @@ The masks might have to be byte swapped.
uint tmp = (*b & 0xFF000000);
tmp |= (*b & 0x00000FFF) << 12;
tmp |= (*b & 0x00FFF000) >> 12;
-
+
*b = tmp;
}
@@ -458,7 +458,7 @@ void BlockDXT5::decodeBlock(ColorBlock *block) const
{
// Decode color.
color.decodeBlock(block);
-
+
// Decode alpha.
alpha.decodeBlock(block);
}
@@ -467,7 +467,7 @@ void BlockDXT5::decodeBlockNV5x(ColorBlock *block) const
{
// Decode color.
color.decodeBlockNV5x(block);
-
+
// Decode alpha.
alpha.decodeBlock(block);
}
@@ -492,10 +492,10 @@ void BlockATI1::decodeBlock(ColorBlock *block) const
{
uint8 alpha_array[8];
alpha.evaluatePalette(alpha_array);
-
+
uint8 index_array[16];
alpha.indices(index_array);
-
+
for (uint i = 0; i < 16; i++) {
Color32 & c = block->color(i);
c.b = c.g = c.r = alpha_array[index_array[i]];
@@ -521,10 +521,10 @@ void BlockATI2::decodeBlock(ColorBlock *block) const
{
uint8 alpha_array[8];
uint8 index_array[16];
-
+
x.evaluatePalette(alpha_array);
x.indices(index_array);
-
+
for (uint i = 0; i < 16; i++) {
Color32 & c = block->color(i);
c.r = alpha_array[index_array[i]];
@@ -532,7 +532,7 @@ void BlockATI2::decodeBlock(ColorBlock *block) const
y.evaluatePalette(alpha_array);
y.indices(index_array);
-
+
for (uint i = 0; i < 16; i++) {
Color32 & c = block->color(i);
c.g = alpha_array[index_array[i]];
@@ -563,17 +563,17 @@ void BlockCTX1::evaluatePalette(Color32 color_array[4]) const
color_array[0].g = col0[1];
color_array[0].r = col0[0];
color_array[0].a = 0xFF;
-
+
color_array[1].r = 0x00;
color_array[1].g = col0[1];
color_array[1].b = col1[0];
color_array[1].a = 0xFF;
-
+
color_array[2].r = 0x00;
color_array[2].g = (2 * color_array[0].g + color_array[1].g) / 3;
color_array[2].b = (2 * color_array[0].b + color_array[1].b) / 3;
color_array[2].a = 0xFF;
-
+
color_array[3].r = 0x00;
color_array[3].g = (2 * color_array[1].g + color_array[0].g) / 3;
color_array[3].b = (2 * color_array[1].b + color_array[0].b) / 3;
@@ -585,7 +585,7 @@ void BlockCTX1::decodeBlock(ColorBlock *block) const
// Decode color block.
Color32 color_array[4];
evaluatePalette(color_array);
-
+
// Write color block.
for ( uint j = 0; j < 4; j++ ) {
for ( uint i = 0; i < 4; i++ ) {
diff --git a/source/blender/imbuf/intern/dds/BlockDXT.h b/source/blender/imbuf/intern/dds/BlockDXT.h
index 6aae9c9817c..7371d72ea4a 100644
--- a/source/blender/imbuf/intern/dds/BlockDXT.h
+++ b/source/blender/imbuf/intern/dds/BlockDXT.h
@@ -33,7 +33,7 @@
*/
// Copyright NVIDIA Corporation 2007 -- Ignacio Castano <icastano@nvidia.com>
-//
+//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -42,10 +42,10 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
+//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -79,10 +79,10 @@ struct BlockDXT1 {
void evaluatePalette3(Color32 color_array[4]) const;
void evaluatePalette4(Color32 color_array[4]) const;
-
+
void decodeBlock(ColorBlock * block) const;
void decodeBlockNV5x(ColorBlock * block) const;
-
+
void setIndices(int * idx);
void flip4();
@@ -119,9 +119,9 @@ struct AlphaBlockDXT3 {
};
uint16 row[4];
};
-
+
void decodeBlock(ColorBlock * block) const;
-
+
void flip4();
void flip2();
};
@@ -131,10 +131,10 @@ struct AlphaBlockDXT3 {
struct BlockDXT3 {
AlphaBlockDXT3 alpha;
BlockDXT1 color;
-
+
void decodeBlock(ColorBlock * block) const;
void decodeBlockNV5x(ColorBlock * block) const;
-
+
void flip4();
void flip2();
};
@@ -187,7 +187,7 @@ struct AlphaBlockDXT5 {
uint8 bitsD() const { return (u >> 55) & 0x7LL; }
uint8 bitsE() const { return (u >> 58) & 0x7LL; }
uint8 bitsF() const { return (u >> 61) & 0x7LL; }
-
+
void evaluatePalette(uint8 alpha[8]) const;
void evaluatePalette8(uint8 alpha[8]) const;
void evaluatePalette6(uint8 alpha[8]) const;
@@ -195,9 +195,9 @@ struct AlphaBlockDXT5 {
uint index(uint index) const;
void setIndex(uint index, uint value);
-
+
void decodeBlock(ColorBlock * block) const;
-
+
void flip4();
void flip2();
};
@@ -207,10 +207,10 @@ struct AlphaBlockDXT5 {
struct BlockDXT5 {
AlphaBlockDXT5 alpha;
BlockDXT1 color;
-
+
void decodeBlock(ColorBlock * block) const;
void decodeBlockNV5x(ColorBlock * block) const;
-
+
void flip4();
void flip2();
};
@@ -218,9 +218,9 @@ struct BlockDXT5 {
/// ATI1 block.
struct BlockATI1 {
AlphaBlockDXT5 alpha;
-
+
void decodeBlock(ColorBlock * block) const;
-
+
void flip4();
void flip2();
};
@@ -229,9 +229,9 @@ struct BlockATI1 {
struct BlockATI2 {
AlphaBlockDXT5 x;
AlphaBlockDXT5 y;
-
+
void decodeBlock(ColorBlock * block) const;
-
+
void flip4();
void flip2();
};
@@ -249,7 +249,7 @@ struct BlockCTX1 {
void setIndices(int * idx);
void decodeBlock(ColorBlock * block) const;
-
+
void flip4();
void flip2();
};
diff --git a/source/blender/imbuf/intern/dds/CMakeLists.txt b/source/blender/imbuf/intern/dds/CMakeLists.txt
index 57603725ce1..8c95695f356 100644
--- a/source/blender/imbuf/intern/dds/CMakeLists.txt
+++ b/source/blender/imbuf/intern/dds/CMakeLists.txt
@@ -19,11 +19,11 @@
#
# The Original Code is: all of this file.
#
-# Contributor(s):
+# Contributor(s):
#
# ***** END GPL LICENSE BLOCK *****
-set(INC
+set(INC
.
..
../..
diff --git a/source/blender/imbuf/intern/dds/Color.h b/source/blender/imbuf/intern/dds/Color.h
index 6676057d710..51939a6ea4c 100644
--- a/source/blender/imbuf/intern/dds/Color.h
+++ b/source/blender/imbuf/intern/dds/Color.h
@@ -69,7 +69,7 @@ public:
operator unsigned int () const {
return u;
}
-
+
union {
struct {
unsigned char b, g, r, a;
@@ -85,7 +85,7 @@ public:
Color16() { }
Color16(const Color16 & c) : u(c.u) { }
explicit Color16(unsigned short U) : u(U) { }
-
+
union {
struct {
unsigned short b : 5;
diff --git a/source/blender/imbuf/intern/dds/ColorBlock.cpp b/source/blender/imbuf/intern/dds/ColorBlock.cpp
index dd4ae3e518e..2cee4c984dd 100644
--- a/source/blender/imbuf/intern/dds/ColorBlock.cpp
+++ b/source/blender/imbuf/intern/dds/ColorBlock.cpp
@@ -44,14 +44,14 @@
{
return c.r + c.g + c.b;
}
-
+
// Get the euclidean distance between the given colors.
inline static uint colorDistance(Color32 c0, Color32 c1)
{
return (c0.r - c1.r) * (c0.r - c1.r) + (c0.g - c1.g) * (c0.g - c1.g) + (c0.b - c1.b) * (c0.b - c1.b);
}
#endif
-
+
/// Default constructor.
ColorBlock::ColorBlock()
@@ -120,11 +120,11 @@ void ColorBlock::init(uint w, uint h, const float *data, uint x, uint y)
for (uint i = 0; i < 4; i++) {
const uint by = i % bh;
-
+
for (uint e = 0; e < 4; e++) {
const uint bx = e % bw;
const uint idx = ((y + by) * w + x + bx);
-
+
Color32 & c = color(e, i);
c.r = uint8(255 * CLAMP(data[idx + 0 * srcPlane], 0.0f, 1.0f)); // @@ Is this the right way to quantize floats to bytes?
c.g = uint8(255 * CLAMP(data[idx + 1 * srcPlane], 0.0f, 1.0f));
@@ -160,13 +160,13 @@ void ColorBlock::swizzle(uint x, uint y, uint z, uint w)
bool ColorBlock::isSingleColor(Color32 mask/*= Color32(0xFF, 0xFF, 0xFF, 0x00)*/) const
{
uint u = m_color[0].u & mask.u;
-
+
for (int i = 1; i < 16; i++) {
if (u != (m_color[i].u & mask.u)) {
return false;
}
}
-
+
return true;
}
@@ -191,7 +191,7 @@ bool ColorBlock::isSingleColorNoAlpha() const
return false;
}
}
-
+
return true;
}
*/
@@ -210,12 +210,12 @@ bool ColorBlock::isSingleColorNoAlpha() const
unique = false;
}
}
-
+
if ( unique ) {
count++;
}
}
-
+
return count;
}*/
@@ -231,7 +231,7 @@ Color32 ColorBlock::averageColor() const
b += m_color[i].b;
a += m_color[i].a;
}
-
+
return Color32(uint8(r / 16), uint8(g / 16), uint8(b / 16), uint8(a / 16));
}*/
@@ -251,7 +251,7 @@ void ColorBlock::diameterRange(Color32 *start, Color32 *end) const
{
Color32 c0, c1;
uint best_dist = 0;
-
+
for (int i = 0; i < 16; i++) {
for (int j = i+1; j < 16; j++) {
uint dist = colorDistance(m_color[i], m_color[j]);
@@ -262,7 +262,7 @@ void ColorBlock::diameterRange(Color32 *start, Color32 *end) const
}
}
}
-
+
*start = c0;
*end = c1;
}
@@ -272,13 +272,13 @@ void ColorBlock::luminanceRange(Color32 *start, Color32 *end) const
{
Color32 minColor, maxColor;
uint minLuminance, maxLuminance;
-
+
maxLuminance = minLuminance = colorLuminance(m_color[0]);
-
+
for (uint i = 1; i < 16; i++)
{
uint luminance = colorLuminance(m_color[i]);
-
+
if (luminance > maxLuminance) {
maxLuminance = luminance;
maxColor = m_color[i];
@@ -293,7 +293,7 @@ void ColorBlock::luminanceRange(Color32 *start, Color32 *end) const
*end = maxColor;
}
-/// Get color range based on the bounding box.
+/// Get color range based on the bounding box.
void ColorBlock::boundsRange(Color32 *start, Color32 *end) const
{
Color32 minColor(255, 255, 255);
@@ -327,7 +327,7 @@ void ColorBlock::boundsRange(Color32 *start, Color32 *end) const
*end = maxColor;
}
-/// Get color range based on the bounding box.
+/// Get color range based on the bounding box.
void ColorBlock::boundsRangeAlpha(Color32 *start, Color32 *end) const
{
Color32 minColor(255, 255, 255, 255);
@@ -361,7 +361,7 @@ void ColorBlock::boundsRangeAlpha(Color32 *start, Color32 *end) const
maxColor.g = (maxColor.g >= inset.g) ? maxColor.g - inset.g : 0;
maxColor.b = (maxColor.b >= inset.b) ? maxColor.b - inset.b : 0;
maxColor.a = (maxColor.a >= inset.a) ? maxColor.a - inset.a : 0;
-
+
*start = minColor;
*end = maxColor;
}
@@ -374,10 +374,10 @@ void ColorBlock::sortColorsByAbsoluteValue()
for ( uint a = 0; a < 16; a++ ) {
uint max = a;
Color16 cmax(m_color[a]);
-
+
for ( uint b = a+1; b < 16; b++ ) {
Color16 cb(m_color[b]);
-
+
if ( cb.u > cmax.u ) {
max = b;
cmax = cb;
@@ -391,17 +391,17 @@ void ColorBlock::sortColorsByAbsoluteValue()
/*/// Find extreme colors in the given axis.
void ColorBlock::computeRange(Vector3::Arg axis, Color32 *start, Color32 *end) const
{
-
+
int mini, maxi;
mini = maxi = 0;
-
+
float min, max;
min = max = dot(Vector3(m_color[0].r, m_color[0].g, m_color[0].b), axis);
for (uint i = 1; i < 16; i++)
{
const Vector3 vec(m_color[i].r, m_color[i].g, m_color[i].b);
-
+
float val = dot(vec, axis);
if ( val < min ) {
mini = i;
@@ -412,7 +412,7 @@ void ColorBlock::computeRange(Vector3::Arg axis, Color32 *start, Color32 *end) c
max = val;
}
}
-
+
*start = m_color[mini];
*end = m_color[maxi];
}*/
@@ -422,12 +422,12 @@ void ColorBlock::computeRange(Vector3::Arg axis, Color32 *start, Color32 *end) c
void ColorBlock::sortColors(const Vector3 & axis)
{
float luma_array[16];
-
+
for (uint i = 0; i < 16; i++) {
const Vector3 vec(m_color[i].r, m_color[i].g, m_color[i].b);
luma_array[i] = dot(vec, axis);
}
-
+
// Dummy selection sort.
for ( uint a = 0; a < 16; a++ ) {
uint min = a;
@@ -447,12 +447,12 @@ float ColorBlock::volume() const
{
Box bounds;
bounds.clearBounds();
-
+
for (int i = 0; i < 16; i++) {
const Vector3 point(m_color[i].r, m_color[i].g, m_color[i].b);
bounds.addPointToBounds(point);
}
-
+
return bounds.volume();
}
*/
diff --git a/source/blender/imbuf/intern/dds/ColorBlock.h b/source/blender/imbuf/intern/dds/ColorBlock.h
index 8d5031aa603..7b5291cf976 100644
--- a/source/blender/imbuf/intern/dds/ColorBlock.h
+++ b/source/blender/imbuf/intern/dds/ColorBlock.h
@@ -46,30 +46,30 @@ struct ColorBlock {
ColorBlock(const uint * linearImage);
ColorBlock(const ColorBlock & block);
ColorBlock(const Image * img, uint x, uint y);
-
+
void init(const Image * img, uint x, uint y);
void init(uint w, uint h, const uint * data, uint x, uint y);
void init(uint w, uint h, const float * data, uint x, uint y);
-
+
void swizzle(uint x, uint y, uint z, uint w); // 0=r, 1=g, 2=b, 3=a, 4=0xFF, 5=0
-
+
bool isSingleColor(Color32 mask = Color32(0xFF, 0xFF, 0xFF, 0x00)) const;
bool hasAlpha() const;
-
-
+
+
// Accessors
const Color32 * colors() const;
Color32 color(uint i) const;
Color32 & color(uint i);
-
+
Color32 color(uint x, uint y) const;
Color32 & color(uint x, uint y);
-
+
private:
-
+
Color32 m_color[4 * 4];
-
+
};
diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
index 7c11fca3c34..97ce5b90fa0 100644
--- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
+++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
@@ -33,7 +33,7 @@
*/
// Copyright NVIDIA Corporation 2007 -- Ignacio Castano <icastano@nvidia.com>
-//
+//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -42,10 +42,10 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
+//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -84,7 +84,7 @@ static const uint FOURCC_ATI1 = DDS_MAKEFOURCC('A', 'T', 'I', '1');
static const uint FOURCC_ATI2 = DDS_MAKEFOURCC('A', 'T', 'I', '2');
//static const uint FOURCC_A2XY = DDS_MAKEFOURCC('A', '2', 'X', 'Y');
-
+
static const uint FOURCC_DX10 = DDS_MAKEFOURCC('D', 'X', '1', '0');
static const uint FOURCC_UVER = DDS_MAKEFOURCC('U', 'V', 'E', 'R');
@@ -112,7 +112,7 @@ static const uint D3DFMT_A2R10G10B10 = 35;
// Palette formats.
//static const uint D3DFMT_A8P8 = 40;
//static const uint D3DFMT_P8 = 41;
-
+
// Luminance formats.
static const uint D3DFMT_L8 = 50;
//static const uint D3DFMT_A8L8 = 51;
@@ -126,7 +126,7 @@ static const uint D3DFMT_L16 = 81;
//static const uint D3DFMT_R32F = 114;
//static const uint D3DFMT_G32R32F = 115;
//static const uint D3DFMT_A32B32G32R32F = 116;
-
+
static const uint DDSD_CAPS = 0x00000001U;
static const uint DDSD_PIXELFORMAT = 0x00001000U;
static const uint DDSD_WIDTH = 0x00000004U;
@@ -135,7 +135,7 @@ static const uint DDSD_PITCH = 0x00000008U;
static const uint DDSD_MIPMAPCOUNT = 0x00020000U;
static const uint DDSD_LINEARSIZE = 0x00080000U;
static const uint DDSD_DEPTH = 0x00800000U;
-
+
static const uint DDSCAPS_COMPLEX = 0x00000008U;
static const uint DDSCAPS_TEXTURE = 0x00001000U;
static const uint DDSCAPS_MIPMAP = 0x00400000U;
@@ -162,78 +162,78 @@ static const uint DDPF_LUMINANCE = 0x00020000U;
static const uint DDPF_ALPHAPREMULT = 0x00008000U;
// Custom NVTT flags.
-static const uint DDPF_NORMAL = 0x80000000U;
+static const uint DDPF_NORMAL = 0x80000000U;
static const uint DDPF_SRGB = 0x40000000U;
// DX10 formats.
enum DXGI_FORMAT
{
DXGI_FORMAT_UNKNOWN = 0,
-
+
DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
DXGI_FORMAT_R32G32B32A32_UINT = 3,
DXGI_FORMAT_R32G32B32A32_SINT = 4,
-
+
DXGI_FORMAT_R32G32B32_TYPELESS = 5,
DXGI_FORMAT_R32G32B32_FLOAT = 6,
DXGI_FORMAT_R32G32B32_UINT = 7,
DXGI_FORMAT_R32G32B32_SINT = 8,
-
+
DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
DXGI_FORMAT_R16G16B16A16_UNORM = 11,
DXGI_FORMAT_R16G16B16A16_UINT = 12,
DXGI_FORMAT_R16G16B16A16_SNORM = 13,
DXGI_FORMAT_R16G16B16A16_SINT = 14,
-
+
DXGI_FORMAT_R32G32_TYPELESS = 15,
DXGI_FORMAT_R32G32_FLOAT = 16,
DXGI_FORMAT_R32G32_UINT = 17,
DXGI_FORMAT_R32G32_SINT = 18,
-
+
DXGI_FORMAT_R32G8X24_TYPELESS = 19,
DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21,
DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
-
+
DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
DXGI_FORMAT_R10G10B10A2_UNORM = 24,
DXGI_FORMAT_R10G10B10A2_UINT = 25,
-
+
DXGI_FORMAT_R11G11B10_FLOAT = 26,
-
+
DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
DXGI_FORMAT_R8G8B8A8_UNORM = 28,
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
DXGI_FORMAT_R8G8B8A8_UINT = 30,
DXGI_FORMAT_R8G8B8A8_SNORM = 31,
DXGI_FORMAT_R8G8B8A8_SINT = 32,
-
+
DXGI_FORMAT_R16G16_TYPELESS = 33,
DXGI_FORMAT_R16G16_FLOAT = 34,
DXGI_FORMAT_R16G16_UNORM = 35,
DXGI_FORMAT_R16G16_UINT = 36,
DXGI_FORMAT_R16G16_SNORM = 37,
DXGI_FORMAT_R16G16_SINT = 38,
-
+
DXGI_FORMAT_R32_TYPELESS = 39,
DXGI_FORMAT_D32_FLOAT = 40,
DXGI_FORMAT_R32_FLOAT = 41,
DXGI_FORMAT_R32_UINT = 42,
DXGI_FORMAT_R32_SINT = 43,
-
+
DXGI_FORMAT_R24G8_TYPELESS = 44,
DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
-
+
DXGI_FORMAT_R8G8_TYPELESS = 48,
DXGI_FORMAT_R8G8_UNORM = 49,
DXGI_FORMAT_R8G8_UINT = 50,
DXGI_FORMAT_R8G8_SNORM = 51,
DXGI_FORMAT_R8G8_SINT = 52,
-
+
DXGI_FORMAT_R16_TYPELESS = 53,
DXGI_FORMAT_R16_FLOAT = 54,
DXGI_FORMAT_D16_UNORM = 55,
@@ -241,41 +241,41 @@ static const uint DDPF_SRGB = 0x40000000U;
DXGI_FORMAT_R16_UINT = 57,
DXGI_FORMAT_R16_SNORM = 58,
DXGI_FORMAT_R16_SINT = 59,
-
+
DXGI_FORMAT_R8_TYPELESS = 60,
DXGI_FORMAT_R8_UNORM = 61,
DXGI_FORMAT_R8_UINT = 62,
DXGI_FORMAT_R8_SNORM = 63,
DXGI_FORMAT_R8_SINT = 64,
DXGI_FORMAT_A8_UNORM = 65,
-
+
DXGI_FORMAT_R1_UNORM = 66,
-
+
DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
-
+
DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
-
+
DXGI_FORMAT_BC1_TYPELESS = 70,
DXGI_FORMAT_BC1_UNORM = 71,
DXGI_FORMAT_BC1_UNORM_SRGB = 72,
-
+
DXGI_FORMAT_BC2_TYPELESS = 73,
DXGI_FORMAT_BC2_UNORM = 74,
DXGI_FORMAT_BC2_UNORM_SRGB = 75,
-
+
DXGI_FORMAT_BC3_TYPELESS = 76,
DXGI_FORMAT_BC3_UNORM = 77,
DXGI_FORMAT_BC3_UNORM_SRGB = 78,
-
+
DXGI_FORMAT_BC4_TYPELESS = 79,
DXGI_FORMAT_BC4_UNORM = 80,
DXGI_FORMAT_BC4_SNORM = 81,
-
+
DXGI_FORMAT_BC5_TYPELESS = 82,
DXGI_FORMAT_BC5_UNORM = 83,
DXGI_FORMAT_BC5_SNORM = 84,
-
+
DXGI_FORMAT_B5G6R5_UNORM = 85,
DXGI_FORMAT_B5G5R5A1_UNORM = 86,
DXGI_FORMAT_B8G8R8A8_UNORM = 87,
@@ -312,71 +312,71 @@ static const uint DDPF_SRGB = 0x40000000U;
switch (dxgiFormat)
{
CASE(UNKNOWN);
-
+
CASE(R32G32B32A32_TYPELESS);
CASE(R32G32B32A32_FLOAT);
CASE(R32G32B32A32_UINT);
CASE(R32G32B32A32_SINT);
-
+
CASE(R32G32B32_TYPELESS);
CASE(R32G32B32_FLOAT);
CASE(R32G32B32_UINT);
CASE(R32G32B32_SINT);
-
+
CASE(R16G16B16A16_TYPELESS);
CASE(R16G16B16A16_FLOAT);
CASE(R16G16B16A16_UNORM);
CASE(R16G16B16A16_UINT);
CASE(R16G16B16A16_SNORM);
CASE(R16G16B16A16_SINT);
-
+
CASE(R32G32_TYPELESS);
CASE(R32G32_FLOAT);
CASE(R32G32_UINT);
CASE(R32G32_SINT);
-
+
CASE(R32G8X24_TYPELESS);
CASE(D32_FLOAT_S8X24_UINT);
CASE(R32_FLOAT_X8X24_TYPELESS);
CASE(X32_TYPELESS_G8X24_UINT);
-
+
CASE(R10G10B10A2_TYPELESS);
CASE(R10G10B10A2_UNORM);
CASE(R10G10B10A2_UINT);
-
+
CASE(R11G11B10_FLOAT);
-
+
CASE(R8G8B8A8_TYPELESS);
CASE(R8G8B8A8_UNORM);
CASE(R8G8B8A8_UNORM_SRGB);
CASE(R8G8B8A8_UINT);
CASE(R8G8B8A8_SNORM);
CASE(R8G8B8A8_SINT);
-
+
CASE(R16G16_TYPELESS);
CASE(R16G16_FLOAT);
CASE(R16G16_UNORM);
CASE(R16G16_UINT);
CASE(R16G16_SNORM);
CASE(R16G16_SINT);
-
+
CASE(R32_TYPELESS);
CASE(D32_FLOAT);
CASE(R32_FLOAT);
CASE(R32_UINT);
CASE(R32_SINT);
-
+
CASE(R24G8_TYPELESS);
CASE(D24_UNORM_S8_UINT);
CASE(R24_UNORM_X8_TYPELESS);
CASE(X24_TYPELESS_G8_UINT);
-
+
CASE(R8G8_TYPELESS);
CASE(R8G8_UNORM);
CASE(R8G8_UINT);
CASE(R8G8_SNORM);
CASE(R8G8_SINT);
-
+
CASE(R16_TYPELESS);
CASE(R16_FLOAT);
CASE(D16_UNORM);
@@ -384,7 +384,7 @@ static const uint DDPF_SRGB = 0x40000000U;
CASE(R16_UINT);
CASE(R16_SNORM);
CASE(R16_SINT);
-
+
CASE(R8_TYPELESS);
CASE(R8_UNORM);
CASE(R8_UINT);
@@ -393,28 +393,28 @@ static const uint DDPF_SRGB = 0x40000000U;
CASE(A8_UNORM);
CASE(R1_UNORM);
-
+
CASE(R9G9B9E5_SHAREDEXP);
-
+
CASE(R8G8_B8G8_UNORM);
CASE(G8R8_G8B8_UNORM);
CASE(BC1_TYPELESS);
CASE(BC1_UNORM);
CASE(BC1_UNORM_SRGB);
-
+
CASE(BC2_TYPELESS);
CASE(BC2_UNORM);
CASE(BC2_UNORM_SRGB);
-
+
CASE(BC3_TYPELESS);
CASE(BC3_UNORM);
CASE(BC3_UNORM_SRGB);
-
+
CASE(BC4_TYPELESS);
CASE(BC4_UNORM);
CASE(BC4_SNORM);
-
+
CASE(BC5_TYPELESS);
CASE(BC5_UNORM);
CASE(BC5_SNORM);
@@ -424,12 +424,12 @@ static const uint DDPF_SRGB = 0x40000000U;
CASE(B8G8R8A8_UNORM);
CASE(B8G8R8X8_UNORM);
- default:
+ default:
return "UNKNOWN";
}
#undef CASE
}
-
+
static const char * getD3d10ResourceDimensionString(D3D10_RESOURCE_DIMENSION resourceDimension)
{
switch (resourceDimension)
@@ -686,7 +686,7 @@ void DDSHeader::setFormatCode(uint32 code)
// set fourcc pixel format.
this->pf.flags = DDPF_FOURCC;
this->pf.fourcc = code;
-
+
this->pf.bitcount = 0;
this->pf.rmask = 0;
this->pf.gmask = 0;
@@ -803,7 +803,7 @@ void DDSHeader::swapBytes()
this->pitch = POSH_LittleU32(this->pitch);
this->depth = POSH_LittleU32(this->depth);
this->mipmapcount = POSH_LittleU32(this->mipmapcount);
-
+
for (int i = 0; i < 11; i++) {
this->reserved[i] = POSH_LittleU32(this->reserved[i]);
}
@@ -898,12 +898,12 @@ bool DirectDrawSurface::isValid() const
{
return false;
}
-
+
const uint required = (DDSD_WIDTH|DDSD_HEIGHT/*|DDSD_CAPS|DDSD_PIXELFORMAT*/);
if ( (header.flags & required) != required ) {
return false;
}
-
+
if (header.pf.size != 32) {
return false;
}
@@ -958,20 +958,20 @@ bool DirectDrawSurface::isSupported() const
{
return false;
}
-
+
if (isTextureCube() && (header.caps.caps2 & DDSCAPS2_CUBEMAP_ALL_FACES) != DDSCAPS2_CUBEMAP_ALL_FACES)
{
// Cubemaps must contain all faces.
return false;
}
-
+
if (isTexture3D())
{
// @@ 3D textures not supported yet.
return false;
}
}
-
+
return true;
}
@@ -980,14 +980,14 @@ bool DirectDrawSurface::hasAlpha() const
if (header.hasDX10Header())
{
/* TODO: Update hasAlpha to handle all DX10 formats. */
- return
+ return
header.header10.dxgiFormat == DXGI_FORMAT_BC1_UNORM ||
header.header10.dxgiFormat == DXGI_FORMAT_BC2_UNORM ||
header.header10.dxgiFormat == DXGI_FORMAT_BC3_UNORM;
}
else
{
- if (header.pf.flags & DDPF_RGB)
+ if (header.pf.flags & DDPF_RGB)
{
return header.pf.amask != 0;
}
@@ -1096,19 +1096,19 @@ void DirectDrawSurface::setUserVersion(int version)
void DirectDrawSurface::mipmap(Image *img, uint face, uint mipmap)
{
stream.seek(offset(face, mipmap));
-
+
uint w = width();
uint h = height();
-
+
// Compute width and height.
for (uint m = 0; m < mipmap; m++)
{
w = MAX(1U, w / 2);
h = MAX(1U, h / 2);
}
-
+
img->allocate(w, h);
-
+
if (hasAlpha())
{
img->setFormat(Image::Format_ARGB);
@@ -1125,7 +1125,7 @@ void DirectDrawSurface::mipmap(Image *img, uint face, uint mipmap)
}
else
{
- if (header.pf.flags & DDPF_RGB)
+ if (header.pf.flags & DDPF_RGB)
{
readLinearImage(img);
}
@@ -1161,19 +1161,19 @@ void* DirectDrawSurface::readData(uint &rsize)
void DirectDrawSurface::readLinearImage(Image *img)
{
-
+
const uint w = img->width();
const uint h = img->height();
-
+
uint rshift, rsize;
PixelFormat::maskShiftAndSize(header.pf.rmask, &rshift, &rsize);
-
+
uint gshift, gsize;
PixelFormat::maskShiftAndSize(header.pf.gmask, &gshift, &gsize);
-
+
uint bshift, bsize;
PixelFormat::maskShiftAndSize(header.pf.bmask, &bshift, &bsize);
-
+
uint ashift, asize;
PixelFormat::maskShiftAndSize(header.pf.amask, &ashift, &asize);
@@ -1210,19 +1210,19 @@ void DirectDrawSurface::readBlockImage(Image *img)
const uint w = img->width();
const uint h = img->height();
-
+
const uint bw = (w + 3) / 4;
const uint bh = (h + 3) / 4;
-
+
for (uint by = 0; by < bh; by++)
{
for (uint bx = 0; bx < bw; bx++)
{
ColorBlock block;
-
+
// Read color block.
readBlock(&block);
-
+
// Write color block.
for (uint y = 0; y < MIN(4U, h-4*by); y++)
{
@@ -1242,7 +1242,7 @@ static Color32 buildNormal(uint8 x, uint8 y)
float nz = 0.0f;
if (1 - nx*nx - ny*ny > 0) nz = sqrt(1 - nx*nx - ny*ny);
uint8 z = CLAMP(int(255.0f * (nz + 1) / 2.0f), 0, 255);
-
+
return Color32(x, y, z);
}
@@ -1282,7 +1282,7 @@ void DirectDrawSurface::readBlock(ColorBlock *rgba)
BlockDXT5 block;
mem_read(stream, block);
block.decodeBlock(rgba);
-
+
if (fourcc == FOURCC_RXGB)
{
// Swap R & A.
@@ -1307,7 +1307,7 @@ void DirectDrawSurface::readBlock(ColorBlock *rgba)
mem_read(stream, block);
block.decodeBlock(rgba);
}
-
+
// If normal flag set, convert to normal.
if (header.pf.flags & DDPF_NORMAL)
{
@@ -1377,7 +1377,7 @@ uint DirectDrawSurface::mipmapSize(uint mipmap) const
uint w = width();
uint h = height();
uint d = depth();
-
+
for (uint m = 0; m < mipmap; m++)
{
w = MAX(1U, w / 2);
@@ -1408,19 +1408,19 @@ uint DirectDrawSurface::faceSize() const
{
const uint count = mipmapCount();
uint size = 0;
-
+
for (uint m = 0; m < count; m++)
{
size += mipmapSize(m);
}
-
+
return size;
}
uint DirectDrawSurface::offset(const uint face, const uint mipmap)
{
uint size = 128; // sizeof(DDSHeader);
-
+
if (header.hasDX10Header())
{
size += 20; // sizeof(DDSHeader10);
@@ -1430,12 +1430,12 @@ uint DirectDrawSurface::offset(const uint face, const uint mipmap)
{
size += face * faceSize();
}
-
+
for (uint m = 0; m < mipmap; m++)
{
size += mipmapSize(m);
}
-
+
return size;
}
@@ -1458,7 +1458,7 @@ void DirectDrawSurface::printInfo() const
if (header.flags & DDSD_PITCH) printf("Pitch: %u\n", header.pitch);
else if (header.flags & DDSD_LINEARSIZE) printf("Linear size: %u\n", header.pitch);
printf("Mipmap count: %u\n", header.mipmapcount);
-
+
printf("Pixel Format:\n");
printf("\tFlags: 0x%.8X\n", header.pf.flags);
if (header.pf.flags & DDPF_RGB) printf("\t\tDDPF_RGB\n");
@@ -1472,7 +1472,7 @@ void DirectDrawSurface::printInfo() const
if (header.pf.flags & DDPF_PALETTEINDEXED8) printf("\t\tDDPF_PALETTEINDEXED8\n");
if (header.pf.flags & DDPF_ALPHAPREMULT) printf("\t\tDDPF_ALPHAPREMULT\n");
if (header.pf.flags & DDPF_NORMAL) printf("\t\tDDPF_NORMAL\n");
-
+
if (header.pf.fourcc != 0) {
// Display fourcc code even when DDPF_FOURCC flag not set.
printf("\tFourCC: '%c%c%c%c' (0x%.8X)\n",
@@ -1541,7 +1541,7 @@ void DirectDrawSurface::printInfo() const
int major = (header.reserved[10] >> 16) & 0xFF;
int minor = (header.reserved[10] >> 8) & 0xFF;
int revision= header.reserved[10] & 0xFF;
-
+
printf("Version:\n");
printf("\tNVIDIA Texture Tools %d.%d.%d\n", major, minor, revision);
}
diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.h b/source/blender/imbuf/intern/dds/DirectDrawSurface.h
index 44c27a98c1d..b7bcb8303bf 100644
--- a/source/blender/imbuf/intern/dds/DirectDrawSurface.h
+++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.h
@@ -33,7 +33,7 @@
*/
// Copyright NVIDIA Corporation 2007 -- Ignacio Castano <icastano@nvidia.com>
-//
+//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -42,10 +42,10 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
+//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -109,7 +109,7 @@ struct DDSHeader {
// Helper methods.
DDSHeader();
-
+
void setWidth(uint w);
void setHeight(uint h);
void setDepth(uint d);
@@ -128,9 +128,9 @@ struct DDSHeader {
void setSrgbFlag(bool b);
void setHasAlphaFlag(bool b);
void setUserVersion(int version);
-
+
/*void swapBytes();*/
-
+
bool hasDX10Header() const;
uint signature() const;
uint toolVersion() const;
@@ -147,12 +147,12 @@ class DirectDrawSurface
public:
DirectDrawSurface(unsigned char *mem, uint size);
~DirectDrawSurface();
-
+
bool isValid() const;
bool isSupported() const;
bool hasAlpha() const;
-
+
uint mipmapCount() const;
uint fourCC() const;
uint width() const;
@@ -166,26 +166,26 @@ public:
void setNormalFlag(bool b);
void setHasAlphaFlag(bool b);
void setUserVersion(int version);
-
+
void mipmap(Image *img, uint f, uint m);
void *readData(uint &size);
// void mipmap(FloatImage *img, uint f, uint m);
-
+
void printInfo() const;
private:
-
+
uint blockSize() const;
uint faceSize() const;
uint mipmapSize(uint m) const;
-
+
uint offset(uint f, uint m);
-
+
void readLinearImage(Image * img);
void readBlockImage(Image * img);
void readBlock(ColorBlock * rgba);
-
-
+
+
private:
Stream stream; // memory where DDS file resides
DDSHeader header;
diff --git a/source/blender/imbuf/intern/dds/Image.h b/source/blender/imbuf/intern/dds/Image.h
index 658f01deaec..bb74a9d5d15 100644
--- a/source/blender/imbuf/intern/dds/Image.h
+++ b/source/blender/imbuf/intern/dds/Image.h
@@ -44,45 +44,45 @@
class Image
{
public:
-
- enum Format
+
+ enum Format
{
Format_RGB,
Format_ARGB,
};
-
+
Image();
~Image();
-
+
void allocate(uint w, uint h);
#if 0
bool load(const char *name);
-
+
void wrap(void *data, uint w, uint h);
void unwrap();
#endif
-
+
uint width() const;
uint height() const;
-
+
const Color32 * scanline(uint h) const;
Color32 * scanline(uint h);
-
+
const Color32 * pixels() const;
Color32 * pixels();
-
+
const Color32 & pixel(uint idx) const;
Color32 & pixel(uint idx);
-
+
const Color32 & pixel(uint x, uint y) const;
Color32 & pixel(uint x, uint y);
-
+
Format format() const;
void setFormat(Format f);
-
+
private:
void free();
-
+
private:
uint m_width;
uint m_height;
diff --git a/source/blender/imbuf/intern/dds/PixelFormat.h b/source/blender/imbuf/intern/dds/PixelFormat.h
index e841e696833..e37e09dd661 100644
--- a/source/blender/imbuf/intern/dds/PixelFormat.h
+++ b/source/blender/imbuf/intern/dds/PixelFormat.h
@@ -33,7 +33,7 @@
*/
// Copyright NVIDIA Corporation 2007 -- Ignacio Castano <icastano@nvidia.com>
-//
+//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -42,10 +42,10 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
+//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -93,7 +93,7 @@
++(*shift);
mask >>= 1;
}
-
+
*size = 0;
while ((mask & 1) == 1) {
++(*size);
diff --git a/source/blender/imbuf/intern/dds/dds_api.cpp b/source/blender/imbuf/intern/dds/dds_api.cpp
index 67a0b0ffd00..c038407c0a6 100644
--- a/source/blender/imbuf/intern/dds/dds_api.cpp
+++ b/source/blender/imbuf/intern/dds/dds_api.cpp
@@ -143,7 +143,7 @@ struct ImBuf *imb_load_dds(const unsigned char *mem, size_t size, int flags, cha
}
}
}
- ibuf = IMB_allocImBuf(dds.width(), dds.height(), bits_per_pixel, 0);
+ ibuf = IMB_allocImBuf(dds.width(), dds.height(), bits_per_pixel, 0);
if (ibuf == 0) return(0); /* memory allocation failed */
ibuf->ftype = IMB_FTYPE_DDS;
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c
index 769d53a44ef..2b6fa573e63 100644
--- a/source/blender/imbuf/intern/divers.c
+++ b/source/blender/imbuf/intern/divers.c
@@ -50,24 +50,24 @@
void IMB_de_interlace(ImBuf *ibuf)
{
ImBuf *tbuf1, *tbuf2;
-
+
if (ibuf == NULL) return;
if (ibuf->flags & IB_fields) return;
ibuf->flags |= IB_fields;
-
+
if (ibuf->rect) {
/* make copies */
tbuf1 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect);
tbuf2 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect);
-
+
ibuf->x *= 2;
IMB_rectcpy(tbuf1, ibuf, 0, 0, 0, 0, ibuf->x, ibuf->y);
IMB_rectcpy(tbuf2, ibuf, 0, 0, tbuf2->x, 0, ibuf->x, ibuf->y);
-
+
ibuf->x /= 2;
IMB_rectcpy(ibuf, tbuf1, 0, 0, 0, 0, tbuf1->x, tbuf1->y);
IMB_rectcpy(ibuf, tbuf2, 0, tbuf2->y, 0, 0, tbuf2->x, tbuf2->y);
-
+
IMB_freeImBuf(tbuf1);
IMB_freeImBuf(tbuf2);
}
diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c
index 902fc6482da..decbfd6d5b9 100644
--- a/source/blender/imbuf/intern/filter.c
+++ b/source/blender/imbuf/intern/filter.c
@@ -69,7 +69,7 @@ static void filtrow(unsigned char *point, int x)
static void filtrowf(float *point, int x)
{
float c1, c2, c3;
-
+
if (x > 1) {
c1 = c2 = *point;
for (x--; x > 0; x--) {
@@ -112,7 +112,7 @@ static void filtcolum(unsigned char *point, int y, int skip)
static void filtcolumf(float *point, int y, int skip)
{
float c1, c2, c3, *point2;
-
+
if (y > 1) {
c1 = c2 = *point;
point2 = point;
@@ -211,7 +211,7 @@ static void imb_filterN(ImBuf *out, ImBuf *in)
const int channels = in->channels;
const int rowlen = in->x;
-
+
if (in->rect && out->rect) {
for (int y = 0; y < in->y; y++) {
/* setup rows */
@@ -515,13 +515,13 @@ void IMB_remakemipmap(ImBuf *ibuf, int use_filter)
{
ImBuf *hbuf = ibuf;
int curmap = 0;
-
+
ibuf->miptot = 1;
-
+
while (curmap < IMB_MIPMAP_LEVELS) {
-
+
if (ibuf->mipmap[curmap]) {
-
+
if (use_filter) {
ImBuf *nbuf = IMB_allocImBuf(hbuf->x, hbuf->y, hbuf->planes, hbuf->flags);
imb_filterN(nbuf, hbuf);
@@ -531,15 +531,15 @@ void IMB_remakemipmap(ImBuf *ibuf, int use_filter)
else
imb_onehalf_no_alloc(ibuf->mipmap[curmap], hbuf);
}
-
+
ibuf->miptot = curmap + 2;
hbuf = ibuf->mipmap[curmap];
if (hbuf)
hbuf->miplevel = curmap + 1;
-
+
if (!hbuf || (hbuf->x <= 2 && hbuf->y <= 2))
break;
-
+
curmap++;
}
}
@@ -551,11 +551,11 @@ void IMB_makemipmap(ImBuf *ibuf, int use_filter)
int curmap = 0;
imb_freemipmapImBuf(ibuf);
-
+
/* no mipmap for non RGBA images */
if (ibuf->rect_float && ibuf->channels < 4)
return;
-
+
ibuf->miptot = 1;
while (curmap < IMB_MIPMAP_LEVELS) {
diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c
index 0f5fd6518fb..2eec5da7bc4 100644
--- a/source/blender/imbuf/intern/imageprocess.c
+++ b/source/blender/imbuf/intern/imageprocess.c
@@ -87,10 +87,10 @@ static void pixel_from_buffer(struct ImBuf *ibuf, unsigned char **outI, float **
{
size_t offset = ((size_t)ibuf->x) * y * 4 + 4 * x;
-
+
if (ibuf->rect)
*outI = (unsigned char *)ibuf->rect + offset;
-
+
if (ibuf->rect_float)
*outF = ibuf->rect_float + offset;
}
@@ -112,13 +112,13 @@ void bicubic_interpolation(ImBuf *in, ImBuf *out, float u, float v, int xout, in
{
unsigned char *outI = NULL;
float *outF = NULL;
-
+
if (in == NULL || (in->rect == NULL && in->rect_float == NULL)) {
return;
}
-
+
pixel_from_buffer(out, &outI, &outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */
-
+
bicubic_interpolation_color(in, outI, outF, u, v);
}
@@ -145,8 +145,8 @@ void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char outI[4],
unsigned char *row1I, *row2I, *row3I, *row4I;
float a_b, ma_b, a_mb, ma_mb;
int y1, y2, x1, x2;
-
-
+
+
/* ImBuf in must have a valid rect or rect_float, assume this is already checked */
x1 = (int)floor(u);
@@ -194,7 +194,7 @@ void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char outI[4],
row2I = (unsigned char *)in->rect + ((size_t)in->x) * y2 * 4 + 4 * x1;
row3I = (unsigned char *)in->rect + ((size_t)in->x) * y1 * 4 + 4 * x2;
row4I = (unsigned char *)in->rect + ((size_t)in->x) * y2 * 4 + 4 * x2;
-
+
/* need to add 0.5 to avoid rounding down (causes darken with the smear brush)
* tested with white images and this should not wrap back to zero */
outI[0] = (ma_mb * row1I[0] + a_mb * row3I[0] + ma_b * row2I[0] + a_b * row4I[0]) + 0.5f;
@@ -208,13 +208,13 @@ void bilinear_interpolation(ImBuf *in, ImBuf *out, float u, float v, int xout, i
{
unsigned char *outI = NULL;
float *outF = NULL;
-
+
if (in == NULL || (in->rect == NULL && in->rect_float == NULL)) {
return;
}
-
+
pixel_from_buffer(out, &outI, &outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */
-
+
bilinear_interpolation_color(in, outI, outF, u, v);
}
@@ -227,7 +227,7 @@ void nearest_interpolation_color(struct ImBuf *in, unsigned char outI[4], float
int y1, x1;
/* ImBuf in must have a valid rect or rect_float, assume this is already checked */
-
+
x1 = (int)(u);
y1 = (int)(v);
@@ -316,9 +316,9 @@ void nearest_interpolation(ImBuf *in, ImBuf *out, float x, float y, int xout, in
if (in == NULL || (in->rect == NULL && in->rect_float == NULL)) {
return;
}
-
+
pixel_from_buffer(out, &outI, &outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */
-
+
nearest_interpolation_color(in, outI, outF, x, y);
}
diff --git a/source/blender/imbuf/intern/imbuf.h b/source/blender/imbuf/intern/imbuf.h
index 90dad70fa61..7c455edd916 100644
--- a/source/blender/imbuf/intern/imbuf.h
+++ b/source/blender/imbuf/intern/imbuf.h
@@ -34,7 +34,7 @@
#include <stdlib.h>
#include <sys/types.h>
-#include <stdio.h>
+#include <stdio.h>
#ifndef WIN32
# include <unistd.h>
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c
index eaf4dfd84b4..167f2e4f8e0 100644
--- a/source/blender/imbuf/intern/indexer.c
+++ b/source/blender/imbuf/intern/indexer.c
@@ -142,7 +142,7 @@ void IMB_index_builder_finish(anim_index_builder *fp, int rollback)
}
fclose(fp->fp);
-
+
if (rollback) {
unlink(fp->temp_name);
}
@@ -185,7 +185,7 @@ struct anim_index *IMB_indexer_open(const char *name)
idx = MEM_callocN(sizeof(struct anim_index), "anim_index");
BLI_strncpy(idx->name, name, sizeof(idx->name));
-
+
fseek(fp, 0, SEEK_END);
idx->num_entries = (ftell(fp) - 12) /
@@ -257,7 +257,7 @@ int IMB_indexer_get_frame_index(struct anim_index *idx, int frameno)
int first = 0;
/* bsearch (lower bound) the right index */
-
+
while (len > 0) {
half = len >> 1;
middle = first;
@@ -389,7 +389,7 @@ static void get_proxy_filename(struct anim *anim, IMB_Proxy_Size preview_size,
char proxy_name[256];
char stream_suffix[20];
const char *name = (temp) ? "proxy_%d%s_part.avi" : "proxy_%d%s.avi";
-
+
stream_suffix[0] = 0;
if (anim->streamindex > 0) {
@@ -418,18 +418,18 @@ static void get_tc_filename(struct anim *anim, IMB_Timecode_Type tc,
char stream_suffix[20];
char index_name[256];
-
+
stream_suffix[0] = 0;
if (anim->streamindex > 0) {
BLI_snprintf(stream_suffix, 20, "_st%d", anim->streamindex);
}
-
+
BLI_snprintf(index_name, 256, index_names[i], stream_suffix, anim->suffix);
get_index_dir(anim, index_dir, sizeof(index_dir));
-
- BLI_join_dirfile(fname, FILE_MAXFILE + FILE_MAXDIR,
+
+ BLI_join_dirfile(fname, FILE_MAXFILE + FILE_MAXDIR,
index_dir, index_name);
}
@@ -475,7 +475,7 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg(
{
struct proxy_output_ctx *rv = MEM_callocN(
sizeof(struct proxy_output_ctx), "alloc_proxy_output");
-
+
char fname[FILE_MAX];
int ffmpeg_quality;
@@ -491,7 +491,7 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg(
rv->of = avformat_alloc_context();
rv->of->oformat = av_guess_format("avi", NULL, NULL);
-
+
BLI_strncpy(rv->of->filename, fname, sizeof(rv->of->filename));
fprintf(stderr, "Starting work on proxy: %s\n", rv->of->filename);
@@ -611,7 +611,7 @@ static int add_to_proxy_output_ffmpeg(
ret = avcodec_encode_video2(ctx->c, &packet, frame, &got_output);
if (ret < 0) {
- fprintf(stderr, "Error encoding proxy frame %d for '%s'\n",
+ fprintf(stderr, "Error encoding proxy frame %d for '%s'\n",
ctx->cfra - 1, ctx->of->filename);
return 0;
}
@@ -661,9 +661,9 @@ static void free_proxy_output_ffmpeg(struct proxy_output_ctx *ctx,
avcodec_flush_buffers(ctx->c);
av_write_trailer(ctx->of);
-
+
avcodec_close(ctx->c);
-
+
if (ctx->of->oformat) {
if (!(ctx->of->oformat->flags & AVFMT_NOFILE)) {
avio_close(ctx->of->pb);
@@ -678,19 +678,19 @@ static void free_proxy_output_ffmpeg(struct proxy_output_ctx *ctx,
av_free(ctx->frame);
}
- get_proxy_filename(ctx->anim, ctx->proxy_size,
+ get_proxy_filename(ctx->anim, ctx->proxy_size,
fname_tmp, true);
if (rollback) {
unlink(fname_tmp);
}
else {
- get_proxy_filename(ctx->anim, ctx->proxy_size,
+ get_proxy_filename(ctx->anim, ctx->proxy_size,
fname, false);
unlink(fname);
BLI_rename(fname_tmp, fname);
}
-
+
MEM_freeN(ctx);
}
@@ -883,7 +883,7 @@ static void index_rebuild_ffmpeg_proc_decoded_frame(
if (tc_types[i] == IMB_TC_RECORD_RUN_NO_GAPS)
tc_frameno = context->frameno_gapless;
-
+
IMB_index_builder_proc_frame(
context->indexer[i],
curr_packet->data,
@@ -892,7 +892,7 @@ static void index_rebuild_ffmpeg_proc_decoded_frame(
s_pos, s_dts, pts);
}
}
-
+
context->frameno_gapless++;
}
@@ -1006,12 +1006,12 @@ static AviMovie *alloc_proxy_output_avi(
float frs_sec_base = 1.0;
IMB_anim_get_fps(anim, &frs_sec, &frs_sec_base, false);
-
+
x = width;
y = height;
framerate = (double) frs_sec / (double) frs_sec_base;
-
+
avi = MEM_mallocN(sizeof(AviMovie), "avimovie");
format = AVI_FORMAT_MJPEG;
@@ -1020,7 +1020,7 @@ static AviMovie *alloc_proxy_output_avi(
MEM_freeN(avi);
return NULL;
}
-
+
AVI_set_compress_option(avi, AVI_OPTION_TYPE_MAIN, 0, AVI_OPTION_WIDTH, &x);
AVI_set_compress_option(avi, AVI_OPTION_TYPE_MAIN, 0, AVI_OPTION_HEIGHT, &y);
AVI_set_compress_option(avi, AVI_OPTION_TYPE_MAIN, 0, AVI_OPTION_QUALITY, &quality);
@@ -1111,7 +1111,7 @@ static void index_rebuild_fallback(FallbackIndexBuilderContext *context,
*progress = next_progress;
*do_update = true;
}
-
+
if (*stop) {
break;
}
@@ -1128,7 +1128,7 @@ static void index_rebuild_fallback(FallbackIndexBuilderContext *context,
IMB_scalefastImBuf(s_ibuf, x, y);
IMB_convert_rgba_to_abgr(s_ibuf);
-
+
AVI_write_frame(context->proxy_ctx[i], pos,
AVI_FORMAT_RGB32,
s_ibuf->rect, x * y * 4);
@@ -1178,7 +1178,7 @@ IndexBuildContext *IMB_anim_index_rebuild_context(struct anim *anim, IMB_Timecod
}
}
}
-
+
if (!overwrite) {
IMB_Proxy_Size built_proxies = IMB_anim_proxy_get_existing(anim);
if (built_proxies != 0) {
@@ -1194,13 +1194,13 @@ IndexBuildContext *IMB_anim_index_rebuild_context(struct anim *anim, IMB_Timecod
}
proxy_sizes_to_build &= ~built_proxies;
}
-
+
fflush(stdout);
if (proxy_sizes_to_build == 0) {
return NULL;
}
-
+
switch (anim->curtype) {
#ifdef WITH_FFMPEG
@@ -1313,7 +1313,7 @@ struct anim *IMB_anim_open_proxy(
/* proxies are generated in the same color space as animation itself */
anim->proxy_anim[i] = IMB_open_anim(fname, 0, 0, anim->colorspace);
-
+
anim->proxies_tried |= preview_size;
return anim->proxy_anim[i];
@@ -1336,7 +1336,7 @@ struct anim_index *IMB_anim_open_index(
get_tc_filename(anim, tc, fname);
anim->curr_idx[i] = IMB_indexer_open(fname);
-
+
anim->indices_tried |= tc;
return anim->curr_idx[i];
diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c
index 11b1fd7b1c2..61326218d4a 100644
--- a/source/blender/imbuf/intern/iris.c
+++ b/source/blender/imbuf/intern/iris.c
@@ -141,7 +141,7 @@ static ushort getshort(MFileOffset *inf)
static uint getlong(MFileOffset *mofs)
{
const uchar *buf;
-
+
buf = MFILE_DATA(mofs);
MFILE_STEP(mofs, 4);
@@ -220,13 +220,13 @@ static void test_endian_zbuf(struct ImBuf *ibuf)
{
int len;
int *zval;
-
+
if (BIG_LONG(1) == 1) return;
if (ibuf->zbuf == NULL) return;
-
+
len = ibuf->x * ibuf->y;
zval = ibuf->zbuf;
-
+
while (len--) {
zval[0] = BIG_LONG(zval[0]);
zval++;
@@ -301,7 +301,7 @@ struct ImBuf *imb_loadiris(const uchar *mem, size_t size, int flags, char colors
if (ibuf) ibuf->ftype = IMB_FTYPE_IMAGIC;
return(ibuf);
}
-
+
if (rle) {
size_t tablen = (size_t)ysize * (size_t)zsize * sizeof(int);
MFILE_SEEK(inf, HEADER_SIZE);
@@ -316,7 +316,7 @@ struct ImBuf *imb_loadiris(const uchar *mem, size_t size, int flags, char colors
readtab(inf, starttab, tablen);
readtab(inf, lengthtab, tablen);
-
+
/* check data order */
cur = 0;
badorder = 0;
@@ -331,9 +331,9 @@ struct ImBuf *imb_loadiris(const uchar *mem, size_t size, int flags, char colors
if (badorder)
break;
}
-
+
if (bpp == 1) {
-
+
ibuf = IMB_allocImBuf(xsize, ysize, 8 * zsize, IB_rect);
if (!ibuf) {
goto fail_rle;
@@ -341,7 +341,7 @@ struct ImBuf *imb_loadiris(const uchar *mem, size_t size, int flags, char colors
if (ibuf->planes > 32) ibuf->planes = 32;
base = ibuf->rect;
zbase = (uint *)ibuf->zbuf;
-
+
if (badorder) {
for (size_t z = 0; z < zsize; z++) {
lptr = base;
@@ -382,18 +382,18 @@ struct ImBuf *imb_loadiris(const uchar *mem, size_t size, int flags, char colors
zptr = zptr_next;
}
}
-
+
}
else { /* bpp == 2 */
-
+
ibuf = IMB_allocImBuf(xsize, ysize, 32, (flags & IB_rect) | IB_rectfloat);
if (!ibuf) {
goto fail_rle;
}
fbase = ibuf->rect_float;
-
+
if (badorder) {
for (size_t z = 0; z < zsize; z++) {
fptr = fbase;
@@ -414,7 +414,7 @@ struct ImBuf *imb_loadiris(const uchar *mem, size_t size, int flags, char colors
float *fptr_next = fptr + (xsize * 4);
for (size_t y = 0; y < ysize; y++) {
-
+
for (size_t z = 0; z < zsize; z++) {
MFILE_SEEK(inf, starttab[y + z * ysize]);
rledat = MFILE_DATA(inf);
@@ -442,7 +442,7 @@ fail_rle:
if (UNLIKELY((p) > mem_end)) { dirty_flag |= DIRTY_FLAG_EOF; goto fail_uncompressed; } ((void)0)
if (bpp == 1) {
-
+
ibuf = IMB_allocImBuf(xsize, ysize, 8 * zsize, IB_rect);
if (!ibuf) {
goto fail_uncompressed;
@@ -451,12 +451,12 @@ fail_rle:
base = ibuf->rect;
zbase = (uint *)ibuf->zbuf;
-
+
MFILE_SEEK(inf, HEADER_SIZE);
rledat = MFILE_DATA(inf);
-
+
for (size_t z = 0; z < zsize; z++) {
-
+
if (z < 4) lptr = base;
else if (z < 8) lptr = zbase;
@@ -469,10 +469,10 @@ fail_rle:
lptr += xsize;
}
}
-
+
}
else { /* bpp == 2 */
-
+
ibuf = IMB_allocImBuf(xsize, ysize, 32, (flags & IB_rect) | IB_rectfloat);
if (!ibuf) {
goto fail_uncompressed;
@@ -482,9 +482,9 @@ fail_rle:
MFILE_SEEK(inf, HEADER_SIZE);
rledat = MFILE_DATA(inf);
-
+
for (size_t z = 0; z < zsize; z++) {
-
+
fptr = fbase;
for (size_t y = 0; y < ysize; y++) {
@@ -496,7 +496,7 @@ fail_rle:
fptr += xsize * 4;
}
}
-
+
}
#undef MFILE_CAPACITY_AT_PTR_OK_OR_FAIL
fail_uncompressed:
@@ -507,7 +507,7 @@ fail_uncompressed:
if (bpp == 1) {
uchar *rect;
-
+
if (image.zsize == 1) {
rect = (uchar *) ibuf->rect;
for (size_t x = (size_t)ibuf->x * (size_t)ibuf->y; x > 0; x--) {
@@ -533,10 +533,10 @@ fail_uncompressed:
rect += 4;
}
}
-
+
}
else { /* bpp == 2 */
-
+
if (image.zsize == 1) {
fbase = ibuf->rect_float;
for (size_t x = (size_t)ibuf->x * (size_t)ibuf->y; x > 0; x--) {
@@ -562,11 +562,11 @@ fail_uncompressed:
fbase += 4;
}
}
-
+
if (flags & IB_rect) {
IMB_rect_from_float(ibuf);
}
-
+
}
if (dirty_flag) {
@@ -816,10 +816,10 @@ static int output_iris(uint *lptr, int xsize, int ysize, int zsize, const char *
goodwrite *= writeheader(outf, image);
fseek(outf, HEADER_SIZE + (2 * tablen), SEEK_SET);
pos = HEADER_SIZE + (2 * tablen);
-
+
for (y = 0; y < ysize; y++) {
for (z = 0; z < zsize; z++) {
-
+
if (zsize == 1) {
lumrow((uchar *)lptr, (uchar *)lumbuf, xsize);
len = compressrow((uchar *)lumbuf, rlebuf, CHANOFFSET(z), xsize);
@@ -939,7 +939,7 @@ int imb_saveiris(struct ImBuf *ibuf, const char *name, int flags)
zsize = (ibuf->planes + 7) >> 3;
if (flags & IB_zbuf && ibuf->zbuf != NULL) zsize = 8;
-
+
IMB_convert_rgba_to_abgr(ibuf);
test_endian_zbuf(ibuf);
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index 30a0fdf4e55..753b5276222 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -126,7 +126,7 @@ struct ImBuf *imb_jp2_decode(const unsigned char *mem, size_t size, int flags, c
struct ImBuf *ibuf = NULL;
bool use_float = false; /* for precision higher then 8 use float */
bool use_alpha = false;
-
+
long signed_offsets[4] = {0, 0, 0, 0};
int float_divs[4] = {1, 1, 1, 1};
@@ -134,9 +134,9 @@ struct ImBuf *imb_jp2_decode(const unsigned char *mem, size_t size, int flags, c
unsigned int y;
int *r, *g, *b, *a; /* matching 'opj_image_comp.data' type */
bool is_jp2, is_j2k;
-
+
opj_dparameters_t parameters; /* decompression parameters */
-
+
opj_event_mgr_t event_mgr; /* event manager */
opj_image_t *image = NULL;
@@ -180,7 +180,7 @@ struct ImBuf *imb_jp2_decode(const unsigned char *mem, size_t size, int flags, c
/* decode the stream and fill the image structure */
image = opj_decode(dinfo, cio);
-
+
if (!image) {
fprintf(stderr, "ERROR -> j2k_to_image: failed to decode image!\n");
opj_destroy_decompress(dinfo);
@@ -196,10 +196,10 @@ struct ImBuf *imb_jp2_decode(const unsigned char *mem, size_t size, int flags, c
fprintf(stderr, "\nError: invalid raw image parameters\n");
return NULL;
}
-
+
w = image->comps[0].w;
h = image->comps[0].h;
-
+
switch (image->numcomps) {
case 1: /* Grayscale */
case 3: /* Color */
@@ -211,38 +211,38 @@ struct ImBuf *imb_jp2_decode(const unsigned char *mem, size_t size, int flags, c
use_alpha = true;
break;
}
-
-
+
+
i = image->numcomps;
if (i > 4) i = 4;
-
+
while (i) {
i--;
-
+
if (image->comps[i].prec > 8)
use_float = true;
-
+
if (image->comps[i].sgnd)
signed_offsets[i] = 1 << (image->comps[i].prec - 1);
-
+
/* only needed for float images but dosnt hurt to calc this */
float_divs[i] = (1 << image->comps[i].prec) - 1;
}
-
+
ibuf = IMB_allocImBuf(w, h, planes, use_float ? IB_rectfloat : IB_rect);
-
+
if (ibuf == NULL) {
if (dinfo)
opj_destroy_decompress(dinfo);
return NULL;
}
-
+
ibuf->ftype = IMB_FTYPE_JP2;
if (is_jp2)
ibuf->foptions.flag |= JP2_JP2;
else
ibuf->foptions.flag |= JP2_J2K;
-
+
if (use_float) {
float *rect_float = ibuf->rect_float;
@@ -293,7 +293,7 @@ struct ImBuf *imb_jp2_decode(const unsigned char *mem, size_t size, int flags, c
PIXEL_LOOPER_END;
}
}
-
+
}
else {
unsigned char *rect_uchar = (unsigned char *)ibuf->rect;
@@ -346,19 +346,19 @@ struct ImBuf *imb_jp2_decode(const unsigned char *mem, size_t size, int flags, c
}
}
}
-
+
/* free remaining structures */
if (dinfo) {
opj_destroy_decompress(dinfo);
}
-
+
/* free image data structure */
opj_image_destroy(image);
-
+
if (flags & IB_rect) {
IMB_rect_from_float(ibuf);
}
-
+
return(ibuf);
}
@@ -416,8 +416,8 @@ BLI_INLINE int DOWNSAMPLE_FLOAT_TO_16BIT(const float _val)
static int initialise_4K_poc(opj_poc_t *POC, int numres)
{
- POC[0].tile = 1;
- POC[0].resno0 = 0;
+ POC[0].tile = 1;
+ POC[0].resno0 = 0;
POC[0].compno0 = 0;
POC[0].layno1 = 1;
POC[0].resno1 = numres - 1;
@@ -438,7 +438,7 @@ static void cinema_parameters(opj_cparameters_t *parameters)
parameters->tile_size_on = 0; /* false */
parameters->cp_tdx = 1;
parameters->cp_tdy = 1;
-
+
/*Tile part*/
parameters->tp_flag = 'C';
parameters->tp_on = 1;
@@ -487,7 +487,7 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters, opj_image_t *ima
parameters->cp_rsiz = DCP_CINEMA2K;
}
break;
-
+
case CINEMA4K_24:
if (parameters->numresolution < 1) {
parameters->numresolution = 1;
@@ -534,7 +534,7 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters, opj_image_t *ima
}
parameters->max_comp_size = COMP_24_CS;
break;
-
+
case CINEMA2K_48:
for (i = 0; i < parameters->tcp_numlayers; i++) {
temp_rate = 0;
@@ -572,22 +572,22 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
{
unsigned char *rect_uchar;
float *rect_float, from_straight[4];
-
+
unsigned int subsampling_dx = parameters->subsampling_dx;
unsigned int subsampling_dy = parameters->subsampling_dy;
-
+
unsigned int i, i_next, numcomps, w, h, prec;
unsigned int y;
int *r, *g, *b, *a; /* matching 'opj_image_comp.data' type */
OPJ_COLOR_SPACE color_space;
opj_image_cmptparm_t cmptparm[4]; /* maximum of 4 components */
opj_image_t *image = NULL;
-
+
float (*chanel_colormanage_cb)(float);
-
+
img_fol_t img_fol; /* only needed for cinema presets */
memset(&img_fol, 0, sizeof(img_fol_t));
-
+
if (ibuf->float_colorspace || (ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA)) {
/* float buffer was managed already, no need in color space conversion */
chanel_colormanage_cb = channel_colormanage_noop;
@@ -596,9 +596,9 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
/* standard linear-to-srgb conversion if float buffer wasn't managed */
chanel_colormanage_cb = linearrgb_to_srgb;
}
-
+
if (ibuf->foptions.flag & JP2_CINE) {
-
+
if (ibuf->x == 4096 || ibuf->y == 2160)
parameters->cp_cinema = CINEMA4K_24;
else {
@@ -616,7 +616,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
}
cinema_parameters(parameters);
}
-
+
color_space = (ibuf->foptions.flag & JP2_YCC) ? CLRSPC_SYCC : CLRSPC_SRGB;
prec = 12;
numcomps = 3;
@@ -624,20 +624,20 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
else {
/* Get settings from the imbuf */
color_space = (ibuf->foptions.flag & JP2_YCC) ? CLRSPC_SYCC : CLRSPC_SRGB;
-
+
if (ibuf->foptions.flag & JP2_16BIT) prec = 16;
else if (ibuf->foptions.flag & JP2_12BIT) prec = 12;
else prec = 8;
-
+
/* 32bit images == alpha channel */
/* grayscale not supported yet */
numcomps = (ibuf->planes == 32) ? 4 : 3;
}
-
+
w = ibuf->x;
h = ibuf->y;
-
-
+
+
/* initialize image components */
memset(&cmptparm, 0, 4 * sizeof(opj_image_cmptparm_t));
for (i = 0; i < numcomps; i++) {
@@ -665,7 +665,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
/* set image data */
rect_uchar = (unsigned char *) ibuf->rect;
rect_float = ibuf->rect_float;
-
+
/* set the destination channels */
r = image->comps[0].data;
g = image->comps[1].data;
@@ -676,7 +676,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
/* No need to use the floating point buffer, just write the 8 bits from the char buffer */
rect_float = NULL;
}
-
+
if (rect_float) {
int channels_in_float = ibuf->channels ? ibuf->channels : 4;
@@ -744,7 +744,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
}
}
break;
-
+
case 12:
if (numcomps == 4) {
if (channels_in_float == 4) {
@@ -898,7 +898,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
PIXEL_LOOPER_END;
}
break;
-
+
case 12: /* Up Sampling, a bit pointless but best write the bit depth requested */
if (numcomps == 4) {
PIXEL_LOOPER_BEGIN(rect_uchar)
@@ -944,17 +944,17 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
break;
}
}
-
+
/* Decide if MCT should be used */
parameters->tcp_mct = image->numcomps == 3 ? 1 : 0;
-
+
if (parameters->cp_cinema) {
cinema_setup_encoder(parameters, image, &img_fol);
}
-
+
if (img_fol.rates)
MEM_freeN(img_fol.rates);
-
+
return image;
}
@@ -963,14 +963,14 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags)
{
int quality = ibuf->foptions.quality;
-
+
int bSuccess;
opj_cparameters_t parameters; /* compression parameters */
opj_event_mgr_t event_mgr; /* event manager */
opj_image_t *image = NULL;
-
+
(void)flags; /* unused */
-
+
/*
* configure the event callbacks (not required)
* setting of each callback is optional
@@ -979,22 +979,22 @@ int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags)
event_mgr.error_handler = error_callback;
event_mgr.warning_handler = warning_callback;
event_mgr.info_handler = info_callback;
-
+
/* set encoding parameters to default values */
opj_set_default_encoder_parameters(&parameters);
-
+
/* compression ratio */
/* invert range, from 10-100, 100-1
* where jpeg see's 1 and highest quality (lossless) and 100 is very low quality*/
parameters.tcp_rates[0] = ((100 - quality) / 90.0f * 99.0f) + 1;
-
+
parameters.tcp_numlayers = 1; /* only one resolution */
parameters.cp_disto_alloc = 1;
image = ibuftoimage(ibuf, &parameters);
-
-
+
+
{ /* JP2 format output */
int codestream_length;
opj_cio_t *cio = NULL;
@@ -1021,7 +1021,7 @@ int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags)
/* encode the image */
bSuccess = opj_encode(cinfo, cio, image, NULL); /* last arg used to be parameters.index but this deprecated */
-
+
if (!bSuccess) {
opj_cio_close(cio);
fprintf(stderr, "failed to encode image\n");
@@ -1031,7 +1031,7 @@ int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags)
/* write the buffer to disk */
f = BLI_fopen(name, "wb");
-
+
if (!f) {
fprintf(stderr, "failed to open %s for writing\n", name);
return 1;
@@ -1041,13 +1041,13 @@ int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags)
fprintf(stderr, "Generated outfile %s\n", name);
/* close and free the byte stream */
opj_cio_close(cio);
-
+
/* free remaining compression structures */
opj_destroy_compress(cinfo);
}
/* free image data */
opj_image_destroy(image);
-
+
return 1;
}
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c
index ef9217fbc8c..2febbb1f861 100644
--- a/source/blender/imbuf/intern/jpeg.c
+++ b/source/blender/imbuf/intern/jpeg.c
@@ -48,7 +48,7 @@
#include "IMB_imbuf.h"
#include "IMB_metadata.h"
#include "IMB_filetype.h"
-#include "jpeglib.h"
+#include "jpeglib.h"
#include "jerror.h"
#include "IMB_colormanagement.h"
@@ -247,12 +247,12 @@ static boolean handle_app1(j_decompress_ptr cinfo)
INT32 length; /* initialized by the macro */
INT32 i;
char neogeo[128];
-
+
INPUT_VARS(cinfo);
INPUT_2BYTES(cinfo, length, return false);
length -= 2;
-
+
if (length < 16) {
for (i = 0; i < length; i++) {
INPUT_BYTE(cinfo, neogeo[i], return false);
@@ -308,12 +308,12 @@ static ImBuf *ibJpegImageFromCinfo(struct jpeg_decompress_struct *cinfo, int fla
row_stride = cinfo->output_width * depth;
row_pointer = (*cinfo->mem->alloc_sarray)((j_common_ptr) cinfo, JPOOL_IMAGE, row_stride, 1);
-
+
for (y = ibuf->y - 1; y >= 0; y--) {
jpeg_read_scanlines(cinfo, row_pointer, 1);
rect = (uchar *) (ibuf->rect + y * ibuf->x);
buffer = row_pointer[0];
-
+
switch (depth) {
case 1:
for (x = ibuf->x; x > 0; x--) {
@@ -419,7 +419,7 @@ next_stamp_marker:
jpeg_finish_decompress(cinfo);
}
-
+
jpeg_destroy((j_common_ptr) cinfo);
if (ibuf) {
ibuf->ftype = IMB_FTYPE_JPG;
@@ -456,7 +456,7 @@ ImBuf *imb_load_jpeg(const unsigned char *buffer, size_t size, int flags, char c
memory_source(cinfo, buffer, size);
ibuf = ibJpegImageFromCinfo(cinfo, flags);
-
+
return(ibuf);
}
@@ -584,7 +584,7 @@ static int init_jpeg(FILE *outfile, struct jpeg_compress_struct *cinfo, struct I
break;
}
jpeg_set_defaults(cinfo);
-
+
/* own settings */
cinfo->dct_method = JDCT_FLOAT;
@@ -629,7 +629,7 @@ static int save_stdjpeg(const char *name, struct ImBuf *ibuf)
int imb_savejpeg(struct ImBuf *ibuf, const char *name, int flags)
{
-
+
ibuf->flags = flags;
return save_stdjpeg(name, ibuf);
}
diff --git a/source/blender/imbuf/intern/openexr/CMakeLists.txt b/source/blender/imbuf/intern/openexr/CMakeLists.txt
index d5cb8e8a3b6..d4e6e9dc670 100644
--- a/source/blender/imbuf/intern/openexr/CMakeLists.txt
+++ b/source/blender/imbuf/intern/openexr/CMakeLists.txt
@@ -23,7 +23,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-set(INC
+set(INC
.
..
../..
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index ad04f1fb78d..a52ae75e87b 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -912,7 +912,7 @@ int IMB_exr_begin_read(void *handle, const char *filename, int *width, int *heig
for (size_t i = 0; i < channels.size(); i++) {
IMB_exr_add_channel(data, NULL, channels[i].name.c_str(), channels[i].view.c_str(), 0, 0, NULL, false);
-
+
echan = (ExrChannel *)data->channels.last;
echan->m->name = channels[i].name;
echan->m->view = channels[i].view;
@@ -1274,7 +1274,7 @@ static int imb_exr_split_channel_name(ExrChannel *echan, char *layname, char *pa
const char *token;
char tokenbuf[EXR_TOT_MAXNAME];
int len;
-
+
/* some multilayers have the combined buffer with names A B G R saved */
if (name[1] == 0) {
echan->chan_id = name[0];
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.h b/source/blender/imbuf/intern/openexr/openexr_api.h
index 165cc968701..92bbeecfd5d 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.h
+++ b/source/blender/imbuf/intern/openexr/openexr_api.h
@@ -42,7 +42,7 @@ extern "C" {
void imb_initopenexr (void);
int imb_is_a_openexr (const unsigned char *mem);
-
+
int imb_save_openexr (struct ImBuf *ibuf, const char *name, int flags);
struct ImBuf *imb_load_openexr (const unsigned char *mem, size_t size, int flags, char *colorspace);
diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c
index 8ac206a97ea..71b7cb2f567 100644
--- a/source/blender/imbuf/intern/png.c
+++ b/source/blender/imbuf/intern/png.c
@@ -82,7 +82,7 @@ int imb_is_a_png(const unsigned char *mem)
return(ret_val);
}
-static void Flush(png_structp png_ptr)
+static void Flush(png_structp png_ptr)
{
(void)png_ptr;
}
@@ -415,7 +415,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
num_text++;
}
}
-
+
metadata = MEM_callocN(num_text * sizeof(png_text), "png_metadata");
num_text = 0;
for (prop = ibuf->metadata->data.group.first; prop; prop = prop->next) {
@@ -426,7 +426,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
num_text++;
}
}
-
+
png_set_text(png_ptr, info_ptr, metadata, num_text);
MEM_freeN(metadata);
@@ -544,7 +544,7 @@ ImBuf *imb_loadpng(const unsigned char *mem, size_t size, int flags, char colors
info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL) {
- png_destroy_read_struct(&png_ptr, (png_infopp)NULL,
+ png_destroy_read_struct(&png_ptr, (png_infopp)NULL,
(png_infopp)NULL);
printf("Cannot png_create_info_struct\n");
return NULL;
@@ -568,7 +568,7 @@ ImBuf *imb_loadpng(const unsigned char *mem, size_t size, int flags, char colors
// png_set_sig_bytes(png_ptr, 8);
png_read_info(png_ptr, info_ptr);
- png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth,
+ png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth,
&color_type, NULL, NULL, NULL);
channels = png_get_channels(png_ptr, info_ptr);
@@ -601,7 +601,7 @@ ImBuf *imb_loadpng(const unsigned char *mem, size_t size, int flags, char colors
printf("PNG format not supported\n");
longjmp(png_jmpbuf(png_ptr), 1);
}
-
+
ibuf = IMB_allocImBuf(width, height, 8 * channels, 0);
if (ibuf) {
diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c
index 8d822a314f5..be33c16c8ae 100644
--- a/source/blender/imbuf/intern/radiance_hdr.c
+++ b/source/blender/imbuf/intern/radiance_hdr.c
@@ -256,7 +256,7 @@ struct ImBuf *imb_loadhdr(const unsigned char *mem, size_t size, int flags, char
/* read in and decode the actual data */
sline = (RGBE *)MEM_mallocN(sizeof(*sline) * width, __func__);
rect_float = ibuf->rect_float;
-
+
for (size_t y = 0; y < height; y++) {
ptr = freadcolrs(sline, ptr, width, mem_eof);
if (ptr == NULL) {
@@ -274,11 +274,11 @@ struct ImBuf *imb_loadhdr(const unsigned char *mem, size_t size, int flags, char
}
MEM_freeN(sline);
if (oriY[0] == '-') IMB_flipy(ibuf);
-
+
if (flags & IB_rect) {
IMB_rect_from_float(ibuf);
}
-
+
return ibuf;
}
//else printf("Data not found!\n");
@@ -385,9 +385,9 @@ int imb_savehdr(struct ImBuf *ibuf, const char *name, int flags)
float *fp = NULL;
size_t width = ibuf->x, height = ibuf->y;
unsigned char *cp = NULL;
-
+
(void)flags; /* unused */
-
+
if (file == NULL) {
return 0;
}
@@ -398,7 +398,7 @@ int imb_savehdr(struct ImBuf *ibuf, const char *name, int flags)
cp = (unsigned char *)ibuf->rect + ibuf->channels * (height - 1) * width;
if (ibuf->rect_float)
fp = ibuf->rect_float + ibuf->channels * (height - 1) * width;
-
+
for (size_t y = 0; y < height; y++) {
if (fwritecolrs(file, width, ibuf->channels, cp, fp) < 0) {
fclose(file);
diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c
index 2fe17ee56c6..a762e3780dc 100644
--- a/source/blender/imbuf/intern/rectop.c
+++ b/source/blender/imbuf/intern/rectop.c
@@ -167,13 +167,13 @@ void IMB_blend_color_float(float dst[4], float src1[4], float src2[4], IMB_Blend
/* clipping */
-void IMB_rectclip(ImBuf *dbuf, ImBuf *sbuf, int *destx,
+void IMB_rectclip(ImBuf *dbuf, ImBuf *sbuf, int *destx,
int *desty, int *srcx, int *srcy, int *width, int *height)
{
int tmp;
if (dbuf == NULL) return;
-
+
if (*destx < 0) {
*srcx -= *destx;
*width += *destx;
@@ -213,14 +213,14 @@ void IMB_rectclip(ImBuf *dbuf, ImBuf *sbuf, int *destx,
}
}
-static void imb_rectclip3(ImBuf *dbuf, ImBuf *obuf, ImBuf *sbuf, int *destx,
+static void imb_rectclip3(ImBuf *dbuf, ImBuf *obuf, ImBuf *sbuf, int *destx,
int *desty, int *origx, int *origy, int *srcx, int *srcy,
int *width, int *height)
{
int tmp;
if (dbuf == NULL) return;
-
+
if (*destx < 0) {
*srcx -= *destx;
*origx -= *destx;
@@ -286,7 +286,7 @@ static void imb_rectclip3(ImBuf *dbuf, ImBuf *obuf, ImBuf *sbuf, int *destx,
/* copy and blend */
-void IMB_rectcpy(ImBuf *dbuf, ImBuf *sbuf, int destx,
+void IMB_rectcpy(ImBuf *dbuf, ImBuf *sbuf, int destx,
int desty, int srcx, int srcy, int width, int height)
{
IMB_rectblend(dbuf, dbuf, sbuf, NULL, NULL, NULL, 0, destx, desty, destx, desty, srcx, srcy, width, height, IMB_BLEND_COPY, false);
@@ -786,20 +786,20 @@ void IMB_rectfill(ImBuf *drect, const float col[4])
if (drect->rect) {
unsigned int *rrect = drect->rect;
char ccol[4];
-
+
ccol[0] = (int)(col[0] * 255);
ccol[1] = (int)(col[1] * 255);
ccol[2] = (int)(col[2] * 255);
ccol[3] = (int)(col[3] * 255);
-
+
num = drect->x * drect->y;
for (; num > 0; num--)
*rrect++ = *((unsigned int *)ccol);
}
-
+
if (drect->rect_float) {
float *rrectf = drect->rect_float;
-
+
num = drect->x * drect->y;
for (; num > 0; num--) {
*rrectf++ = col[0];
@@ -821,7 +821,7 @@ void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height,
float aich; /* alpha, inverted, ai/255.0 - Convert char to float at the same time */
if ((!rect && !rectf) || (!col) || col[3] == 0.0f)
return;
-
+
/* sanity checks for coords */
CLAMP(x1, 0, width);
CLAMP(x2, 0, width);
@@ -831,18 +831,18 @@ void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height,
if (x1 > x2) SWAP(int, x1, x2);
if (y1 > y2) SWAP(int, y1, y2);
if (x1 == x2 || y1 == y2) return;
-
+
a = col[3];
ai = 1 - a;
aich = ai / 255.0f;
if (rect) {
- unsigned char *pixel;
+ unsigned char *pixel;
unsigned char chr = 0, chg = 0, chb = 0;
float fr = 0, fg = 0, fb = 0;
const int alphaint = unit_float_to_uchar_clamp(a);
-
+
if (a == 1.0f) {
chr = unit_float_to_uchar_clamp(col[0]);
chg = unit_float_to_uchar_clamp(col[1]);
@@ -874,7 +874,7 @@ void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height,
}
}
}
-
+
if (rectf) {
float col_conv[4];
float *pixel;
diff --git a/source/blender/imbuf/intern/rotate.c b/source/blender/imbuf/intern/rotate.c
index 886944f6190..f00745f0052 100644
--- a/source/blender/imbuf/intern/rotate.c
+++ b/source/blender/imbuf/intern/rotate.c
@@ -54,7 +54,7 @@ void IMB_flipy(struct ImBuf *ibuf)
top = ibuf->rect;
bottom = top + ((y - 1) * x);
line = MEM_mallocN(x * sizeof(int), "linebuf");
-
+
y >>= 1;
for (; y > 0; y--) {
@@ -96,7 +96,7 @@ void IMB_flipx(struct ImBuf *ibuf)
{
int x, y, xr, xl, yi;
float px_f[4];
-
+
if (ibuf == NULL) return;
x = ibuf->x;
@@ -109,7 +109,7 @@ void IMB_flipx(struct ImBuf *ibuf)
}
}
}
-
+
if (ibuf->rect_float) {
for (yi = y - 1; yi >= 0; yi--) {
for (xr = x - 1, xl = 0; xr >= xl; xr--, xl++) {
diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c
index 4b528160fb7..43c5a9d3597 100644
--- a/source/blender/imbuf/intern/scaling.c
+++ b/source/blender/imbuf/intern/scaling.c
@@ -60,7 +60,7 @@ static void imb_half_x_no_alloc(struct ImBuf *ibuf2, struct ImBuf *ibuf1)
do_rect = (ibuf1->rect != NULL);
do_float = (ibuf1->rect_float != NULL && ibuf2->rect_float != NULL);
-
+
_p1 = (uchar *) ibuf1->rect;
dest = (uchar *) ibuf2->rect;
@@ -113,12 +113,12 @@ struct ImBuf *IMB_half_x(struct ImBuf *ibuf1)
if (ibuf1->rect == NULL && ibuf1->rect_float == NULL) return (NULL);
if (ibuf1->x <= 1) return(IMB_dupImBuf(ibuf1));
-
+
ibuf2 = IMB_allocImBuf((ibuf1->x) / 2, ibuf1->y, ibuf1->planes, ibuf1->flags);
if (ibuf2 == NULL) return (NULL);
imb_half_x_no_alloc(ibuf2, ibuf1);
-
+
return (ibuf2);
}
@@ -133,7 +133,7 @@ struct ImBuf *IMB_double_fast_x(struct ImBuf *ibuf1)
do_rect = (ibuf1->rect != NULL);
do_float = (ibuf1->rect_float != NULL);
-
+
ibuf2 = IMB_allocImBuf(2 * ibuf1->x, ibuf1->y, ibuf1->planes, ibuf1->flags);
if (ibuf2 == NULL) return (NULL);
@@ -245,14 +245,14 @@ struct ImBuf *IMB_half_y(struct ImBuf *ibuf1)
if (ibuf1 == NULL) return (NULL);
if (ibuf1->rect == NULL && ibuf1->rect_float == NULL) return (NULL);
-
+
if (ibuf1->y <= 1) return(IMB_dupImBuf(ibuf1));
ibuf2 = IMB_allocImBuf(ibuf1->x, (ibuf1->y) / 2, ibuf1->planes, ibuf1->flags);
if (ibuf2 == NULL) return (NULL);
imb_half_y_no_alloc(ibuf2, ibuf1);
-
+
return (ibuf2);
}
@@ -303,7 +303,7 @@ struct ImBuf *IMB_double_y(struct ImBuf *ibuf1)
if (ibuf1->rect == NULL) return (NULL);
ibuf2 = IMB_double_fast_y(ibuf1);
-
+
IMB_filtery(ibuf2);
return (ibuf2);
}
@@ -358,30 +358,30 @@ void imb_onehalf_no_alloc(struct ImBuf *ibuf2, struct ImBuf *ibuf1)
imb_half_x_no_alloc(ibuf2, ibuf1);
return;
}
-
+
if (do_rect) {
unsigned char *cp1, *cp2, *dest;
-
+
cp1 = (unsigned char *) ibuf1->rect;
dest = (unsigned char *) ibuf2->rect;
-
+
for (y = ibuf2->y; y > 0; y--) {
cp2 = cp1 + (ibuf1->x << 2);
for (x = ibuf2->x; x > 0; x--) {
unsigned short p1i[8], p2i[8], desti[4];
-
+
straight_uchar_to_premul_ushort(p1i, cp1);
straight_uchar_to_premul_ushort(p2i, cp2);
straight_uchar_to_premul_ushort(p1i + 4, cp1 + 4);
straight_uchar_to_premul_ushort(p2i + 4, cp2 + 4);
-
+
desti[0] = ((unsigned int) p1i[0] + p2i[0] + p1i[4] + p2i[4]) >> 2;
desti[1] = ((unsigned int) p1i[1] + p2i[1] + p1i[5] + p2i[5]) >> 2;
desti[2] = ((unsigned int) p1i[2] + p2i[2] + p1i[6] + p2i[6]) >> 2;
desti[3] = ((unsigned int) p1i[3] + p2i[3] + p1i[7] + p2i[7]) >> 2;
-
+
premul_ushort_to_straight_uchar(dest, desti);
-
+
cp1 += 8;
cp2 += 8;
dest += 4;
@@ -390,10 +390,10 @@ void imb_onehalf_no_alloc(struct ImBuf *ibuf2, struct ImBuf *ibuf1)
if (ibuf1->x & 1) cp1 += 4;
}
}
-
+
if (do_float) {
float *p1f, *p2f, *destf;
-
+
p1f = ibuf1->rect_float;
destf = ibuf2->rect_float;
for (y = ibuf2->y; y > 0; y--) {
@@ -419,15 +419,15 @@ ImBuf *IMB_onehalf(struct ImBuf *ibuf1)
if (ibuf1 == NULL) return (NULL);
if (ibuf1->rect == NULL && ibuf1->rect_float == NULL) return (NULL);
-
+
if (ibuf1->x <= 1) return(IMB_half_y(ibuf1));
if (ibuf1->y <= 1) return(IMB_half_x(ibuf1));
-
+
ibuf2 = IMB_allocImBuf((ibuf1->x) / 2, (ibuf1->y) / 2, ibuf1->planes, ibuf1->flags);
if (ibuf2 == NULL) return (NULL);
-
+
imb_onehalf_no_alloc(ibuf2, ibuf1);
-
+
return (ibuf2);
}
@@ -582,7 +582,7 @@ static void shrink_picture_byte(
struct scale_outpix_byte *temp;
y_counter += 65536;
-
+
for (x = 0; x < dst_width; x++) {
uintptr_t f = 0x80000000UL / dst_line1[x].weight;
*dst++ = (val = (dst_line1[x].r * f) >> 15) > 255 ? 255 : val;
@@ -782,7 +782,7 @@ static void shrink_picture_float(
struct scale_outpix_float *temp;
y_counter += 1.0f;
-
+
for (x = 0; x < dst_width; x++) {
float f = 1.0f / dst_line1[x].weight;
*dst++ = dst_line1[x].r * f;
@@ -921,7 +921,7 @@ static ImBuf *scaledownx(struct ImBuf *ibuf, int newx)
rectf = ibuf->rect_float;
newrectf = _newrectf;
}
-
+
for (y = ibuf->y; y > 0; y--) {
sample = 0.0f;
val[0] = val[1] = val[2] = val[3] = 0.0f;
@@ -940,12 +940,12 @@ static ImBuf *scaledownx(struct ImBuf *ibuf, int newx)
nvalf[2] = -valf[2] * sample;
nvalf[3] = -valf[3] * sample;
}
-
+
sample += add;
while (sample >= 1.0f) {
sample -= 1.0f;
-
+
if (do_rect) {
nval[0] += rect[0];
nval[1] += rect[1];
@@ -961,31 +961,31 @@ static ImBuf *scaledownx(struct ImBuf *ibuf, int newx)
rectf += 4;
}
}
-
+
if (do_rect) {
val[0] = rect[0]; val[1] = rect[1]; val[2] = rect[2]; val[3] = rect[3];
rect += 4;
-
+
newrect[0] = ((nval[0] + sample * val[0]) / add + 0.5f);
newrect[1] = ((nval[1] + sample * val[1]) / add + 0.5f);
newrect[2] = ((nval[2] + sample * val[2]) / add + 0.5f);
newrect[3] = ((nval[3] + sample * val[3]) / add + 0.5f);
-
+
newrect += 4;
}
if (do_float) {
-
+
valf[0] = rectf[0]; valf[1] = rectf[1]; valf[2] = rectf[2]; valf[3] = rectf[3];
rectf += 4;
-
+
newrectf[0] = ((nvalf[0] + sample * valf[0]) / add);
newrectf[1] = ((nvalf[1] + sample * valf[1]) / add);
newrectf[2] = ((nvalf[2] + sample * valf[2]) / add);
newrectf[3] = ((nvalf[3] + sample * valf[3]) / add);
-
+
newrectf += 4;
}
-
+
sample -= 1.0f;
}
}
@@ -1005,7 +1005,7 @@ static ImBuf *scaledownx(struct ImBuf *ibuf, int newx)
ibuf->rect_float = _newrectf;
}
(void)rect_size; /* UNUSED in release builds */
-
+
ibuf->x = newx;
return(ibuf);
}
@@ -1053,7 +1053,7 @@ static ImBuf *scaledowny(struct ImBuf *ibuf, int newy)
rectf = ibuf->rect_float + x;
newrectf = _newrectf + x;
}
-
+
sample = 0.0f;
val[0] = val[1] = val[2] = val[3] = 0.0f;
valf[0] = valf[1] = valf[2] = valf[3] = 0.0f;
@@ -1071,12 +1071,12 @@ static ImBuf *scaledowny(struct ImBuf *ibuf, int newy)
nvalf[2] = -valf[2] * sample;
nvalf[3] = -valf[3] * sample;
}
-
+
sample += add;
while (sample >= 1.0f) {
sample -= 1.0f;
-
+
if (do_rect) {
nval[0] += rect[0];
nval[1] += rect[1];
@@ -1096,27 +1096,27 @@ static ImBuf *scaledowny(struct ImBuf *ibuf, int newy)
if (do_rect) {
val[0] = rect[0]; val[1] = rect[1]; val[2] = rect[2]; val[3] = rect[3];
rect += skipx;
-
+
newrect[0] = ((nval[0] + sample * val[0]) / add + 0.5f);
newrect[1] = ((nval[1] + sample * val[1]) / add + 0.5f);
newrect[2] = ((nval[2] + sample * val[2]) / add + 0.5f);
newrect[3] = ((nval[3] + sample * val[3]) / add + 0.5f);
-
+
newrect += skipx;
}
if (do_float) {
-
+
valf[0] = rectf[0]; valf[1] = rectf[1]; valf[2] = rectf[2]; valf[3] = rectf[3];
rectf += skipx;
-
+
newrectf[0] = ((nvalf[0] + sample * valf[0]) / add);
newrectf[1] = ((nvalf[1] + sample * valf[1]) / add);
newrectf[2] = ((nvalf[2] + sample * valf[2]) / add);
newrectf[3] = ((nvalf[3] + sample * valf[3]) / add);
-
+
newrectf += skipx;
}
-
+
sample -= 1.0f;
}
}
@@ -1136,7 +1136,7 @@ static ImBuf *scaledowny(struct ImBuf *ibuf, int newy)
ibuf->rect_float = (float *) _newrectf;
}
(void)rect_size; /* UNUSED in release builds */
-
+
ibuf->y = newy;
return(ibuf);
}
@@ -1189,7 +1189,7 @@ static ImBuf *scaleupx(struct ImBuf *ibuf, int newx)
for (y = ibuf->y; y > 0; y--) {
sample = 0;
-
+
if (do_rect) {
val_a = rect[0];
nval_a = rect[4];
@@ -1217,7 +1217,7 @@ static ImBuf *scaleupx(struct ImBuf *ibuf, int newx)
val_af = rectf[0];
nval_af = rectf[4];
diff_af = nval_af - val_af;
-
+
val_bf = rectf[1];
nval_bf = rectf[5];
diff_bf = nval_bf - val_bf;
@@ -1262,7 +1262,7 @@ static ImBuf *scaleupx(struct ImBuf *ibuf, int newx)
val_af = nval_af;
nval_af = rectf[0];
diff_af = nval_af - val_af;
-
+
val_bf = nval_bf;
nval_bf = rectf[1];
diff_bf = nval_bf - val_bf;
@@ -1305,7 +1305,7 @@ static ImBuf *scaleupx(struct ImBuf *ibuf, int newx)
ibuf->mall |= IB_rectfloat;
ibuf->rect_float = (float *) _newrectf;
}
-
+
ibuf->x = newx;
return(ibuf);
}
@@ -1391,7 +1391,7 @@ static ImBuf *scaleupy(struct ImBuf *ibuf, int newy)
val_af = rectf[0];
nval_af = rectf[skipx];
diff_af = nval_af - val_af;
-
+
val_bf = rectf[1];
nval_bf = rectf[skipx + 1];
diff_bf = nval_bf - val_bf;
@@ -1406,7 +1406,7 @@ static ImBuf *scaleupy(struct ImBuf *ibuf, int newy)
rectf += 2 * skipx;
}
-
+
for (y = newy; y > 0; y--) {
if (sample >= 1.0f) {
sample -= 1.0f;
@@ -1437,7 +1437,7 @@ static ImBuf *scaleupy(struct ImBuf *ibuf, int newy)
val_af = nval_af;
nval_af = rectf[0];
diff_af = nval_af - val_af;
-
+
val_bf = nval_bf;
nval_bf = rectf[1];
diff_bf = nval_bf - val_bf;
@@ -1480,7 +1480,7 @@ static ImBuf *scaleupy(struct ImBuf *ibuf, int newy)
ibuf->mall |= IB_rectfloat;
ibuf->rect_float = (float *) _newrectf;
}
-
+
ibuf->y = newy;
return(ibuf);
}
@@ -1557,7 +1557,7 @@ bool IMB_scaleImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy)
{
if (ibuf == NULL) return false;
if (ibuf->rect == NULL && ibuf->rect_float == NULL) return false;
-
+
if (newx == ibuf->x && newy == ibuf->y) {
return false;
}
@@ -1576,7 +1576,7 @@ bool IMB_scaleImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy)
if (newy && (newy < ibuf->y)) scaledowny(ibuf, newy);
if (newx && (newx > ibuf->x)) scaleupx(ibuf, newx);
if (newy && (newy > ibuf->y)) scaleupy(ibuf, newy);
-
+
return true;
}
@@ -1602,15 +1602,15 @@ bool IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy
if (ibuf->rect) do_rect = true;
if (ibuf->rect_float) do_float = true;
if (do_rect == false && do_float == false) return false;
-
+
if (newx == ibuf->x && newy == ibuf->y) return false;
-
+
if (do_rect) {
_newrect = MEM_mallocN(newx * newy * sizeof(int), "scalefastimbuf");
if (_newrect == NULL) return false;
newrect = _newrect;
}
-
+
if (do_float) {
_newrectf = MEM_mallocN(newx * newy * sizeof(float) * 4, "scalefastimbuf f");
if (_newrectf == NULL) {
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;
}
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index d6179136d1f..ed7bbae6935 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -223,7 +223,7 @@ static bool uri_from_filename(const char *path, char *uri)
{
char orig_uri[URI_MAX];
const char *dirstart = path;
-
+
#ifdef WIN32
{
char vol[3];
diff --git a/source/blender/imbuf/intern/thumbs_blend.c b/source/blender/imbuf/intern/thumbs_blend.c
index a589c285ef2..a2363f96bfa 100644
--- a/source/blender/imbuf/intern/thumbs_blend.c
+++ b/source/blender/imbuf/intern/thumbs_blend.c
@@ -144,7 +144,7 @@ void IMB_thumb_overlay_blend(unsigned int *thumb, int width, int height, float a
{
int x, y;
int stride_x = (margin_r - margin_l) - 2;
-
+
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++, px += 4) {
int hline = 0, vline = 0;
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index 914fcc4e847..0d650daa1c9 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -47,7 +47,7 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
-
+
#include "BKE_global.h"
#include "IMB_imbuf_types.h"
@@ -137,10 +137,10 @@ static tsize_t imb_tiff_ReadProc(thandle_t handle, tdata_t data, tsize_t n)
nRemaining = 0;
else
nRemaining = mfile->size - mfile->offset;
-
+
if (nCopy > nRemaining)
nCopy = nRemaining;
-
+
/* on EOF, return immediately and read (copy) nothing */
if (nCopy <= 0)
return (0);
@@ -165,7 +165,7 @@ static tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n)
(void)handle;
(void)data;
(void)n;
-
+
printf("imb_tiff_WriteProc: this function should not be called.\n");
return (-1);
}
@@ -208,7 +208,7 @@ static toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence)
break;
default:
/* no other types are supported - return an error */
- fprintf(stderr,
+ fprintf(stderr,
"imb_tiff_SeekProc: "
"Unsupported TIFF SEEK type.\n");
return (-1);
@@ -243,12 +243,12 @@ static int imb_tiff_CloseProc(thandle_t handle)
fprintf(stderr, "imb_tiff_CloseProc: !mfile || !mfile->mem!\n");
return (0);
}
-
+
/* virtually close the file */
mfile->mem = NULL;
mfile->offset = 0;
mfile->size = 0;
-
+
return (0);
}
@@ -281,7 +281,7 @@ static TIFF *imb_tiff_client_open(ImbTIFFMemFile *memFile, const unsigned char *
memFile->offset = 0;
memFile->size = size;
- return TIFFClientOpen("(Blender TIFF Interface Layer)",
+ return TIFFClientOpen("(Blender TIFF Interface Layer)",
"r", (thandle_t)(memFile),
imb_tiff_ReadProc, imb_tiff_WriteProc,
imb_tiff_SeekProc, imb_tiff_CloseProc,
@@ -369,7 +369,7 @@ static void imb_read_tiff_resolution(ImBuf *ibuf, TIFF *image)
}
}
-/*
+/*
* Use the libTIFF scanline API to read a TIFF image.
* This method is most flexible and can handle multiple different bit depths
* and RGB channel orderings.
@@ -408,7 +408,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image)
imb_read_tiff_resolution(ibuf, image);
scanline = TIFFScanlineSize(image);
-
+
if (bitspersample == 32) {
ib_flag = IB_rectfloat;
fbuf = (float *)_TIFFmalloc(scanline);
@@ -426,12 +426,12 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image)
else {
ib_flag = IB_rect;
}
-
+
tmpibuf = IMB_allocImBuf(ibuf->x, ibuf->y, ibuf->planes, ib_flag);
if (!tmpibuf) {
goto cleanup;
}
-
+
/* simple RGBA image */
if (!(bitspersample == 32 || bitspersample == 16)) {
success |= TIFFReadRGBAImage(image, ibuf->x, ibuf->y, tmpibuf->rect, 0);
@@ -440,11 +440,11 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image)
else if (config == PLANARCONFIG_CONTIG) {
for (row = 0; row < ibuf->y; row++) {
size_t ib_offset = (size_t)ibuf->x * 4 * ((size_t)ibuf->y - ((size_t)row + 1));
-
+
if (bitspersample == 32) {
success |= TIFFReadScanline(image, fbuf, row, 0);
scanline_contig_32bit(tmpibuf->rect_float + ib_offset, fbuf, ibuf->x, spp);
-
+
}
else if (bitspersample == 16) {
success |= TIFFReadScanline(image, sbuf, row, 0);
@@ -454,13 +454,13 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image)
/* separate channels: RRRGGGBBB */
}
else if (config == PLANARCONFIG_SEPARATE) {
-
+
/* imbufs always have 4 channels of data, so we iterate over all of them
* but only fill in from the TIFF scanline where necessary. */
for (chan = 0; chan < 4; chan++) {
for (row = 0; row < ibuf->y; row++) {
size_t ib_offset = (size_t)ibuf->x * 4 * ((size_t)ibuf->y - ((size_t)row + 1));
-
+
if (bitspersample == 32) {
if (chan == 3 && spp == 3) /* fill alpha if only RGB TIFF */
copy_vn_fl(fbuf, ibuf->x, 1.0f);
@@ -469,7 +469,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image)
else
success |= TIFFReadScanline(image, fbuf, row, chan);
scanline_separate_32bit(tmpibuf->rect_float + ib_offset, fbuf, ibuf->x, chan);
-
+
}
else if (bitspersample == 16) {
if (chan == 3 && spp == 3) /* fill alpha if only RGB TIFF */
@@ -479,7 +479,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image)
else
success |= TIFFReadScanline(image, sbuf, row, chan);
scanline_separate_16bit(tmpibuf->rect_float + ib_offset, sbuf, ibuf->x, chan);
-
+
}
}
}
@@ -490,7 +490,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image)
if (bitspersample < 16)
if (ENDIAN_ORDER == B_ENDIAN)
IMB_convert_rgba_to_abgr(tmpibuf);
-
+
/* assign rect last */
if (tmpibuf->rect_float)
ibuf->rect_float = tmpibuf->rect_float;
@@ -498,7 +498,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image)
ibuf->rect = tmpibuf->rect;
ibuf->mall |= ib_flag;
ibuf->flags |= ib_flag;
-
+
tmpibuf->mall &= ~ib_flag;
}
@@ -509,7 +509,7 @@ cleanup:
_TIFFfree(sbuf);
IMB_freeImBuf(tmpibuf);
-
+
return success;
}
@@ -564,15 +564,15 @@ ImBuf *imb_loadtiff(const unsigned char *mem, size_t size, int flags, char color
TIFFGetField(image, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(image, TIFFTAG_IMAGELENGTH, &height);
TIFFGetField(image, TIFFTAG_SAMPLESPERPIXEL, &spp);
-
+
ib_depth = (spp == 3) ? 24 : 32;
-
+
ibuf = IMB_allocImBuf(width, height, ib_depth, 0);
if (ibuf) {
ibuf->ftype = IMB_FTYPE_TIF;
}
else {
- fprintf(stderr,
+ fprintf(stderr,
"imb_loadtiff: could not allocate memory for TIFF "
"image.\n");
TIFFClose(image);
@@ -808,7 +808,7 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
/* RGBA images */
TIFFSetField(image, TIFFTAG_EXTRASAMPLES, 1,
extraSampleTypes);
- TIFFSetField(image, TIFFTAG_PHOTOMETRIC,
+ TIFFSetField(image, TIFFTAG_PHOTOMETRIC,
PHOTOMETRIC_RGB);
}
else if (samplesperpixel == 3) {
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index db57023500d..6a095b2da1f 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -166,7 +166,7 @@ int IMB_ispic_type(const char *name)
BLI_assert(!BLI_path_is_rel(name));
if (UTIL_DEBUG) printf("%s: loading %s\n", __func__, name);
-
+
if (BLI_stat(name, &st) == -1)
return false;
if (((st.st_mode) & S_IFMT) != S_IFREG)
@@ -378,13 +378,13 @@ int imb_get_anim_type(const char *name)
return ANIM_NONE;
}
-
+
bool IMB_isanim(const char *filename)
{
int type;
type = imb_get_anim_type(filename);
-
+
return (type && type != ANIM_SEQUENCE);
}
diff --git a/source/blender/imbuf/readme.txt b/source/blender/imbuf/readme.txt
index d50cb8c781d..855f6229420 100644
--- a/source/blender/imbuf/readme.txt
+++ b/source/blender/imbuf/readme.txt
@@ -15,11 +15,11 @@ short imb_saveopenexr(struct ImBuf *ibuf, char *myfile, int flags);
/* Used to test if its the correct format
int IMB_is_openexr(void *buf);
-Step 2:
+Step 2:
Add your hooks to read and write the image format these go in
writeimage.c and readimage.c just look at how the others are done
-Step 3:
+Step 3:
Add in IS_openexr to blender/source/blender/imbuf/IMB_imbuf_types.h
Add in R_openexr to source/blender/makesdna/DNA_scene_types.h
@@ -36,11 +36,11 @@ blender/source/blender/src/filesel.c
blender/source/blender/src/screendump.c
and add your extension so that your format gets recognized in the thumbnails.
-Step 6:
+Step 6:
Alter the build process:
For cmake you need to edit blender/source/blender/imbuf/CMakeLists.txt
and add in your additional files to source_files.
-If you have any external library info you will also need to add that
+If you have any external library info you will also need to add that
to the various build processes.
Step 7: