|
From: snailCoder <sac...@sa...> - 2005-11-23 13:46:16
|
Ken Resander <resander <at> speed.info.com.ph> writes:
>
> Maxim, many thanks,
>
> I have replaced
>
> agg::path_storage path; // partner rectangle
> path.move_to( x,y);
> path.line_to( x+imgwd, y );
> pathmline_to( x+imgwd, y+imght);
> path.line_to( x, y+imght);
> path.close_polygon();
> agg::conv_transform<agg::path_storage> tr(path, src_mtx);
> pf.add_path(tr);
> agg::render_scanlines(pf, sl, ri);
>
> at the and of my image proc (code of the whole proc is at
> the end of my original post (and at the end of this email))
>
> by
>
> double para [ 6 ]
> = { 0,100 , 0,0 , 100.0 } ; // 3 points (0,100) (0,0) and (100,0)
> agg::trans_affine tr(para, 0, 0, imgwd, imght);
> pf.add_path(tr);
> agg::render_scanlines(pf, sl, ri);
>
> Q1. is this the right way?
>
> Q2. what should the para points be expressed as functions of
> image top-left hand corner, image width and image height, i.e.
> x,y, imgwd, imght?
>
> My test cases includes image (x,y)=(0,0), so I defined para points
> (0,100), (0,0) and (100,0) just to see what would happen.
>
> but got compilation errors:
>
> ..\agg23\include\agg_rasterizer_scanline_aa.h(465) : error C2039: 'rewind' :
> is not a member of 'trans_affine'
> ..\agg23\include\agg_trans_affine.h(88) : see declaration of
> 'trans_affine'
>
> and one more very similar: 'vertex' : is not a member of 'trans_affine'
>
> What might be the problem?
>
> Best regards
> Ken
>
Hi Ken,
You are adding a agg::trans_affine to the rasteriser!!
Try:
double para [ 6 ] = { 0, 100 ,0, 0, 100 ,0 } ;
agg::trans_affine src_mtx(para, 0, 0, imgwd, imght);
agg::path_storage path; // partner rectangle
path.move_to( x,y);
path.line_to( x+imgwd, y );
pathmline_to( x+imgwd, y+imght);
path.line_to( x, y+imght);
path.close_polygon();
agg::conv_transform<agg::path_storage> tr(path, src_mtx);
pf.add_path(tr);
agg::render_scanlines(pf, sl, ri);
However , I am also trying to figure out how I could put the image at any (x,y),
angle and scaling. I am able to get only images at (0,100) to work :(
-snailCoder
|