Images now have option to be tagged "convert to premul".

Option available in the Image (properties) panel.
This commit is contained in:
Ton Roosendaal
2007-11-28 12:32:25 +00:00
parent 36f7da7046
commit 7154e84ee1
3 changed files with 8 additions and 2 deletions

View File

@@ -1560,6 +1560,9 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
if ((ima->packedfile == NULL) && (G.fileflags & G_AUTOPACK))
ima->packedfile = newPackedFile(str);
}
if(ima->flag & IMA_DO_PREMUL)
converttopremul(ibuf);
}
else
ima->ok= 0;

View File

@@ -108,7 +108,7 @@ typedef struct Image {
#define IMA_REFLECT 16
#define IMA_NOCOLLECT 32
#define IMA_ANTIALI 64
#define IMA_DO_PREMUL 128
/* tpageflag */
#define IMA_TILES 1

View File

@@ -1174,9 +1174,12 @@ void uiblock_image_panel(uiBlock *block, Image **ima_pp, ImageUser *iuser,
but= uiDefButBitS(block, TOG, IMA_FIELDS, imagechanged, "Fields", 10, 90, 100, 20, &ima->flag, 0, 0, 0, 0, "Click to enable use of fields in Image");
uiButSetFunc(but, image_field_test, ima, iuser);
uiDefButBitS(block, TOG, IMA_STD_FIELD, B_NOP, "Odd", 10, 70, 100, 20, &ima->flag, 0, 0, 0, 0, "Standard Field Toggle");
uiBlockEndAlign(block);
uiBlockBeginAlign(block);
uiBlockSetFunc(block, image_reload_cb, ima, iuser);
uiDefButBitS(block, TOG, IMA_ANTIALI, B_NOP, "Anti", 10, 35, 100, 20, &ima->flag, 0, 0, 0, 0, "Toggles Image anti-aliasing, only works with solid colors");
uiDefButBitS(block, TOG, IMA_DO_PREMUL, imagechanged, "Premul", 110, 35, 100, 20, &ima->flag, 0, 0, 0, 0, "Toggles premultiplying alpha");
uiBlockEndAlign(block);
if( ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
sprintf(str, "(%d) Frames:", iuser->framenr);