Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Undocumented functions for working with graphics

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101188] Re: Undocumented functions for working with graphics
  • From: Alexey <lehin.p at gmail.com>
  • Date: Fri, 26 Jun 2009 06:50:42 -0400 (EDT)
  • References: <h0qogh$kkq$1@smc.vnet.net> <h0sbok$h8i$1@smc.vnet.net>

Thank you again!
But how can I understand the real meaning of such variables (?) as
Image`ImageDump`cf, Image`ImageDump`list etc.?

On 25 Jun, 15:09, David Reiss <dbre... at gmail.com> wrote:
> Hi there...
>
> When I posted the result to MathGroup, I did edit it a bit to remove
> the Image`ImageDump` context prefixes so that it would be easier to
> read.  I simply did a global replace for the string Image`ImageDump`
> so that the resulting code fragment would be more readable.
>
> These bits of code that are high level Mathematica code often have
> these various contexts in them based on how Wolfram research handles
> internal not-for-general-consumption Mathematica code.
>
> Also some folks may have noticed that one gets a different answer if
> one tries to obtain the code in a fresh Mathematica session.  This is
> because the code in some of these these contexts is not loaded until
> one actually tries to first  make use fo the function.
>
> So, for example,  executing something like
>
> Image[ {{0, 1, 0}, {1, 0, 1}, {0, 1, 0}}]
>
> Will load that code and then subsequently going through the process
> that I outlined will create the code that I showed.
>
> Best,
>
> Davidhttp://scientificarts.com/worklife
>
> On Jun 24, 6:34 am, Alexey <lehi... at gmail.com> wrote:
>
> > Thank you very much! The method you have described is great. Some
> > times for using it I must launch Mathematica with "-cleanStart" key
> > for clearing the dump. But for Image`ToGraphicsRaster I can not get
> > your "clear" code. My result contains unknown functions like
> > Image`ImageDump`list with no attributes:
>
> > In[1]:= ClearAttributes[Image`ToGraphicsRaster, {Protected,
> > ReadProtected}]
> > ?Image`ToGraphicsRaster
>
> > Output:
>
> > Image`ToGraphicsRaster[Image`ImageDump`list:{_?
> > Image`ValidImageQ..}]:=Image`ToGraphicsRaster/@Image`ImageDump`list
>
> > Image`ToGraphicsRaster[Image`ImageDump`img_?Image`ValidImageQ]:=Modul=
e
> > [{Image`ImageDump`width,Image`ImageDump`height,Image`ImageDump`range,Im=
ag=
> e` =
> > ImageDump`cf,Image`ImageDump`data,Image`ImageDump`interleaving,Image`Im=
ag=
> eD =
> > ump`imsize},
> > {{Image`ImageDump`width,Image`ImageDump`height},Image`ImageDump`range,I=
ma=
> ge =
> > `ImageDump`cf}
> > =ImageData[Image`ImageDump`img,
> > {ImageDimensions,DataRange,ColorFunction}];
> > {Image`ImageDump`interleaving,Image`ImageDump`imsize}=
> > {Interleaving,ImageSize}/.Options[Image`ImageDump`img]/.Options
> > [Image];If
> > [Image`ImageDump`interleaving===False,Image`ImageDump`data=Reve=
rs=
> e
> > [ImageData[Image`ImageDump`img,Interleaving->True]],Image`ImageDump`dat=
a=
> =Reverse[First
>
> > [Image`ImageDump`img]]];Graphics[Raster[Image`ImageDump`data,{{0,0},
> > {Image`ImageDump`width,Image`ImageDump`height}},Image`ImageDump`range,C=
ol=
> or =
> > Function->Image`ImageDump`cf],If[Image`ImageDump`imsize===Automat=
ic=
> ||
>
> > Image`ImageDump`imsize===All,ImageSize->
> > {Image`ImageDump`width,Image`ImageDump`height},ImageSize->Image`ImageDu=
mp=
>
> `imsize],PlotRange->{{0,Image`ImageDump`width},
>
>
>
> > {0,Image`ImageDump`height}}]]
>
> > How did you get your "clear" code?
>
> > On 12 Jun, 05:41, David Reiss <dbre... at gmail.com> wrote:
>
> > > ...just following up on the method for reverse engineering of my
> > > previous post, here is part of the code for ToGraphicsRaster  obtai=
ne=
> d
> > > using that approach:
>
> > > Image`ToGraphicsRaster[img_?Image`ValidImageQ] :=
> > >  Module[{width, height, range, cf, data, interleaving,
> > >    imsize}, {{width, height}, range, cf} =
> > >    ImageData[
> > >     img, {ImageDimensions, DataRange, ColorFunction}]; {interleav=
in=
> g,
> > >     imsize} = {Interleaving, ImageSize} /. Options[img] /.
> > >     Options[Image];
> > >   If[interleaving === False,
> > >    data = Reverse[ImageData[img, Interleaving -> True]],
> > >    data = Reverse[First[img]]];
> > >   "Graphics"[
> > >    Raster[data, {{0, 0}, {width, height}}, range,
> > >     ColorFunction -> cf],
> > >    If[imsize === Automatic || imsize === All,
> > >     ImageSize -> {width, height}, ImageSize -> imsize],
> > >    PlotRange -> {{0, width}, {0, height}}]]
>
> > > On Jun 11, 7:06 am, Alexey <lehi... at gmail.com> wrote:
>
> > > > Hello,
>
> > > > Does anyone know  where such functions as "Image`ToGraphicsRaster=
" =
> an=
> > d
> > > > "Image`PossibleImageQ" are documented. Are there other such built-i=
n
> > > > functions? At this moment I even can't imagine from where (except t=
hi=
> s
> > > > group) I could learn that functions mentioned exist...
>
>



  • Prev by Date: Re: Re: Re: Putting an If in my function
  • Next by Date: Eigenvalue bug in Mathematica 7.0.0
  • Previous by thread: Re: Undocumented functions for working with graphics
  • Next by thread: Re: Undocumented functions for working with graphics