Re: [Gegl-developer] let me see if I have got this straight.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 27, 2003 at 05:12:12PM -0800, Daniel Rogers wrote:
> ImageData is ColorData plus a rectangle.
> 
> ColorData is GeglData plus a ColorModel.
> 
> The value of a GeglData (for an ImageData or ColorData) is an Image
> 
> An Image is a ColorModel and a tile.
> 
> A tile is an Area, a Buffer, and a Storage.
> 
> A Buffer is a collection of data banks.
> 
> A Storage is a specification that can be used to create a Buffer.

Thats all correct. 

The value field of a GeglData is a GValue, which is just a 
fancy union that can hold any type (float, int, char, GObject, GeglImage, etc). 
This gives us something generic enough that it can pass any kind
of data.

It also has a GParamSpec associated with it, which contains 
info for checking the validity of the value (say if the
value is a float which is supposed to be restricted to min=0.0
max=1.0, then that range info would be held in the param spec 
associated with the value).  

 
> Can you correct me here, I am still unclear on how to process an image. 
>   Let's suppose I have an RGB TIFF image.
> 
> pixel_array[][] * tiff_pixels is the pixel data read from the file.
> 
> How do I get the TIFF data processed into the graph?

You'd write a subclass of ImageOp that is a 
FileInNode that reads the file and just copies
from the file into the normal Image created by the 
ImageOp.

Same way to get the data back to disk. Your
root node would be a FileOutNode that reads
from its image input and saves the data back 
to disk. 

If the data is in your (non-gegl) pixel_array 
already, you'd again need a subclass of Image
Op that would "copy" from your array
and just put in into the Image output of 
ImageOp.  
 
> As far as I have been able to figure out, and Image represents only a 
> single tile, so if I understand this correcly, I would have to break up 
> tiff_pixels into my tile sized chunks, copy each one into a Tile, assign 
> each tile to a seperate Image, assign each Image to a seperate 
> ImageData, and then process each ImageData, collect the outputs, extract 
> the Image, extract the Tile from the Image, and then finally cobble 
> together all the tiles to form my resultant image.

Well, right now an Image has just one Tile, but it should be
a set of Tiles really(it just hasnt happened yet). That
would make things easier. Your copy op (from pixel_array
to ImageOp Image format) would then request an interator that
would iterate through the tiles of the image and you 
would write your data into those.

Calvin

[Index of Archives]     [Yosemite News]     [Yosemite Photos]     [gtk]     [GIMP Users]     [KDE]     [Gimp's Home]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux