Re: [Gimp-developer] Write basic gegl plugin

2011-04-04 Thread sourav de
On Tue, Apr 5, 2011 at 11:11 AM, Madhav yadav wrote:

> If i have to submit my sample on the gegl master branch then how will i go
> forthh.
>
>
> On Mon, Apr 4, 2011 at 8:47 PM, Jon Nordby  wrote:
>
>> Get the code, build it on your computer, start working on the plugin.
>>
>> On 4 April 2011 17:02, shivani maheshwari 
>> wrote:
>> > Yes i did see that . But I am not able to gather where to begin from??
>> >
>> > On Mon, Apr 4, 2011 at 8:09 PM, Tobias Jakobs <
>> tobias.jak...@googlemail.com>
>> > wrote:
>> >>
>> >> Have you seen this page?
>> >> http://wiki.gimp.org/index.php/Users:Beginner_Developer%27s_FAQ
>> >>
>> >> On Mon, Apr 4, 2011 at 16:32, Madhav yadav 
>> >> wrote:
>> >> > Hello,
>> >> > I want to write basic gegl pluginCan anybody help me with the
>> same..
>> >> >
>> >> >
>> >> > ___
>> >> > Gimp-developer mailing list
>> >> > Gimp-developer@lists.XCF.Berkeley.EDU
>> >> > https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>> >> >
>> >> >
>> >> ___
>> >> Gimp-developer mailing list
>> >> Gimp-developer@lists.XCF.Berkeley.EDU
>> >> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>> >
>> >
>> >
>> > --
>> > Shivani Maheshwari
>> > Under Graduation( BTech.)
>> > Indian Institute of Information Technology,
>> > Allahabad (Amethi Campus)
>> > India
>> >
>> > ___
>> > Gimp-developer mailing list
>> > Gimp-developer@lists.XCF.Berkeley.EDU
>> > https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>> >
>> >
>>
>>
>>
>> --
>> Jon Nordby - www.jonnor.com
>> ___
>> Gimp-developer mailing list
>> Gimp-developer@lists.XCF.Berkeley.EDU
>> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>>
>
>
> ___
> Gimp-developer mailing list
> Gimp-developer@lists.XCF.Berkeley.EDU
> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>
>
I'm also facing the same problem. After translating the code using GEGL
operations, how am I supposed to create patch file of it and submit it into
the master branch.

-- 
Sourav De
2nd Year Student
Department of Computer Science and Engineering
IIT KHARAGPUR
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] gegl chanting

2011-04-04 Thread shivani maheshwari
What is the main purpose of gegl chanting??

-- 
Shivani Maheshwari
Under Graduation( BTech.)
Indian Institute of Information Technology,
Allahabad (Amethi Campus)
India
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Write basic gegl plugin

2011-04-04 Thread Madhav yadav
If i have to submit my sample on the gegl master branch then how will i go
forthh.

On Mon, Apr 4, 2011 at 8:47 PM, Jon Nordby  wrote:

> Get the code, build it on your computer, start working on the plugin.
>
> On 4 April 2011 17:02, shivani maheshwari 
> wrote:
> > Yes i did see that . But I am not able to gather where to begin from??
> >
> > On Mon, Apr 4, 2011 at 8:09 PM, Tobias Jakobs <
> tobias.jak...@googlemail.com>
> > wrote:
> >>
> >> Have you seen this page?
> >> http://wiki.gimp.org/index.php/Users:Beginner_Developer%27s_FAQ
> >>
> >> On Mon, Apr 4, 2011 at 16:32, Madhav yadav 
> >> wrote:
> >> > Hello,
> >> > I want to write basic gegl pluginCan anybody help me with the
> same..
> >> >
> >> >
> >> > ___
> >> > Gimp-developer mailing list
> >> > Gimp-developer@lists.XCF.Berkeley.EDU
> >> > https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
> >> >
> >> >
> >> ___
> >> Gimp-developer mailing list
> >> Gimp-developer@lists.XCF.Berkeley.EDU
> >> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
> >
> >
> >
> > --
> > Shivani Maheshwari
> > Under Graduation( BTech.)
> > Indian Institute of Information Technology,
> > Allahabad (Amethi Campus)
> > India
> >
> > ___
> > Gimp-developer mailing list
> > Gimp-developer@lists.XCF.Berkeley.EDU
> > https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
> >
> >
>
>
>
> --
> Jon Nordby - www.jonnor.com
> ___
> Gimp-developer mailing list
> Gimp-developer@lists.XCF.Berkeley.EDU
> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] GSoC 2011 - Replace GimpSizeEntry widget

2011-04-04 Thread Enrico Schröder
Hello Gimp developers,

I'm currently applying for the GimpSizeEntry widget for SummerOfCode. To
keep my application short and allow further discussion and feedback, I've
decided to post the detailed description of my proposal on the mailing list
instead of in the application itself. My application will contain a link to
this mail.

Regards,
Enrico

PS. this time hopefully in human-readable formatting, sorry for the first
mail.

---

Detailed description:


I will describe briefly the issues of the current implementation of the
GimpSizeEntry widget and how I suggest to address them:



Currently, the unit is selected through an external combo box. The new
GimpSizeEntry will not have that external combo box. Instead, the unit is
entered directly into the text entry. The input will then be evaluated
making use of the existing parser (gimpeevl.c) which will allow input of
simple mathematical terms and sizes in different units (for example "1024px
+ 2 in"). The result including the unit will then be displayed in the text
entry. The unit will be defined through either the entered unit or context
sensitive: When there is no unit entered, the previous unit is assumed, or
the unit of a related SizeEntry.



The second issue is size and flexibility. Being based on GtkTable, the
current solution consumes too much space and is not flexible enough. The new
GimpSizeEntry will be based on GtkEntry. It will have the necessary
interfaces to work together with other SizeEntries or elements such as
GimpChainButtons or preview labels. This allows adjusting the SizeEntry for
every use case: be it the use in the new image dialog or in the settings of
a tool, with or without a button to fix aspect ratio etc. while still having
the possibility to make it as compact as possible wherever screen space
needs to be conserved.



I even imagine the use of just a single GimpSizeEntry for input of height
and width together (in the form of “1024x768 px”). That would especially be
useful in the tool’s settings, where space needs to be conserved. For
example the Scale tool: We now have a pop-up with basically only a
GimpSizeEntry and Ok/Cancel buttons. Having just a single entry field would
allow to move that into the settings and not having to use the pop-up.
Designing the new GimpSizeEntry with that flexibility in mind would make it
easy to extend it that way. There might be not enough time in the scope of
Summer of Code, but I’d be happy to continue developing afterwards to ensure
Gimp gets the most out of the new GimpSizeEntry widget.
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] GSoC 2011 - Replace GimpSizeEntry widget

2011-04-04 Thread Enrico Schröder
Hello Gimp developers,

I'm currently applying for the GimpSizeEntry project for Summer of Code.
To keep my application short and to allow further discussion and feedback,
I decided to post the detailed description of my proposal on the mailing
list instead of in the application itself. My application will contain a
link to this mail.

Regards,
Enrico

-
Detailed description:

I will describe briefly the issues of the current implementation of the
GimpSizeEntry widget and how I suggest to address them:
 
