DGen/SDL
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
scalebit.h File Reference

Go to the source code of this file.

Functions

int scale_precondition (unsigned scale, unsigned pixel, unsigned width, unsigned height)
 Check if the scale implementation is applicable at the given arguments.
void scale (unsigned scale, void *void_dst, unsigned dst_slice, const void *void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height)
 Apply the Scale effect on a bitmap.

Function Documentation

void scale ( unsigned  scale,
void *  void_dst,
unsigned  dst_slice,
const void *  void_src,
unsigned  src_slice,
unsigned  pixel,
unsigned  width,
unsigned  height 
)

Apply the Scale effect on a bitmap.

This function is simply a common interface for scale2x(), scale3x() and scale4x().

Parameters:
scaleScale factor. 2, 203 (fox 2x3), 204 (for 2x4), 3 or 4.
void_dstPointer at the first pixel of the destination bitmap.
dst_sliceSize in bytes of a destination bitmap row.
void_srcPointer at the first pixel of the source bitmap.
src_sliceSize in bytes of a source bitmap row.
pixelBytes per pixel of the source and destination bitmap.
widthHorizontal size in pixels of the source bitmap.
heightVertical size in pixels of the source bitmap.
int scale_precondition ( unsigned  scale,
unsigned  pixel,
unsigned  width,
unsigned  height 
)

Check if the scale implementation is applicable at the given arguments.

Parameters:
scaleScale factor. 2, 203 (fox 2x3), 204 (for 2x4), 3 or 4.
pixelBytes per pixel of the source and destination bitmap.
widthHorizontal size in pixels of the source bitmap.
heightVertical size in pixels of the source bitmap.
Returns:
  • -1 on precondition violated.
  • 0 on success.