Cleanup: IMB/thumb naming
This commit is contained in:
@@ -60,8 +60,6 @@ typedef enum ThumbSource {
|
|||||||
/* don't generate thumbs for images bigger then this (100mb) */
|
/* don't generate thumbs for images bigger then this (100mb) */
|
||||||
#define THUMB_SIZE_MAX (100 * 1024 * 1024)
|
#define THUMB_SIZE_MAX (100 * 1024 * 1024)
|
||||||
|
|
||||||
// IB_metadata
|
|
||||||
|
|
||||||
/* create thumbnail for file and returns new imbuf for thumbnail */
|
/* create thumbnail for file and returns new imbuf for thumbnail */
|
||||||
ImBuf *IMB_thumb_create(const char *path, ThumbSize size, ThumbSource source, ImBuf *ibuf);
|
ImBuf *IMB_thumb_create(const char *path, ThumbSize size, ThumbSource source, ImBuf *ibuf);
|
||||||
|
|
||||||
@@ -78,8 +76,8 @@ ImBuf *IMB_thumb_manage(const char *path, ThumbSize size, ThumbSource source);
|
|||||||
void IMB_thumb_makedirs(void);
|
void IMB_thumb_makedirs(void);
|
||||||
|
|
||||||
/* special function for loading a thumbnail embedded into a blend file */
|
/* special function for loading a thumbnail embedded into a blend file */
|
||||||
ImBuf *IMB_loadblend_thumb(const char *path);
|
ImBuf *IMB_thumb_load_blend(const char *path);
|
||||||
void IMB_overlayblend_thumb(unsigned int *thumb, int width, int height, float aspect);
|
void IMB_thumb_overlay_blend(unsigned int *thumb, int width, int height, float aspect);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ ImBuf *IMB_thumb_create(const char *path, ThumbSize size, ThumbSource source, Im
|
|||||||
/* only load if we didnt give an image */
|
/* only load if we didnt give an image */
|
||||||
if (img == NULL) {
|
if (img == NULL) {
|
||||||
if (THB_SOURCE_BLEND == source) {
|
if (THB_SOURCE_BLEND == source) {
|
||||||
img = IMB_loadblend_thumb(path);
|
img = IMB_thumb_load_blend(path);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
img = IMB_loadiffname(path, IB_rect | IB_metadata | IB_thumbnail, NULL);
|
img = IMB_loadiffname(path, IB_rect | IB_metadata | IB_thumbnail, NULL);
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ static ImBuf *loadblend_thumb(gzFile gzfile)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImBuf *IMB_loadblend_thumb(const char *path)
|
ImBuf *IMB_thumb_load_blend(const char *path)
|
||||||
{
|
{
|
||||||
gzFile gzfile;
|
gzFile gzfile;
|
||||||
/* not necessarily a gzip */
|
/* not necessarily a gzip */
|
||||||
@@ -143,7 +143,7 @@ ImBuf *IMB_loadblend_thumb(const char *path)
|
|||||||
/* add a fake passepartout overlay to a byte buffer, use for blend file thumbnails */
|
/* add a fake passepartout overlay to a byte buffer, use for blend file thumbnails */
|
||||||
#define MARGIN 2
|
#define MARGIN 2
|
||||||
|
|
||||||
void IMB_overlayblend_thumb(unsigned int *thumb, int width, int height, float aspect)
|
void IMB_thumb_overlay_blend(unsigned int *thumb, int width, int height, float aspect)
|
||||||
{
|
{
|
||||||
unsigned char *px = (unsigned char *)thumb;
|
unsigned char *px = (unsigned char *)thumb;
|
||||||
int margin_l = MARGIN;
|
int margin_l = MARGIN;
|
||||||
|
|||||||
@@ -860,7 +860,7 @@ static ImBuf *blend_file_thumb(Scene *scene, bScreen *screen, int **thumb_pt)
|
|||||||
IMB_scaleImBuf(ibuf, BLEN_THUMB_SIZE, BLEN_THUMB_SIZE);
|
IMB_scaleImBuf(ibuf, BLEN_THUMB_SIZE, BLEN_THUMB_SIZE);
|
||||||
|
|
||||||
/* add pretty overlay */
|
/* add pretty overlay */
|
||||||
IMB_overlayblend_thumb(ibuf->rect, ibuf->x, ibuf->y, aspect);
|
IMB_thumb_overlay_blend(ibuf->rect, ibuf->x, ibuf->y, aspect);
|
||||||
|
|
||||||
/* first write into thumb buffer */
|
/* first write into thumb buffer */
|
||||||
thumb = MEM_mallocN(((2 + (BLEN_THUMB_SIZE * BLEN_THUMB_SIZE))) * sizeof(int), "write_file thumb");
|
thumb = MEM_mallocN(((2 + (BLEN_THUMB_SIZE * BLEN_THUMB_SIZE))) * sizeof(int), "write_file thumb");
|
||||||
|
|||||||
Reference in New Issue
Block a user