Currently, the unit is selected through an external combo box. The
new GimpSizeEntry will not have that external combo box. Instead, the unit
is
entered directly into the text entry. The input will then be evaluated
making
use of the existing parser (gimpeevl.c) which will allow input of simple
mathematical terms and sizes in different units (for example "1024px + 2
in"). The result including the unit will then be displayed in the text
entry. The unit will be defined through either the entered unit or context
sensitive: When there is no unit entered, the previous unit is assumed, or
the
unit of a related SizeEntry.
 
The second issue is size and flexibility. Being based on GtkTable,
the current solution consumes too much space and is not flexible enough.
The
new GimpSizeEntry will be based on GtkEntry. It will have the necessary
interfaces to work together with other SizeEntries or elements such as
GimpChainButtons or preview labels. This allows adjusting the SizeEntry
for every
use case: be it the use in the new image dialog or in the settings of a
tool,
with or without a button to fix aspect ratio etc. while still being able
to make it as compact as possible wherever screen space needs to be
conserved.
 
I even imagine the use of just a single GimpSizeEntry for input of
height and width together (in the form of ³1024x768 px²). That would
especially
be useful in the tool¹s settings, where space needs to be conserved. For
example
the Scale tool: We now have a pop-up with basically only a GimpSizeEntry
and
Ok/Cancel buttons. Having just a single entry field would allow to move
that
into the settings and not having to use the pop-up. Designing the new
GimpSizeEntry with that flexibility in mind would make it easy to extend it
that way. There might not be enough time for all of that in the scope of
Summer of Code, but I¹d be happy to continue developing afterwards to
ensure Gimp gets the most out of the new GimpSizeEntry widget.


___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Write basic gegl plugin

2011-04-04 Thread Jon Nordby
Get the code, build it on your computer, start working on the plugin.

On 4 April 2011 17:02, shivani maheshwari  wrote:
> Yes i did see that . But I am not able to gather where to begin from??
>
> On Mon, Apr 4, 2011 at 8:09 PM, Tobias Jakobs 
> wrote:
>>
>> Have you seen this page?
>> http://wiki.gimp.org/index.php/Users:Beginner_Developer%27s_FAQ
>>
>> On Mon, Apr 4, 2011 at 16:32, Madhav yadav 
>> wrote:
>> > Hello,
>> > I want to write basic gegl pluginCan anybody help me with the same..
>> >
>> >
>> > ___
>> > Gimp-developer mailing list
>> > Gimp-developer@lists.XCF.Berkeley.EDU
>> > https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>> >
>> >
>> ___
>> Gimp-developer mailing list
>> Gimp-developer@lists.XCF.Berkeley.EDU
>> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>
>
>
> --
> Shivani Maheshwari
> Under Graduation( BTech.)
> Indian Institute of Information Technology,
> Allahabad (Amethi Campus)
> India
>
> ___
> Gimp-developer mailing list
> Gimp-developer@lists.XCF.Berkeley.EDU
> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>
>



-- 
Jon Nordby - www.jonnor.com
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Write basic gegl plugin

2011-04-04 Thread shivani maheshwari
Yes i did see that . But I am not able to gather where to begin from??

On Mon, Apr 4, 2011 at 8:09 PM, Tobias Jakobs
wrote:

> Have you seen this page?
> http://wiki.gimp.org/index.php/Users:Beginner_Developer%27s_FAQ
>
> On Mon, Apr 4, 2011 at 16:32, Madhav yadav 
> wrote:
> > Hello,
> > I want to write basic gegl pluginCan anybody help me with the same..
> >
> >
> > ___
> > Gimp-developer mailing list
> > Gimp-developer@lists.XCF.Berkeley.EDU
> > https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
> >
> >
> ___
> Gimp-developer mailing list
> Gimp-developer@lists.XCF.Berkeley.EDU
> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>



-- 
Shivani Maheshwari
Under Graduation( BTech.)
Indian Institute of Information Technology,
Allahabad (Amethi Campus)
India
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Write basic gegl plugin

2011-04-04 Thread Tobias Jakobs
Have you seen this page?
http://wiki.gimp.org/index.php/Users:Beginner_Developer%27s_FAQ

On Mon, Apr 4, 2011 at 16:32, Madhav yadav  wrote:
> Hello,
> I want to write basic gegl pluginCan anybody help me with the same..
>
>
> ___
> Gimp-developer mailing list
> Gimp-developer@lists.XCF.Berkeley.EDU
> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>
>
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] Write basic gegl plugin

2011-04-04 Thread Madhav yadav
Hello,

I want to write basic gegl pluginCan anybody help me with the same..
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] Problem:Submit sample implementation of gegl op.

2011-04-04 Thread shivani maheshwari
*Hello,*
*
*
*I want to ask how to submit the sample GEGL op program. *

-- 
Shivani Maheshwari
Under Graduation( BTech.)
Indian Institute of Information Technology,
Allahabad (Amethi Campus)
India
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] GEGL Editor - Idea for GSoC

2011-04-04 Thread Bogdan Szczurek
W dniu 11-04-01 23:55, Marek Rogalski pisze:
> Hello, everybody.
> I have a quite simple proposal for this year GSoC: make a nice editor
> for GEGL pipelines.
>
> Why do we need it: because the GEGL eats XML files. GIMP could eat
> them too. It would introduce much greater reusability in the work of
> designers.
>
> Who will use it: graphic designers (who else? :p). The concept of GEGL
> operations is sufficiently simple to be used even by casual users.
>
> How it could be used: GIMP could show a list of GEGL XML files that
> can be applied to current layer. Very similar to how the filters are
> exposed right now. The editor itself could be located in GIMP (I would
> like that :) ) or as a separate program.
>
> I have been generating various content on this topic for around a year
> and made a few concepts. Their code is packed at
> stud.ics.p.lodz.pl/~mafik/prototypes.tar.bz2 (contains a few interface
> ideas) (bother to look only if
> you want to deal with lots of unfinished code). I have made a sample
> here: http://www.youtube.com/watch?v=sEm9M2O6xC0 (second part shows
> much better, what I am thinking about).
>
> There are many areas where the idea could be clarified, but the
> concept should be clear.
>
> Request for comment:
> - what do you think of the whole idea? Would it be useful or not?
> - should it be merged with GIMP or work standalone (or both :) )?
> - is Vala mature enough to use it as the main language?
>(I'm asking because I saw some discussions about it recently on this list)
> - what gui toolkit would be appropiate? GTK or Clutter?
>(I fell in love with clutter, but there may be reasons not to use it
> for such program)
>
> Other ideas:
> - shebang at the beginning of the GEGL XML - drop files on the script
> and get them processed
> - automatically generate GtkBuilder XML for marked parameters of GEGL
> operations - could
> be used to display filter-like dialogs of arbitrary GEGL pipelines.
>
> PS. (note to GSoC mentors) I would like to take part in this year
> GSoC. If you encounter my submission, take it under considerations
> only under this idea (if it passes, of course).

Blender's Composite Nodes anyone? ;>

http://www.blender.org/development/release-logs/blender-242/blender-composite-nodes/

Personally I love the idea. What is more, I think that such editor could 
be developed as an external project, independent of GIMP, yet 
"pluggable" to the latter.
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Reg: GIMP GSOC 2011 project

2011-04-04 Thread Alexandre Prokoudine
On 4/4/11, ~Siddharth~ wrote:

> I am interested in working on "Seamless Cloning" project.I am familiar
> with Poisson image editing techniques.I would like you to suggest me
> on how to proceed further with this project.

The way to proceed is to pick a different project. Sorry, but with at
least five other applicants for this project, including a person who
already has experience of development for GIMP and actually proposed
this project, your chances to be accepted with seamless cloning are
considerably low.

Alexandre Prokoudine
http://libregraphicsworld.org
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] Reg: GIMP GSOC 2011 project

2011-04-04 Thread ~Siddharth~
Hi,

I am currently studying for my Bachelor of Technology and Masters
Degree in Computer Science at IIIT,Hyderabad,India. I would like to
work at GIMP because I am looking for a challenge in Digital Image
Processing/computational photography field and I think this is an
opportunity for me to consolidate the knowledge and experience gathered so far.

I am interested in working on "Seamless Cloning" project.I am familiar
with Poisson image editing techniques.I would like you to suggest me
on how to proceed further with this project.

You can look at my website for more information about me.
http://web.iiit.ac.in/~siddhartha_k/

Regards,
Siddharth Kherada
Btech + MS by Research
IIIT,Hyderabad
India
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] Porting GIMP plugins to GEGL operations - GSOC 2011

2011-04-04 Thread shivani maheshwari
Here are the other 3 files . I had to post in two different mails on account
of size exceeding the limit of mail

*Gaussian blur-*
*
*
Functions -

1.iir_young_find_constants (gfloat sigma, gdouble *B, gdouble *b) -
 Based on sigma( standard deviation of Gaussian distribution ) we calculate
the constants. If sigma == 0 then to prevent ringing at the tile boundaries
we define *B = 1 and b[0]=1,b[1]=b[2]=b[3]=0 else the value of the constants
depend upon the parameter 'q'.

2. iir_young_blur_1D (gfloat * buf,gint offset, gint delta_offset, gdouble
B, gdouble * b, gfloat *w, gint w_len)-
in the forward filter we increase the offset every time we iterate by an
amount = delta_offset till we reach the end.
 In backward filter we begin from the other extreme and every time we
