Imagewindow: new Jkey (swap render rects) feature didn't correctly support
the Curves panel.
This commit is contained in:
Ton Roosendaal 2006-12-23 11:22:20 +00:00
parent 7816c3ca07
commit 8eb1d00e0d
3 changed files with 28 additions and 11 deletions

View File

@ -61,6 +61,7 @@ void imagewindow_render_callbacks(struct Render *re);
void imagewindow_toggle_render(void);
void imagewindow_swap_render_rects(void);
void imagewin_store_spare(void);
struct ImBuf *imagewindow_get_ibuf(struct SpaceImage *sima);
void image_editvertex_buts(struct uiBlock *block);

View File

@ -271,6 +271,21 @@ void what_image(SpaceImage *sima)
}
}
/* after a what_image(), this call will give ibufs, includes the spare image */
ImBuf *imagewindow_get_ibuf(SpaceImage *sima)
{
if(G.sima->image) {
/* check for spare */
if(sima->image->type==IMA_TYPE_R_RESULT && sima->showspare)
return sima->spare;
else
return BKE_image_get_ibuf(sima->image, &sima->iuser);
}
return NULL;
}
/* called to assign images to UV faces */
void image_changed(SpaceImage *sima, int dotile)
{
@ -737,7 +752,7 @@ void image_editvertex_buts(uiBlock *block)
me= get_mesh(OBACT);
if (G.sima->image) {
ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser);
ImBuf *ibuf= imagewindow_get_ibuf(G.sima);
if(ibuf) {
imx= ibuf->x;
imy= ibuf->y;
@ -1042,10 +1057,13 @@ static void image_panel_curves_reset(void *cumap_v, void *ibuf_v)
static void image_panel_curves(short cntrl) // IMAGE_HANDLER_CURVES
{
ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser);
ImBuf *ibuf;
uiBlock *block;
uiBut *bt;
/* and we check for spare */
ibuf= imagewindow_get_ibuf(G.sima);
block= uiNewBlock(&curarea->uiblocks, "image_panel_curves", UI_EMBOSS, UI_HELV, curarea->win);
uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
uiSetPanelHandler(IMAGE_HANDLER_CURVES); // for close and esc
@ -1553,10 +1571,7 @@ void drawimagespace(ScrArea *sa, void *spacedata)
}
}
/* and we check for spare */
if(sima->image->type==IMA_TYPE_R_RESULT && sima->showspare)
ibuf= sima->spare;
else
ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser);
ibuf= imagewindow_get_ibuf(sima);
}
if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) {
@ -1784,7 +1799,7 @@ static void image_zoom_set_factor(float zoomfac)
width= 256;
height= 256;
if (sima->image) {
ImBuf *ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser);
ImBuf *ibuf= imagewindow_get_ibuf(sima);
if (ibuf) {
float xim, yim;
@ -1896,12 +1911,13 @@ void image_viewzoom(unsigned short event, int invert)
*/
void image_home(void)
{
ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser);
ImBuf *ibuf;
int width, height, imgwidth, imgheight;
float zoomX, zoomY;
if (curarea->spacetype != SPACE_IMAGE) return;
ibuf= imagewindow_get_ibuf(G.sima);
if (ibuf == NULL) {
imgwidth = 256;
imgheight = 256;

View File

@ -259,13 +259,13 @@ void do_image_buttons(unsigned short event)
break;
case B_SIMACURVES:
curvemapping_do_ibuf(G.sima->cumap, BKE_image_get_ibuf(G.sima->image, &G.sima->iuser));
curvemapping_do_ibuf(G.sima->cumap, imagewindow_get_ibuf(G.sima));
allqueue(REDRAWIMAGE, 0);
break;
case B_SIMARANGE:
curvemapping_set_black_white(G.sima->cumap, NULL, NULL);
curvemapping_do_ibuf(G.sima->cumap, BKE_image_get_ibuf(G.sima->image, &G.sima->iuser));
curvemapping_do_ibuf(G.sima->cumap, imagewindow_get_ibuf(G.sima));
allqueue(REDRAWIMAGE, 0);
break;