//------------------------------------------------------------------------------ void Canvas::StretchMono(int dest_x, int dest_y, unsigned dest_width, unsigned dest_height, const Bitmap &src, int src_x, int src_y, unsigned src_width, unsigned src_height, Color fg_color, Color bg_color) { #if 0 assert(IsDefined()); assert(dest_width < 0x4000); assert(dest_height < 0x4000); if (dest_width >= 0x4000 || dest_height >= 0x4000) /* paranoid sanity check; shouldn't ever happen */ return; SDLRasterCanvas canvas(buffer); OpaqueTextPixelOperations<ActivePixelTraits, GreyscalePixelTraits> opaque(canvas.Import(fg_color), canvas.Import(bg_color)); canvas.ScaleRectangle<decltype(opaque), GreyscalePixelTraits> (dest_x, dest_y, dest_width, dest_height, src.At(src_x, src_y), src.pitch, src_width, src_height, opaque); #endif }
//------------------------------------------------------------------------------ void Canvas::StretchNot(const Bitmap &src) { #if 0 assert(_src.IsDefined()); ConstImageBuffer src = _src.GetNative(); const unsigned src_x = 0, src_y = 0; const unsigned dest_x = 0, dest_y = 0; const unsigned dest_width = GetWidth(); const unsigned dest_height = GetHeight(); SDLRasterCanvas canvas(buffer); BitNotPixelOperations<ActivePixelTraits> operations; canvas.ScaleRectangle(dest_x, dest_y, dest_width, dest_height, src.At(src_x, src_y), src.pitch, src.width, src.height, operations); #endif }