diff options
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/IMB_imbuf.h | 2 | ||||
-rw-r--r-- | source/blender/imbuf/IMB_thumbs.h | 17 | ||||
-rw-r--r-- | source/blender/imbuf/intern/dds/ColorBlock.cpp | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/dds/Stream.h | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/jp2.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/thumbs_font.c | 34 | ||||
-rw-r--r-- | source/blender/imbuf/readme.txt | 2 |
7 files changed, 43 insertions, 20 deletions
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index fbaa9b06d3b..791e939db7f 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -324,7 +324,7 @@ struct IndexBuildContext *IMB_anim_index_rebuild_context(struct anim *anim, IMB_Timecode_Type tcs_in_use, IMB_Proxy_Size proxy_sizes_in_use, int quality, - const bool overwite, + const bool overwrite, struct GSet *file_list); /* will rebuild all used indices and proxies at once */ diff --git a/source/blender/imbuf/IMB_thumbs.h b/source/blender/imbuf/IMB_thumbs.h index bac408e869b..5c7a60bbdcf 100644 --- a/source/blender/imbuf/IMB_thumbs.h +++ b/source/blender/imbuf/IMB_thumbs.h @@ -59,27 +59,34 @@ typedef enum ThumbSource { #define THUMB_DEFAULT_HASH "00000000000000000000000000000000" /* create thumbnail for file and returns new imbuf for thumbnail */ -ImBuf *IMB_thumb_create(const char *path, ThumbSize size, ThumbSource source, ImBuf *ibuf); +struct ImBuf *IMB_thumb_create(const char *path, + ThumbSize size, + ThumbSource source, + struct ImBuf *ibuf); /* read thumbnail for file and returns new imbuf for thumbnail */ -ImBuf *IMB_thumb_read(const char *path, ThumbSize size); +struct ImBuf *IMB_thumb_read(const char *path, ThumbSize size); /* delete all thumbs for the file */ void IMB_thumb_delete(const char *path, ThumbSize size); /* return the state of the thumb, needed to determine how to manage the thumb */ -ImBuf *IMB_thumb_manage(const char *path, ThumbSize size, ThumbSource source); +struct ImBuf *IMB_thumb_manage(const char *path, ThumbSize size, ThumbSource source); /* create the necessary dirs to store the thumbnails */ void IMB_thumb_makedirs(void); /* special function for loading a thumbnail embedded into a blend file */ -ImBuf *IMB_thumb_load_blend(const char *blen_path, const char *blen_group, const char *blen_id); +struct ImBuf *IMB_thumb_load_blend(const char *blen_path, + const char *blen_group, + const char *blen_id); void IMB_thumb_overlay_blend(unsigned int *thumb, int width, int height, float aspect); /* special function for previewing fonts */ -ImBuf *IMB_thumb_load_font(const char *filename, unsigned int x, unsigned int y); +struct ImBuf *IMB_thumb_load_font(const char *filename, unsigned int x, unsigned int y); bool IMB_thumb_load_font_get_hash(char *r_hash); +void IMB_thumb_clear_translations(void); +void IMB_thumb_ensure_translations(void); /* Threading */ void IMB_thumb_locks_acquire(void); diff --git a/source/blender/imbuf/intern/dds/ColorBlock.cpp b/source/blender/imbuf/intern/dds/ColorBlock.cpp index 1ca584e9b0e..cbc85962a36 100644 --- a/source/blender/imbuf/intern/dds/ColorBlock.cpp +++ b/source/blender/imbuf/intern/dds/ColorBlock.cpp @@ -84,7 +84,7 @@ void ColorBlock::init(uint w, uint h, const uint *data, uint x, uint y) const uint bh = MIN(h - y, 4U); // Blocks that are smaller than 4x4 are handled by repeating the pixels. - // @@ Thats only correct when block size is 1, 2 or 4, but not with 3. :( + // @@ That's only correct when block size is 1, 2 or 4, but not with 3. :( // @@ Ideally we should zero the weights of the pixels out of range. for (uint i = 0; i < 4; i++) { @@ -105,7 +105,7 @@ void ColorBlock::init(uint w, uint h, const float *data, uint x, uint y) const uint bh = MIN(h - y, 4U); // Blocks that are smaller than 4x4 are handled by repeating the pixels. - // @@ Thats only correct when block size is 1, 2 or 4, but not with 3. :( + // @@ That's only correct when block size is 1, 2 or 4, but not with 3. :( // @@ Ideally we should zero the weights of the pixels out of range. uint srcPlane = w * h; diff --git a/source/blender/imbuf/intern/dds/Stream.h b/source/blender/imbuf/intern/dds/Stream.h index 35662e8f24e..43cd6b56fb9 100644 --- a/source/blender/imbuf/intern/dds/Stream.h +++ b/source/blender/imbuf/intern/dds/Stream.h @@ -27,7 +27,7 @@ struct Stream { unsigned char *mem; // location in memory unsigned int size; // size unsigned int pos; // current position - bool failed; // error occured when seeking + bool failed; // error occurred when seeking Stream(unsigned char *m, unsigned int s) : mem(m), size(s), pos(0), failed(false) { } diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index 49437e77d8e..3bf97cb851f 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -450,7 +450,7 @@ static ImBuf *imb_load_jp2_stream(opj_stream_t *stream, signed_offsets[i] = 1 << (image->comps[i].prec - 1); } - /* only needed for float images but dosnt hurt to calc this */ + /* only needed for float images but doesn't hurt to calc this */ float_divs[i] = (1 << image->comps[i].prec) - 1; } diff --git a/source/blender/imbuf/intern/thumbs_font.c b/source/blender/imbuf/intern/thumbs_font.c index 1213927d329..ddb1eb62006 100644 --- a/source/blender/imbuf/intern/thumbs_font.c +++ b/source/blender/imbuf/intern/thumbs_font.c @@ -32,14 +32,28 @@ #include "../../blenfont/BLF_api.h" #include "../../blentranslation/BLT_translation.h" -static const char *thumb_str[] = { - N_("AaBbCc"), +#define THUMB_TXT_ITEMS \ + N_("AaBbCc"), N_("The quick"), N_("brown fox"), N_("jumps over"), N_("the lazy dog"), - N_("The quick"), - N_("brown fox"), - N_("jumps over"), - N_("the lazy dog"), -}; +static const char *thumb_str[] = {THUMB_TXT_ITEMS}; + +static const char *i18n_thumb_str[] = {THUMB_TXT_ITEMS}; + +#undef THUMB_TXT_ITEMS + +void IMB_thumb_clear_translations(void) +{ + for (int i = ARRAY_SIZE(thumb_str); i-- > 0;) { + i18n_thumb_str[i] = NULL; + } +} + +void IMB_thumb_ensure_translations(void) +{ + for (int i = ARRAY_SIZE(thumb_str); i-- > 0;) { + i18n_thumb_str[i] = BLT_translate_do(BLT_I18NCONTEXT_DEFAULT, thumb_str[i]); + } +} struct ImBuf *IMB_thumb_load_font(const char *filename, unsigned int x, unsigned int y) { @@ -62,6 +76,7 @@ struct ImBuf *IMB_thumb_load_font(const char *filename, unsigned int x, unsigned BLF_thumb_preview(filename, thumb_str, + i18n_thumb_str, ARRAY_SIZE(thumb_str), font_color, font_size, @@ -87,8 +102,9 @@ bool IMB_thumb_load_font_get_hash(char *r_hash) len += BLI_strncpy_rlen(str + len, THUMB_DEFAULT_HASH, sizeof(buf) - len); for (i = 0; (i < draw_str_lines) && (len < sizeof(buf)); i++) { - len += BLI_strncpy_rlen( - str + len, BLT_translate_do(BLT_I18NCONTEXT_DEFAULT, thumb_str[i]), sizeof(buf) - len); + len += BLI_strncpy_rlen(str + len, + i18n_thumb_str[i] != NULL ? i18n_thumb_str[i] : thumb_str[i], + sizeof(buf) - len); } BLI_hash_md5_buffer(str, len, digest); diff --git a/source/blender/imbuf/readme.txt b/source/blender/imbuf/readme.txt index 855f6229420..c192515371b 100644 --- a/source/blender/imbuf/readme.txt +++ b/source/blender/imbuf/readme.txt @@ -8,7 +8,7 @@ creating an openexr read/writer use openexr.c It should contain functions to match the following prototypes: struct ImBuf *imb_loadopenexr(unsigned char *mem,int size,int flags); -/* Use one of the following depending on whats easyer for your file format */ +/* Use one of the following depending on what's easier for your file format */ short imb_saveopenexr(struct ImBuf *ibuf, FILE myfile, int flags); short imb_saveopenexr(struct ImBuf *ibuf, char *myfile, int flags); |