Re: coding style question

2002-02-25 Thread Angus Leeming
On Monday 25 February 2002 3:48 pm, Dekel Tsur wrote: > Don't try to code it your self. Just grab the code from some GPL project. Two reasons not to: 1. "simple" cropping, rotation, scaling is easy and "simple" is enough for GImageXPM which is just a proof of concept image loader. The real image

Re: coding style question

2002-02-25 Thread Dekel Tsur
On Mon, Feb 25, 2002 at 01:49:35PM +, Angus Leeming wrote: > > The principle behind scaling is simple: It's raytracing. > > > > So, for each destination pixel, calculate which pixel it corresponds > > to in the source picture. > > Ok, the idea is easy enough. The devil, as they say, is in th

Re: coding style question

2002-02-25 Thread Angus Leeming
On Monday 25 February 2002 1:49 pm, Lars Gullik Bjønnes wrote: > Angus Leeming <[EMAIL PROTECTED]> writes: > > | On Monday 25 February 2002 11:22 am, Lars Gullik Bjønnes wrote: > >> Angus Leeming <[EMAIL PROTECTED]> writes: > >> | My question. Should I use c or c++ style casts with malloc. This:

Re: coding style question

2002-02-25 Thread Angus Leeming
On Monday 25 February 2002 1:36 pm, Asger K. Alstrup Nielsen wrote: > On Mon, 25 Feb 2002, Angus Leeming wrote: > > > void GImageXPM::scale(GParams const & params) > > { > > if (!xpm_image_) > > return; > > > > } > > The principle behind scaling is simple: It's raytracing. > > S

Re: coding style question

2002-02-25 Thread Asger K. Alstrup Nielsen
On Mon, 25 Feb 2002, Angus Leeming wrote: > void GImageXPM::scale(GParams const & params) > { > if (!xpm_image_) > return; > > } The principle behind scaling is simple: It's raytracing. So, for each destination pixel, calculate which pixel it corresponds to in the source pic

Re: coding style question

2002-02-25 Thread Angus Leeming
On Monday 25 February 2002 11:22 am, Lars Gullik Bjønnes wrote: > Angus Leeming <[EMAIL PROTECTED]> writes: > | My question. Should I use c or c++ style casts with malloc. This: > the C++ variant. Done > Would be nice if you coult wrap the use of malloc and XpmFreeXpmImage > in a RAII object.

coding style question

2002-02-25 Thread Angus Leeming
When rotating the image I sometimes have to add a color "none" to the XpmImage color table. Since this struct is controlled by libXPM, I use malloc rather than new, so that XpmFreeXpmImage(XpmImage *) works correctly. My question. Should I use c or c++ style casts with malloc. This: new_xpm->c