From bfe248b3d629d28fed3798e9f6a42bccb5d40f9e Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 6 Apr 2010 02:05:54 +0000 Subject: Patch [#21750] Add luma waveform and vectorscope to image view by Xavier Thomas This adds the waveform monitor and vectorscope to the image editor 'scopes' region, bringing it inline (plus a bit more) with sequence editor functionality, and a big step closer to the end goal of unifying the display code for image/ comp/sequence editor. It's non-intrusive, using the same code paths as the histogram. There's still room for more tweaks - I modified the original patch, changing the openGL immediate mode drawing of the waveform display to vertex arrays for speed optimisation. Xavier can look at doing this for the vectorscope now too. Thanks very much Xavier! --- source/blender/blenloader/intern/readfile.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 1f6d36dc957..6dcfb7f0ec7 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4836,6 +4836,9 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) SpaceImage *sima= (SpaceImage *)sl; sima->image= restore_pointer_by_name(newmain, (ID *)sima->image, 1); + + sima->scopes.samples_ibuf = NULL; + sima->scopes.ok = 0; /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data * so assume that here we're doing for undo only... @@ -5108,6 +5111,8 @@ static void direct_link_screen(FileData *fd, bScreen *sc) sima->iuser.scene= NULL; sima->iuser.ok= 1; + sima->scopes.samples_ibuf = NULL; + sima->scopes.ok = 0; /* WARNING: gpencil data is no longer stored directly in sima after 2.5 * so sacrifice a few old files for now to avoid crashes with new files! @@ -10731,7 +10736,26 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* put 2.50 compatibility code here until next subversion bump */ { + bScreen *sc; + /* Image editor scopes */ + for(sc= main->screen.first; sc; sc= sc->id.next) { + ScrArea *sa; + for(sa= sc->areabase.first; sa; sa= sa->next) { + SpaceLink *sl; + for (sl= sa->spacedata.first; sl; sl= sl->next) { + if(sl->spacetype==SPACE_IMAGE) { + SpaceImage *sima = (SpaceImage *)sl; + sima->scopes.accuracy = 30.0; + sima->scopes.hist.mode=HISTO_MODE_RGB; + sima->scopes.wavefrm_alpha=0.3; + sima->scopes.vecscope_alpha=0.3; + sima->scopes.wavefrm_height= 100; + sima->scopes.hist.height= 100; + } + } + } + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ -- cgit v1.2.3