Re: alignment of pixels with coordinates

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

 



Hello Martin:

Martin Nordholts writes:
 > ...
 > Is it a lot of work to change convention in a resampler afterwards? 
 > Would it be possible to parameterize this so you could even toggle 
 > pixel-center convention during runtime?

I actually came to more or less the same conclusion.

To summarize: Ideally, when downsampling, one should use the pixel
coordinate convention usually associated with area sampling (e.g.,
corner-based coordinates).  When upsampling, the usual point sampling
convention (center-based coordinates). In addition, the conventions
should ideally be consistent between the operation which calls the
sampler (e.g., scaling operation, or rotation operation, or warping
operation) and the sampler itself (it is possible to mix and match
without large ill effects but it is preferable to be consistent).

What this suggests to me is one of the following two possibilities:

Option 1: Samplers, and the operations which call samplers, have a
toggle which specifies which convention to use. Given that the amount
of different code in the two cases is very small, this would seem to
me to be the best solution.

Option 2: Alternately, there could be two versions of the relevant
routines (which, obviously, would have mostly identical code), one for
each convention. Then, the convention would be determined by which
version of scale (say) is called.

Option 3: I am wondering whether there is machinery already in gegl. I
haven't figured out what 

/gegl/gegl/operation/gegl-operation-point-filter.c

and

/gegl/gegl/operation/gegl-operation-area-filter.c

do, but maybe they have to do with a way of toggling the desired
coordinate/bounding box behavior in operations?

----------------------------------------------------------------------

Eric and/or Adam:

In the grand scheme of things, can you figure out what

/gegl/gegl/operation/gegl-operation-point-filter.c

and

/gegl/gegl/operation/gegl-operation-area-filter.c

do?

Can you email me pointers to the code that actually does scaling,
rotating, and similar warping (I am pretty sure perspective is not
implemented in gegl)? That is, can you email me a list of the code
which calls the samplers, and start figuring out how they work?
Especially, what kind of image convention they use (answer this last
questionmay be easier for Adam than for Eric)?

Be aware that my c++ (as opposed to my c) is quite weak. I need
hand-holding here.

Thanks,

Nicolas Robidoux
Universite Laurentienne




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

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

  Powered by Linux