iterate to the left we decrease the offset by an amount = delta_offset
 3. iir_young_hor_blur (GeglBuffer *src, const GeglRectangle
*src_rect,GeglBuffer *dst,const GeglRectangle *dst_rect, gdouble B,  gdouble
 *b) -
This is for INFINITE IMPULSE RESPONSE.Produces the horizontal blurring in
the image.It expects the source and destination to be of same height and 0 y
offset.

4. iir_young_ver_blur (GeglBuffer *src, const GeglRectangle
*src_rect,GeglBuffer *dst,const GeglRectangle *dst_rect, gdouble B,  gdouble
 *b) -
This is for INFINITE IMPULSE RESPONSE.Produces the vertical blurring in the
image.It expects the source and destination to be of same width and 0 x
offset.

5. fir_calc_convolve_matrix_length (gdouble sigma) -
calculates the length of convolution matrix depending upon the standard
deviation.

6. fir_gen_convolve_matrix (gdouble sigma, gdouble **cmatrix_p) -
produces the convolution matrix cmatrix_p which is applied to the original
image to produce gaussian blur.Each pixel's new value is set to a weighted
average of that pixel's neighborhood. The original pixel's value receives
the heaviest weight (having the highest Gaussian value) and neighboring
pixels receive smaller weights as their distance to the original pixel
increases.

7. fir_young_hor_blur (GeglBuffer *src, const GeglRectangle
*src_rect,GeglBuffer *dst,const GeglRectangle *dst_rect, gdouble B,  gdouble
 *b) -
Calculates horizontal blur for FINITE IMPULSE RESPONSE.It expects the source
and destination to be of same height and 0 y offset.

8. fir_young_ver_blur (GeglBuffer *src, const GeglRectangle
*src_rect,GeglBuffer *dst,const GeglRectangle *dst_rect, gdouble B,  gdouble
 *b) -
Calculates vertical blur for FINITE IMPULSE RESPONSE.It expects the source
and destination to be of same width and 0 x offset.

9.process (GeglOperation *operation, GeglBuffer *input,GeglBuffer *output,
const GeglRectangle *result)-

GeglOperationAreaFilter base class allows defining operations where output
data depends upon a neighbourhood with an input window that extends beyond
the output window, the information about needed extra pixels in different
directions should be set up in the prepare callback for the operation.Based
on 'iir' or 'fir' it blurifies the image first horizontally and then
 vertically with different sets of functions used for both cases.

*Extras -*
*
*
*Cartoon - *
*
*
header file - libgimp/gimp.h makes all basic plugin elements available to
us.

Structures defined-
 1. CartoonVals - holds parameters - mask_radius,threshold,pct_black
mask_radius - size of area the filter works upon
 threshold - relative intensity difference which will result in darkening
pct_black - decides the amount of black color added to the image

Local Variables -
 1. cvals - storing default values for the parameters of the structure
CartoonVals.

 2. GimpPlugInInfo PLUG_IN_INFO - Contains four pointers to different
functions which are called during plugin execution.
 a)init - optional(can have null value) and is called as GIMP starts up. It
can be called if we want to register some procedure conditionally on some
files prescence.
 b)quit - also optional( can have null value ) and is called when GIMP is
going to close.
c)query - called when the plugin comes into existence or every time when it
is modified.
 d)run - it is the plugin processing function which receives the plugin
name, input parameters, number of return values, pointer to output
parameters.


MAIN() - it is a macro defined for calling the initialisation and calling
appropriate functions that our plugin needs during its life time.

Functions -

1. query() - defines the input arguments
 Structure GimpParamDef contains - type, name and description.
 It registers the function in the path specified as here under
"/Filters/Artistic"


2. cartoon_dialog (GimpDrawable *drawable) -
 opens a dialog box for the user for specifying the basic input parameters.
This also function holds the basic layout informaion for the dialog box. It
clearly mentions the existence of two scale bars ( mask radius, percent
black ), preview window and ok button. User can change the value of
parameters and have a preview for every changed argument.The widget does not
g

[Gimp-developer] Porting GIMP plugins to GEGL operations - GSOC 2011

2011-04-04 Thread shivani maheshwari
Hello sir,

I am Shivani 2nd year student at IIIT-Allahabad( Indian Institute Of
Information Technology, Allahabad ). I have a programming experience with C,
C++,QT and Java. Besides this I have also worked with OpenGl(glut/glu). I
have Graphics Visualization and Computing as one of the core subject of this
semester. Studying the plugins I find it very similar to using a combination
of QT and opengl.
I am very eagerly interested in Image Manipulations and designing and I
would like to contribute to porting the plugins to GEGL operations.Currently
I am working on designing an UCI chess engine ( coding in C++ ) and making a
virtual tour of my college campus by opengl.Both of the projects will be
complete by the end of April.

Here is the code review and algorithm for the major files specified as a
test ( please correct me if I am wrong ) -

*Cubism *-

header file - libgimp/gimp.h makes all basic plugin elements available to
us.

Structures defined-
 1. Polygon - containing detail for polygon construction

 2. CubismVals - holds details for generation of tiles such as -tile
saturation , tile size, background color and bool preview.
background color - if no bg color specified then black is used while
applying the filter.
 tile size - determines size( in pixels ) of the square to be used.
tile saturation- determines the intensity of the color of the squares
thereby defining the opacity of square.

Local Variables -
 1. cvals - storing default values for the parameters of the structure
CubismVals.

 2. GimpPlugInInfo PLUG_IN_INFO - Contains four pointers to different
functions which are called during plugin execution.
 a)init - optional(can have null value) and is called as GIMP starts up. It
can be called if we want to register some procedure conditionally on some
files prescence.
 b)quit - also optional( can have null value ) and is called when GIMP is
going to close.
c)query - called when the plugin comes into existence or every time when it
is modified.
 d)run - it is the plugin processing function which receives the plugin
name, input parameters, number of return values, pointer to output
parameters.


MAIN() - it is a macro defined for calling the initialisation and calling
appropriate functions that our plugin needs during its life time.

Functions -

1. query() - defines the input arguments
 Structure GimpParamDef contains - type, name and description.
 It registers the function in the path specified as here under
"/Filters/Artistic"


2. cubism_dialog (GimpDrawable *drawable) -
 opens a dialog box for the user for specifying the basic input parameters.
This also function holds the basic layout informaion for the dialog box. It
clearly mentions the existence of two scale bars ( tile saturation,tile size
), preview window, toggle button( use background color ) and ok button. User
can change the value of parameters and have a preview for every changed
argument.The widget does not gets destroyed until the ok button( signal -
GTK_RESPONSE_OK ) or cancel button is pressed and the final parameters are
then saved.


3. cubism (GimpDrawable *drawable,GimpPreview  *preview) -

Every variable of the GimpDrawable struct has a drawable id, width,
height,bytes per pixel,number of tile rows, number of tile columns, normal
tiles and shadow tiles. Here we check if the drawable has an alpha channel
associated with it. Alpha channel can be there with the layer types such as
RGB, GRAYSCALE and it defines the amount of opacity of the layer.

Here in this function it checks whether cubism effect has to be applied in
the preview window or on the main image and accordingly performs the task.
 For preview window -
It gets the preview window position and the preview area width, preview area
height sets the bound and allocates 'sel_height * sel_width * bytes' memory
locations of type guchar all initialised to 0 and pointed by dest.

If not preview - then directly set bounds based on drawable->id

Now we determine the background color. If it is set as default 'Black' then
we initialise the bg_col array with 0, otherwise we get the background color
and set the bg_col array with it. Then we calculate the number of rows and
columns based on tile_size.

It fills the image based on the background color.

If it is for preview then it directly assigns each destination byte with the
color in bg_color.
 Otherwise - While creating the cubistic transformation it displays the
progress bar having a label - 'Cubistic Transformation' . It now loops
through every pixel and initialises the background color to the colour of
the original image.Now based on the number of rows and columns it calculates
the number of tiles. Initialise a pixel region pointed by src_rgn ,new
region being attached to drawable region, (x1,y1) as initial coordinates,
width as (x2-x1)and height as (y2-y1).Based on tile size and random indices
it calculates the random starting points( x, y ), then random width and
height and random angle( theta ). It initialises a polygon, t