[haiku-development] Re: bitmap scaling options

  • From: Stephan Assmus <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 28 Jul 2008 16:38:28 +0200

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.

Best regards,
-Stephan

Other related posts: