match function names for clip/image spaces
authorCampbell Barton <ideasman42@gmail.com>
Wed, 25 Jul 2012 16:30:53 +0000 (16:30 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 25 Jul 2012 16:30:53 +0000 (16:30 +0000)
19 files changed:
source/blender/editors/include/ED_image.h
source/blender/editors/mask/mask_edit.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/sculpt_uv.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/image_edit.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/uvedit/uvedit_buttons.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/makesrna/intern/rna_space.c
source/blenderplayer/bad_level_call_stubs/stubs.c

index c07d6e699a80aec792ae055b369e0ea6c2cd6760..b31d52a6644da0474de3fe6d14caa7491b7bfcc5 100644 (file)
@@ -50,17 +50,17 @@ struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **lock
 void ED_space_image_release_buffer(struct SpaceImage *sima, void *lock);
 int ED_space_image_has_buffer(struct SpaceImage *sima);
 
-void ED_space_image_size(struct SpaceImage *sima, int *width, int *height);
-void ED_space_image_aspect(struct SpaceImage *sima, float *aspx, float *aspy);
-void ED_space_image_zoom(struct SpaceImage *sima, struct ARegion *ar, float *zoomx, float *zoomy);
-void ED_space_image_uv_aspect(struct SpaceImage *sima, float *aspx, float *aspy);
+void ED_space_image_get_size(struct SpaceImage *sima, int *width, int *height);
+void ED_space_image_get_aspect(struct SpaceImage *sima, float *aspx, float *aspy);
+void ED_space_image_get_zoom(struct SpaceImage *sima, struct ARegion *ar, float *zoomx, float *zoomy);
+void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *aspx, float *aspy);
 
 void ED_space_image_paint_update(struct wmWindowManager *wm, struct ToolSettings *settings);
 void ED_space_image_uv_sculpt_update(struct wmWindowManager *wm, struct ToolSettings *settings);
 
-void ED_image_size(struct Image *ima, int *width, int *height);
-void ED_image_aspect(struct Image *ima, float *aspx, float *aspy);
-void ED_image_uv_aspect(struct Image *ima, float *aspx, float *aspy);
+void ED_image_get_size(struct Image *ima, int *width, int *height);
+void ED_image_get_aspect(struct Image *ima, float *aspx, float *aspy);
+void ED_image_get_uv_aspect(struct Image *ima, float *aspx, float *aspy);
 
 int ED_space_image_show_render(struct SpaceImage *sima);
 int ED_space_image_show_paint(struct SpaceImage *sima);
index ca5de41c392c30fe30ff041d6682725c05c1df62..3af61b366b29ff3427bf87a22851d5df3101020b 100644 (file)
@@ -226,7 +226,7 @@ void ED_mask_size(const bContext *C, int *width, int *height)
                        case SPACE_IMAGE:
                        {
                                SpaceImage *sima = sa->spacedata.first;
-                               ED_space_image_size(sima, width, height);
+                               ED_space_image_get_size(sima, width, height);
                                break;
                        }
                        default:
@@ -263,7 +263,7 @@ void ED_mask_aspect(const bContext *C, float *aspx, float *aspy)
                        case SPACE_IMAGE:
                        {
                                SpaceImage *sima = sa->spacedata.first;
-                               ED_space_image_uv_aspect(sima, aspx, aspy);
+                               ED_space_image_get_uv_aspect(sima, aspx, aspy);
                                break;
                        }
                        default:
@@ -281,25 +281,53 @@ void ED_mask_aspect(const bContext *C, float *aspx, float *aspy)
 
 void ED_mask_pixelspace_factor(const bContext *C, float *scalex, float *scaley)
 {
-       SpaceClip *sc = CTX_wm_space_clip(C);
+       ScrArea *sa = CTX_wm_area(C);
+       if (sa && sa->spacedata.first) {
+               switch (sa->spacetype) {
+                       case SPACE_CLIP:
+                       {
+                               SpaceClip *sc = sa->spacedata.first;
+                               int width, height;
+                               float zoomx, zoomy, aspx, aspy;
 
-       /* MASKTODO */
+                               ED_space_clip_get_size(C, &width, &height);
+                               ED_space_clip_get_zoom(C, &zoomx, &zoomy);
+                               ED_space_clip_get_aspect(sc, &aspx, &aspy);
 
-       if (sc) {
-               int width, height;
-               float zoomx, zoomy, aspx, aspy;
+                               *scalex = ((float)width * aspx) * zoomx;
+                               *scaley = ((float)height * aspy) * zoomy;
+                               break;
+                       }
+                       case SPACE_SEQ:
+                       {
+                               *scalex = *scaley = 1.0f;  /* MASKTODO? */
+                               break;
+                       }
+                       case SPACE_IMAGE:
+                       {
+                               SpaceImage *sima = sa->spacedata.first;
+                               ARegion *ar = CTX_wm_region(C);
+                               int width, height;
+                               float zoomx, zoomy, aspx, aspy;
 
-               ED_space_clip_get_size(C, &width, &height);
-               ED_space_clip_get_zoom(C, &zoomx, &zoomy);
-               ED_space_clip_get_aspect(sc, &aspx, &aspy);
+                               ED_space_image_get_size(sima, &width, &height);
+                               ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy);
+                               ED_space_image_get_uv_aspect(sima, &aspx, &aspy);
 
-               *scalex = ((float)width * aspx) * zoomx;
-               *scaley = ((float)height * aspy) * zoomy;
+                               *scalex = ((float)width * aspx) * zoomx;
+                               *scaley = ((float)height * aspy) * zoomy;
+                               break;
+                       }
+                       default:
+                               /* possible other spaces from which mask editing is available */
+                               BLI_assert(0);
+                               *scalex = *scaley = 1.0f;
+                               break;
+               }
        }
        else {
-               /* possible other spaces from which mask editing is available */
-               *scalex = 1.0f;
-               *scaley = 1.0f;
+               BLI_assert(0);
+               *scalex = *scaley = 1.0f;
        }
 }
 
index 91a41224d6a5e9cee8633ea56019ca67645c11f5..2a497d599aa4e37e223087f0eee2292c6de4dcab 100644 (file)
@@ -5201,7 +5201,7 @@ int get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy)
                SpaceImage *sima = CTX_wm_space_image(C);
                ARegion *ar = CTX_wm_region(C);
                
-               ED_space_image_zoom(sima, ar, zoomx, zoomy);
+               ED_space_image_get_zoom(sima, ar, zoomx, zoomy);
 
                return 1;
        }
index 95441600d77d8e8b8e81bf9f84ed2078e26f12fb..fdce8ec04a4361dbf6fce6961ad84a5f97bb5c12 100644 (file)
@@ -315,8 +315,8 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event,
        UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &co[0], &co[1]);
 
        sima = CTX_wm_space_image(C);
-       ED_space_image_size(sima, &width, &height);
-       ED_space_image_zoom(sima, ar, &zoomx, &zoomy);
+       ED_space_image_get_size(sima, &width, &height);
+       ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy);
 
        radius = BKE_brush_size_get(scene, brush) / (width * zoomx);
        aspectRatio = width / (float)height;
@@ -683,8 +683,8 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent
 
                        radius = BKE_brush_size_get(scene, brush);
                        sima = CTX_wm_space_image(C);
-                       ED_space_image_size(sima, &width, &height);
-                       ED_space_image_zoom(sima, ar, &zoomx, &zoomy);
+                       ED_space_image_get_size(sima, &width, &height);
+                       ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy);
 
                        aspectRatio = width / (float)height;
                        radius /= (width * zoomx);
index aaa2676c4c2f9f06b1326375607e92ada8d9d3bb..52ed7fd1d0b8b6144b88d118f710ce6a0bab5b51 100644 (file)
@@ -710,7 +710,7 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene)
        what_image(sima);
        
        if (sima->image) {
-               ED_image_aspect(sima->image, &xuser_asp, &yuser_asp);
+               ED_image_get_aspect(sima->image, &xuser_asp, &yuser_asp);
                
                /* UGLY hack? until now iusers worked fine... but for flipbook viewer we need this */
                if (sima->image->type == IMA_TYPE_COMPOSITE) {
@@ -727,7 +727,7 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene)
 
        /* retrieve the image and information about it */
        ima = ED_space_image(sima);
-       ED_space_image_zoom(sima, ar, &zoomx, &zoomy);
+       ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy);
 
        show_viewer = (ima && ima->source == IMA_SRC_VIEWER);
        show_render = (show_viewer && ima->type == IMA_TYPE_R_RESULT);
index 8b9c9d767558309c4ff7f433bbb78a8a268384c4..736b585864befad6dfee82c727700fa26d9834e1 100644 (file)
@@ -136,7 +136,7 @@ int ED_space_image_has_buffer(SpaceImage *sima)
        return has_buffer;
 }
 
-void ED_image_size(Image *ima, int *width, int *height)
+void ED_image_get_size(Image *ima, int *width, int *height)
 {
        ImBuf *ibuf = NULL;
        void *lock;
@@ -157,7 +157,7 @@ void ED_image_size(Image *ima, int *width, int *height)
                BKE_image_release_ibuf(ima, lock);
 }
 
-void ED_space_image_size(SpaceImage *sima, int *width, int *height)
+void ED_space_image_get_size(SpaceImage *sima, int *width, int *height)
 {
        Scene *scene = sima->iuser.scene;
        ImBuf *ibuf;
@@ -190,7 +190,7 @@ void ED_space_image_size(SpaceImage *sima, int *width, int *height)
        ED_space_image_release_buffer(sima, lock);
 }
 
-void ED_image_aspect(Image *ima, float *aspx, float *aspy)
+void ED_image_get_aspect(Image *ima, float *aspx, float *aspy)
 {
        *aspx = *aspy = 1.0;
 
@@ -204,27 +204,27 @@ void ED_image_aspect(Image *ima, float *aspx, float *aspy)
        *aspy = ima->aspy / ima->aspx;
 }
 
-void ED_space_image_aspect(SpaceImage *sima, float *aspx, float *aspy)
+void ED_space_image_get_aspect(SpaceImage *sima, float *aspx, float *aspy)
 {
-       ED_image_aspect(ED_space_image(sima), aspx, aspy);
+       ED_image_get_aspect(ED_space_image(sima), aspx, aspy);
 }
 
-void ED_space_image_zoom(SpaceImage *sima, ARegion *ar, float *zoomx, float *zoomy)
+void ED_space_image_get_zoom(SpaceImage *sima, ARegion *ar, float *zoomx, float *zoomy)
 {
        int width, height;
 
-       ED_space_image_size(sima, &width, &height);
+       ED_space_image_get_size(sima, &width, &height);
 
        *zoomx = (float)(ar->winrct.xmax - ar->winrct.xmin + 1) / (float)((ar->v2d.cur.xmax - ar->v2d.cur.xmin) * width);
        *zoomy = (float)(ar->winrct.ymax - ar->winrct.ymin + 1) / (float)((ar->v2d.cur.ymax - ar->v2d.cur.ymin) * height);
 }
 
-void ED_space_image_uv_aspect(SpaceImage *sima, float *aspx, float *aspy)
+void ED_space_image_get_uv_aspect(SpaceImage *sima, float *aspx, float *aspy)
 {
        int w, h;
 
-       ED_space_image_aspect(sima, aspx, aspy);
-       ED_space_image_size(sima, &w, &h);
+       ED_space_image_get_aspect(sima, aspx, aspy);
+       ED_space_image_get_size(sima, &w, &h);
 
        *aspx *= (float)w;
        *aspy *= (float)h;
@@ -239,12 +239,12 @@ void ED_space_image_uv_aspect(SpaceImage *sima, float *aspx, float *aspy)
        }
 }
 
-void ED_image_uv_aspect(Image *ima, float *aspx, float *aspy)
+void ED_image_get_uv_aspect(Image *ima, float *aspx, float *aspy)
 {
        int w, h;
 
-       ED_image_aspect(ima, aspx, aspy);
-       ED_image_size(ima, &w, &h);
+       ED_image_get_aspect(ima, aspx, aspy);
+       ED_image_get_size(ima, &w, &h);
 
        *aspx *= (float)w;
        *aspy *= (float)h;
index 9dfaac76dab17cb8fbcdd587b185c44e59187e85..c204d0dec31e5a06474095f37d12abe1f287b3ce 100644 (file)
@@ -91,7 +91,7 @@ static void sima_zoom_set(SpaceImage *sima, ARegion *ar, float zoom, float locat
 
        if (sima->zoom < 0.1f || sima->zoom > 4.0f) {
                /* check zoom limits */
-               ED_space_image_size(sima, &width, &height);
+               ED_space_image_get_size(sima, &width, &height);
 
                width *= sima->zoom;
                height *= sima->zoom;
@@ -107,8 +107,8 @@ static void sima_zoom_set(SpaceImage *sima, ARegion *ar, float zoom, float locat
        if ((U.uiflag & USER_ZOOM_TO_MOUSEPOS) && location) {
                float aspx, aspy, w, h;
 
-               ED_space_image_size(sima, &width, &height);
-               ED_space_image_aspect(sima, &aspx, &aspy);
+               ED_space_image_get_size(sima, &width, &height);
+               ED_space_image_get_aspect(sima, &aspx, &aspy);
 
                w = width * aspx;
                h = height * aspy;
@@ -564,8 +564,8 @@ static int image_view_all_exec(bContext *C, wmOperator *UNUSED(op))
        sima = CTX_wm_space_image(C);
        ar = CTX_wm_region(C);
 
-       ED_space_image_size(sima, &width, &height);
-       ED_space_image_aspect(sima, &aspx, &aspy);
+       ED_space_image_get_size(sima, &width, &height);
+       ED_space_image_get_aspect(sima, &aspx, &aspy);
 
        w = width * aspx;
        h = height * aspy;
@@ -621,8 +621,8 @@ static int image_view_selected_exec(bContext *C, wmOperator *UNUSED(op))
        obedit = CTX_data_edit_object(C);
 
        ima = ED_space_image(sima);
-       ED_space_image_size(sima, &width, &height);
-       ED_image_aspect(ima, &aspx, &aspy);
+       ED_space_image_get_size(sima, &width, &height);
+       ED_image_get_aspect(ima, &aspx, &aspy);
 
        width = width * aspx;
        height = height * aspy;
index 8760b5d551fa8e2c801987b2669d0401d7ebc837..3c9c46c1c75e0327ecacb0ffdd72a1058e321056 100644 (file)
@@ -507,7 +507,7 @@ static void image_main_area_set_view2d(SpaceImage *sima, ARegion *ar)
        if (image_preview_active(curarea, &width, &height)) ;
        else
 #endif
-       ED_space_image_size(sima, &width, &height);
+       ED_space_image_get_size(sima, &width, &height);
 
        w = width;
        h = height;
index b2bb33f19ea4296726374858b595a4b8a5c131c3..ceb10060826c53f6a3b0f9a38b57ac1341b713db 100644 (file)
@@ -147,7 +147,7 @@ void convertViewVec(TransInfo *t, float r_vec[3], int dx, int dy)
 
                /* MASKTODO - see clip clamp w/h */
 
-               ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
+               ED_space_image_get_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
                r_vec[0] *= aspx;
                r_vec[1] *= aspy;
        }
@@ -211,7 +211,7 @@ void projectIntView(TransInfo *t, const float vec[3], int adr[2])
        else if (t->spacetype == SPACE_IMAGE) {
                float aspx, aspy, v[2];
 
-               ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
+               ED_space_image_get_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
                v[0] = vec[0] / aspx;
                v[1] = vec[1] / aspy;
 
@@ -306,13 +306,13 @@ void applyAspectRatio(TransInfo *t, float vec[2])
 
                if ((sima->flag & SI_COORDFLOATS) == 0) {
                        int width, height;
-                       ED_space_image_size(sima, &width, &height);
+                       ED_space_image_get_size(sima, &width, &height);
 
                        vec[0] *= width;
                        vec[1] *= height;
                }
 
-               ED_space_image_uv_aspect(sima, &aspx, &aspy);
+               ED_space_image_get_uv_aspect(sima, &aspx, &aspy);
                vec[0] /= aspx;
                vec[1] /= aspy;
        }
@@ -346,13 +346,13 @@ void removeAspectRatio(TransInfo *t, float vec[2])
 
                if ((sima->flag & SI_COORDFLOATS) == 0) {
                        int width, height;
-                       ED_space_image_size(sima, &width, &height);
+                       ED_space_image_get_size(sima, &width, &height);
 
                        vec[0] /= width;
                        vec[1] /= height;
                }
 
-               ED_space_image_uv_aspect(sima, &aspx, &aspy);
+               ED_space_image_get_uv_aspect(sima, &aspx, &aspy);
                vec[0] *= aspx;
                vec[1] *= aspy;
        }
index 55110e48469a8c1c16db8bc0e408a85641b2496f..b5b1fbde1848a0bea3143d499fe6aa09841ebacd 100644 (file)
@@ -722,7 +722,7 @@ void drawPropCircle(const struct bContext *C, TransInfo *t)
                else if (t->spacetype == SPACE_IMAGE) {
                        float aspx, aspy;
 
-                       ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
+                       ED_space_image_get_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
                        glScalef(1.0f / aspx, 1.0f / aspy, 1.0);
                }
 
index 8ab6e5e68ce49c563b7e94fd03147619e8505456..6dc0e98605846426088a47cfadd6e3eef51f56fd 100644 (file)
@@ -2320,7 +2320,7 @@ static void UVsToTransData(SpaceImage *sima, TransData *td, TransData2D *td2d, f
 {
        float aspx, aspy;
 
-       ED_space_image_uv_aspect(sima, &aspx, &aspy);
+       ED_space_image_get_uv_aspect(sima, &aspx, &aspy);
 
        /* uv coords are scaled by aspects. this is needed for rotations and
         * proportional editing to be consistent with the stretched uv coords
@@ -2428,8 +2428,8 @@ void flushTransUVs(TransInfo *t)
        int a, width, height;
        float aspx, aspy, invx, invy;
 
-       ED_space_image_uv_aspect(sima, &aspx, &aspy);
-       ED_space_image_size(sima, &width, &height);
+       ED_space_image_get_uv_aspect(sima, &aspx, &aspy);
+       ED_space_image_get_size(sima, &width, &height);
        invx = 1.0f / aspx;
        invy = 1.0f / aspy;
 
@@ -2451,7 +2451,7 @@ int clipUVTransform(TransInfo *t, float *vec, int resize)
        int a, clipx = 1, clipy = 1;
        float aspx, aspy, min[2], max[2];
 
-       ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
+       ED_space_image_get_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
        min[0] = min[1] = 0.0f;
        max[0] = aspx; max[1] = aspy;
 
index a250c763dd1f5fe168c9c19e2c1deeb7e9f1a3d5..8651241f3386d0359fd60eea1d4e1fab17b3ad1c 100644 (file)
@@ -1432,7 +1432,7 @@ void calculateCenterCursor2D(TransInfo *t)
        if (t->spacetype == SPACE_IMAGE) {
                SpaceImage *sima = (SpaceImage *)t->sa->spacedata.first;
                /* only space supported right now but may change */
-               ED_space_image_uv_aspect(sima, &aspx, &aspy);
+               ED_space_image_get_uv_aspect(sima, &aspx, &aspy);
                cursor = sima->cursor;
        }
        
index 0ea48e81029f7a0251fc4a85ec5e26287e8f9e7f..7c86b697437d4dde391666ef1071af4122a9c80f 100644 (file)
@@ -206,7 +206,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
                        myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
                        glLoadIdentity();
                        
-                       ED_space_image_aspect(t->sa->spacedata.first, &xuser_aspx, &yuser_asp);
+                       ED_space_image_get_aspect(t->sa->spacedata.first, &xuser_aspx, &yuser_asp);
                        ED_space_image_width(t->sa->spacedata.first, &wi, &hi);
                        w = (((float)wi) / 256.0f) * G.sima->zoom * xuser_asp;
                        h = (((float)hi) / 256.0f) * G.sima->zoom * yuser_asp;
@@ -927,7 +927,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
                UI_view2d_region_to_view(&t->ar->v2d, t->mval[0], t->mval[1], co, co + 1);
 
                if (ED_uvedit_nearest_uv(t->scene, t->obedit, ima, co, t->tsnap.snapPoint)) {
-                       ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
+                       ED_space_image_get_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
                        t->tsnap.snapPoint[0] *= aspx;
                        t->tsnap.snapPoint[1] *= aspy;
 
@@ -2135,7 +2135,7 @@ static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], Gea
        
        /* evil hack - snapping needs to be adapted for image aspect ratio */
        if ((t->spacetype == SPACE_IMAGE) && (t->mode == TFM_TRANSLATION)) {
-               ED_space_image_uv_aspect(t->sa->spacedata.first, asp, asp + 1);
+               ED_space_image_get_uv_aspect(t->sa->spacedata.first, asp, asp + 1);
        }
 
        for (i = 0; i <= max_index; i++) {
index ec645f86848b6944f0bb08b353425b180f32afed..fa39a52444beeee681a49f046e6ac9ec6917c48d 100644 (file)
@@ -125,7 +125,7 @@ static void uvedit_vertex_buttons(const bContext *C, uiBlock *block)
        float center[2];
        int imx, imy, step, digits;
 
-       ED_space_image_size(sima, &imx, &imy);
+       ED_space_image_get_size(sima, &imx, &imy);
        
        em = BMEdit_FromObject(obedit);
 
@@ -168,7 +168,7 @@ static void do_uvedit_vertex(bContext *C, void *UNUSED(arg), int event)
 
        em = BMEdit_FromObject(obedit);
 
-       ED_space_image_size(sima, &imx, &imy);
+       ED_space_image_get_size(sima, &imx, &imy);
        uvedit_center(scene, em, ima, center);
 
        if (sima->flag & SI_COORDFLOATS) {
index 17c57b1f6e47de162df2ff17b95e16c6121153a1..55dfbc8a0df62341929d4e808ce134f6c68cc290 100644 (file)
@@ -68,8 +68,8 @@ static void drawcursor_sima(SpaceImage *sima, ARegion *ar)
        float zoomx, zoomy, w, h;
        int width, height;
 
-       ED_space_image_size(sima, &width, &height);
-       ED_space_image_zoom(sima, ar, &zoomx, &zoomy);
+       ED_space_image_get_size(sima, &width, &height);
+       ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy);
 
        w = zoomx * width / 256.0f;
        h = zoomy * height / 256.0f;
@@ -174,7 +174,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
        float aspx, aspy, col[4], (*tf_uv)[2] = NULL, (*tf_uvorig)[2] = NULL;
        int i, j, nverts;
 
-       ED_space_image_uv_aspect(sima, &aspx, &aspy);
+       ED_space_image_get_uv_aspect(sima, &aspx, &aspy);
        
        switch (sima->dt_uvstretch) {
                case SI_UVDT_STRETCH_AREA:
index 0510ae21326ddafffbd8ef574d41e1c014ac7582..0f4f03e5b7170d877b169a43f3ee6df11391d155 100644 (file)
@@ -199,8 +199,8 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im
                float prev_aspect[2], fprev_aspect;
                float aspect[2], faspect;
 
-               ED_image_uv_aspect(previma, prev_aspect, prev_aspect + 1);
-               ED_image_uv_aspect(ima, aspect, aspect + 1);
+               ED_image_get_uv_aspect(previma, prev_aspect, prev_aspect + 1);
+               ED_image_get_uv_aspect(ima, aspect, aspect + 1);
 
                fprev_aspect = prev_aspect[0]/prev_aspect[1];
                faspect = aspect[0]/aspect[1];
@@ -292,7 +292,7 @@ static void uvedit_pixel_to_float(SpaceImage *sima, float *dist, float pixeldist
        int width, height;
 
        if (sima) {
-               ED_space_image_size(sima, &width, &height);
+               ED_space_image_get_size(sima, &width, &height);
        }
        else {
                width = 256;
@@ -2604,8 +2604,8 @@ static int circle_select_exec(bContext *C, wmOperator *op)
 
        /* compute ellipse size and location, not a circle since we deal
         * with non square image. ellipse is normalized, r = 1.0. */
-       ED_space_image_size(sima, &width, &height);
-       ED_space_image_zoom(sima, ar, &zoomx, &zoomy);
+       ED_space_image_get_size(sima, &width, &height);
+       ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy);
 
        ellipse[0] = width * zoomx / radius;
        ellipse[1] = height * zoomy / radius;
@@ -2781,7 +2781,7 @@ static void snap_cursor_to_pixels(SpaceImage *sima)
 {
        int width = 0, height = 0;
 
-       ED_space_image_size(sima, &width, &height);
+       ED_space_image_get_size(sima, &width, &height);
        snap_uv_to_pixel(sima->cursor, width, height);
 }
 
@@ -2936,7 +2936,7 @@ static int snap_uvs_to_pixels(SpaceImage *sima, Scene *scene, Object *obedit)
        float w, h;
        short change = 0;
 
-       ED_space_image_size(sima, &width, &height);
+       ED_space_image_get_size(sima, &width, &height);
        w = (float)width;
        h = (float)height;
        
index 1def5caad87f1a73e5b10aa624a7e6fc6ae38684..4b6c0ef0e7bcaaf97cabe98d616a88e33b01ab1c 100644 (file)
@@ -198,7 +198,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
                        float aspx, aspy;
                        tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
 
-                       ED_image_uv_aspect(tf->tpage, &aspx, &aspy);
+                       ED_image_get_uv_aspect(tf->tpage, &aspx, &aspy);
                
                        if (aspx != aspy)
                                param_aspect_ratio(handle, aspx, aspy);
@@ -388,7 +388,7 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, BMEditMesh *e
                        float aspx, aspy;
                        tf = CustomData_bmesh_get(&em->bm->pdata, editFace->head.data, CD_MTEXPOLY);
 
-                       ED_image_uv_aspect(tf->tpage, &aspx, &aspy);
+                       ED_image_get_uv_aspect(tf->tpage, &aspx, &aspy);
 
                        if (aspx != aspy)
                                param_aspect_ratio(handle, aspx, aspy);
@@ -1017,7 +1017,7 @@ static void correct_uv_aspect(BMEditMesh *em)
                MTexPoly *tf;
 
                tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
-               ED_image_uv_aspect(tf->tpage, &aspx, &aspy);
+               ED_image_get_uv_aspect(tf->tpage, &aspx, &aspy);
        }
        
        if (aspx == aspy)
index acfd413fddef3dcb5fb212463b4aaac57e297f61..96f26eb637d86ad147ef1b828d73e93b011ace06 100644 (file)
@@ -620,7 +620,7 @@ static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values)
        sa = rna_area_from_space(ptr); /* can be NULL */
        ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
        if (ar) {
-               ED_space_image_zoom(sima, ar, &values[0], &values[1]);
+               ED_space_image_get_zoom(sima, ar, &values[0], &values[1]);
        }
 }
 
@@ -633,7 +633,7 @@ static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *val
        }
        else {
                int w, h;
-               ED_space_image_size(sima, &w, &h);
+               ED_space_image_get_size(sima, &w, &h);
                
                values[0] = sima->cursor[0] * w;
                values[1] = sima->cursor[1] * h;
@@ -649,7 +649,7 @@ static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const floa
        }
        else {
                int w, h;
-               ED_space_image_size(sima, &w, &h);
+               ED_space_image_get_size(sima, &w, &h);
                
                sima->cursor[0] = values[0] / w;
                sima->cursor[1] = values[1] / h;
index 53f3dacbffa01a7325c0405ded44cd9f8332ccd0..8ae083af0ba8d4a56f4ec85b5ef221de6a4380b4 100644 (file)
@@ -271,7 +271,7 @@ short ANIM_add_driver(struct ID *id, const char rna_path[], int array_index, sho
 short ANIM_remove_driver(struct ID *id, const char rna_path[], int array_index, short flag) {return 0;}
 void ED_space_image_release_buffer(struct SpaceImage *sima, void *lock) {}
 struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **lock_r) {return (struct ImBuf *) NULL;}
-void ED_space_image_zoom(struct SpaceImage *sima, struct ARegion *ar, float *zoomx, float *zoomy) {}
+void ED_space_image_get_zoom(struct SpaceImage *sima, struct ARegion *ar, float *zoomx, float *zoomy) {}
 char *ED_info_stats_string(struct Scene *scene) {return (char *) NULL;}
 void ED_area_tag_redraw(struct ScrArea *sa) {}
 void ED_area_tag_refresh(struct ScrArea *sa) {}
@@ -345,7 +345,7 @@ intptr_t mesh_octree_table(struct Object *ob, struct BMEditMesh *em, float *co,
 
 void ED_sequencer_update_view(struct bContext *C, int view) {}
 float ED_rollBoneToVector(struct EditBone *bone, float new_up_axis[3]) {return 0.0f;}
-void ED_space_image_size(struct SpaceImage *sima, int *width, int *height) {}
+void ED_space_image_get_size(struct SpaceImage *sima, int *width, int *height) {}
 
 void ED_nurb_set_spline_type(struct Nurb *nu, int type) {}