[haiku-development] Re: bitmap scaling options

Ingo Weinhold wrote:
> 
> On 2008-07-28 at 16:38:28 [+0200], Stephan Assmus <superstippi@xxxxxx> 
> wrote:
> > 
> > Rene Gollent wrote:
> > > On Mon, Jul 28, 2008 at 8:29 AM, Stephan Assmus <superstippi@xxxxxx> 
> > > wrote:
> > > > Yet another possibility would be to add this to the BView flags. 
> > > > There is already B_SUBPIXEL_PRECISE which also influences the 
> > > > drawing.
> > > >
> > > > Just now I am thinking one could of course reserve the upper 16 
> > > > bits or so of the bitmap flags for rendering options, while the 
> > > > lower 16 bits are creation options. Then a method could be added to 
> > > > change just the rendering options, which would make it clear that 
> > > > creation options can not be changed later. That idea may need the 
> > > > fewest adjustments to other code.
> > > >
> > > 
> > > I think one of the major questions I'd have with respect to what API 
> > > approach to choose is if you want to be able to enable/disable this 
> > > without permanently affecting the contents of the bitmap itself, i.e. 
> > > do you want the filtering to happen at draw time, or should the 
> > > actual bits themselves be affected in the bitmap's storage. If you 
> > > want on the fly then I'd say probably the extra method to change the 
> > > render mode would be the way to go myself.
> > 
> > I would like this to be a render option only. The scaling of the bitmap 
> > affects the memory storage. The easiest way would be to create a bitmap 
> > of the desired size which also accepts views, then one could render the 
> > original bitmap into the new bitmap. Other options are an actual 
> > Resize() method or copy constructors which take another bitmap size.
> > 
> > I have started to implement the BBitmap::SetDrawingFlags() approach and 
> > I think this may be the best way to go about it.
> 
> Since it is a rendering option, IMHO it should be (in decreasing order of 
> preference) a parameter to BView::DrawBitmap(), a graphics state option, 
> or a BView flag. Sticking such an option to the BBitmap is just as badly 
> fitting as setting the color on a BFont.

Ok, makes sense. Thanks for the input.

Best regards,
-Stephan

Other related posts: