[gegl] operations/transform: initialize samplers with space
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] operations/transform: initialize samplers with space
- Date: Wed, 4 Jul 2018 20:46:09 +0000 (UTC)
commit b39d25f6e71854fc8c4b0cd9f5470c5f09bddc41
Author: Øyvind Kolås <pippin gimp org>
Date: Wed Jul 4 22:45:28 2018 +0200
operations/transform: initialize samplers with space
operations/transform/transform-core.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index 0b8b0e5e5..fe448c782 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -942,6 +942,7 @@ gegl_transform_get_invalidated_by_change (GeglOperation *op,
const gchar *input_pad,
const GeglRectangle *input_region)
{
+ const Babl *space = babl_format_get_space (gegl_operation_get_format (op, "output"));
OpTransform *transform = OP_TRANSFORM (op);
GeglMatrix3 matrix;
GeglRectangle affected_rect = {};
@@ -997,7 +998,7 @@ gegl_transform_get_invalidated_by_change (GeglOperation *op,
return region;
sampler = gegl_buffer_sampler_new_at_level (NULL,
- babl_format("RaGaBaA float"),
+ babl_format_with_space ("RaGaBaA float", space),
transform->sampler,
0); // XXX: need level?
context_rect = *gegl_sampler_get_context_rect (sampler);
@@ -1112,15 +1113,16 @@ transform_affine (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
+ const Babl *space = gegl_operation_get_source_space (operation, "input");
gint factor = 1 << level;
OpTransform *transform = (OpTransform *) operation;
- const Babl *format = babl_format ("RaGaBaA float");
+ const Babl *format = babl_format_with_space ("RaGaBaA float", space);
GeglMatrix3 inverse;
gdouble inverse_near_z = 1.0 / transform->near_z;
GeglMatrix2 inverse_jacobian;
GeglAbyssPolicy abyss_policy = gegl_transform_get_abyss_policy (transform);
GeglSampler *sampler = gegl_buffer_sampler_new_at_level (src,
- babl_format("RaGaBaA float"),
+ format,
level?GEGL_SAMPLER_NEAREST:transform->sampler,
level);
@@ -1267,15 +1269,15 @@ transform_generic (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
+ const Babl *space = gegl_operation_get_source_space (operation, "input");
OpTransform *transform = (OpTransform *) operation;
- const Babl *format = babl_format ("RaGaBaA float");
+ const Babl *format = babl_format_with_space ("RaGaBaA float", space);
gint factor = 1 << level;
GeglBufferIterator *i;
GeglMatrix3 inverse;
gdouble inverse_near_z = 1.0 / transform->near_z;
GeglAbyssPolicy abyss_policy = gegl_transform_get_abyss_policy (transform);
- GeglSampler *sampler = gegl_buffer_sampler_new_at_level (src,
- babl_format("RaGaBaA float"),
+ GeglSampler *sampler = gegl_buffer_sampler_new_at_level (src, format,
level?GEGL_SAMPLER_NEAREST:
transform->sampler,
level);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]