Use of Static Arrays in Nohalo Level 2

ForumsFor GEGL developers (read-only) ► Use of Static Arrays in Nohalo Level 2

Sent: 2009-07-01 22:19:51 UTC (over 2 years ago)

From: Adam Turcotte

Use of Static Arrays in Nohalo Level 2

I will be implementing Nohalo Level 2 for GEGL. This basically
involves computing double-density pixel data (with a specialized
version of Nohalo Level 1 minus the finishing bilinear) and then
running a slightly modified version of Nohalo Level 1. The simplest
way of implementing this is by having a small "persistent" array or
buffer storing double-density pixel data locally so that the required
values from Level 1 are not recomputed over and over.

I originally thought that I could simply use GeglBuffers for this
purpose, but the GeglBuffer code seems fairly complicated. Instead, I
believe that small static arrays could be a better choice. For
example, a 64x64 double-density data array can be computed with the
buffer data corresponding to a context_rect/fetch_rectangle of size
35x35. When the currently stored static array does not contain the
Level 1 data needed to compute the Level 2 value at the current
location, it would simply be recomputed, much like they are in
gegl_sampler_get_ptr (in gegl-sampler.c).

Does anyone have a more elegant solution? Any objection to the use of
static arrays for this purpose?

Adam Turcotte

_______________________________________________
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer

Sent: 2009-07-02 02:28:33 UTC (over 2 years ago)

From: Øyvind Kolås

Use of Static Arrays in Nohalo Level 2

On Wed, Jul 1, 2009 at 9:19 PM, Adam Turcotte wrote:
> I will be implementing Nohalo Level 2 for GEGL. This basically
> involves computing double-density pixel data (with a specialized
> version of Nohalo Level 1 minus the finishing bilinear) and then
> running a slightly modified version of Nohalo Level 1. The simplest
> way of implementing this is by having a small "persistent" array or
> buffer storing double-density pixel data locally so that the required
> values from Level 1 are not recomputed over and over.
>
> I originally thought that I could simply use GeglBuffers for this
> purpose, but the GeglBuffer code seems fairly complicated. Instead, I
> believe that small static arrays could be a better choice. For
> example, a 64x64 double-density data array can be computed with the
> buffer data corresponding to a context_rect/fetch_rectangle of size
> 35x35. When the currently stored static array does not contain the
> Level 1 data needed to compute the Level 2 value at the current
> location, it would simply be recomputed, much like they are in
> gegl_sampler_get_ptr (in gegl-sampler.c).

It sounds like a reasonable approach it might be better if this buffer
is allocated on the heap and allocated/freed by the sampler.

/Øyvind K.

--
«The future is already here. It's just not very evenly distributed»
-- William Gibson
http://pippin.gimp.org/ http://ffii.org/
_______________________________________________
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer

Welcome!


Lost password?

Not a member? Sign up!

Random tutorials | Latest tutorials

  1. Cool glowing text Cool glowing text 40
  2. Creating 3D icons Creating 3D icons 35
  3. Create an amazing electricity effect on any object! Create an amazing electricity effect on any object! 6
  4. Create the Dragan effect Create the Dragan effect 2

Latest comments

But I just have 1 more prob (bear with me) I am really having troub... (2 days ago in [AVATAR] Become a real Na'Vi using GIMP!)

I got it to work :) I had to close the image and restart it. I thin... (2 days ago in Create cool rifts with translucent lights!)

there was a second and 3rd release of 2.6.12. we included the lates... (2 days ago in Last stable 2.6 release: 2.6.12 has arrived)

Poll

Is GIMP an adequate application for you to create printed graphics like flyers, advertisments etc?

View results

Latest forum activities

Your Ad Here

facts & numbers

gimpusers.com RSS feed

48 identi.ca followers
750 Twitter followers

powered by bitfire it services