Skip to main content
Known Participant
September 4, 2018
Question

Sampling quality with subpixel_sample()

  • September 4, 2018
  • 0 replies
  • 231 views

Hi,

I am applying a perspective warp on a layer and I can't sample source image with good quality. Indeed, it seems like my code doesn't take into account the layer quality setting. This is what I (roughly) do:

SmartRender(...){

...

// info is PreRendering data.

info->samp_pb.src   = input_worldP;

ERR(suites.Iterate8Suite1()->iterate_origin_non_clip_src(  in_data,

                                                            0,

                                                            output_worldP->height,

                                                            input_worldP,

                                                            &output_worldP->extent_hint,

                                                            &origin,

                                                            (void*)(info),

                                                            myRenderFunction,

                                                            output_worldP));

}

myRenderFunction(...){

// Compute source point by back projecting destination point.

srcPt = MyTransform(dstPt);

in_data->utils->subpixel_sample (info->in_data->effect_ref,

               FLOAT2FIX(srcPt.x) ,

               FLOAT2FIX(srcPt.y),

               &info->samp_pb,

               out)

}

At rendering time I see jagged lines typical of nearest neighbour sampling. I must be missing something because I can't see how the sampling function gets the quality info (neither Samp_pb nor effect_ref carry that info).

I tried to use transform_world(..) but it doesn't seem to handle perspective transform (it accepts 3x3 matrices but it doesn't project).

Thank you.

This topic has been closed for replies.