openMSX
Public Member Functions | List of all members
openmsx::Scanline< Pixel > Class Template Reference

Helper class to draw scanlines. More...

#include <Scanline.hh>

Public Member Functions

 Scanline (const PixelOperations< Pixel > &pixelOps)
 
void draw (std::span< const Pixel > src1, std::span< const Pixel > src2, std::span< Pixel > dst, unsigned factor)
 Draws a scanline. More...
 
Pixel darken (Pixel p, unsigned factor) const
 Darken one pixel. More...
 
Pixel darken (Pixel p1, Pixel p2, unsigned factor) const
 Darken and blend two pixels. More...
 

Detailed Description

template<std::unsigned_integral Pixel>
class openmsx::Scanline< Pixel >

Helper class to draw scanlines.

Definition at line 45 of file Scanline.hh.

Constructor & Destructor Documentation

◆ Scanline()

template<std::unsigned_integral Pixel>
openmsx::Scanline< Pixel >::Scanline ( const PixelOperations< Pixel > &  pixelOps)
explicit

Definition at line 183 of file Scanline.cc.

Member Function Documentation

◆ darken() [1/2]

template<std::unsigned_integral Pixel>
Pixel openmsx::Scanline< Pixel >::darken ( Pixel  p,
unsigned  factor 
) const

Darken one pixel.

Typically used to implement drawBlank().

Definition at line 211 of file Scanline.cc.

◆ darken() [2/2]

template<std::unsigned_integral Pixel>
Pixel openmsx::Scanline< Pixel >::darken ( Pixel  p1,
Pixel  p2,
unsigned  factor 
) const

Darken and blend two pixels.

Definition at line 217 of file Scanline.cc.

◆ draw()

template<std::unsigned_integral Pixel>
void openmsx::Scanline< Pixel >::draw ( std::span< const Pixel src1,
std::span< const Pixel src2,
std::span< Pixel dst,
unsigned  factor 
)

Draws a scanline.

The scanline will be the average of the two input lines and darkened by a certain factor.

Parameters
src1First input line.
src2Second input line.
dstOutput line.
factorDarkness factor, 0 means completely black, 255 means no darkening.

Definition at line 190 of file Scanline.cc.

References utf8::unchecked::size(), and xrange().


The documentation for this class was generated from the following files: