Back to index

lightning-sunbird  0.9+nobinonly
imgScaler.h File Reference
#include "gfxCore.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


 RectStretch (unsigned aSrcWidth, unsigned aSrcHeight, unsigned aDstWidth, unsigned aDstHeight, unsigned aStartColumn, unsigned aStartRow, unsigned aEndColumn, unsigned aEndRowe, unsigned char *aSrcImage, unsigned aSrcStride, unsigned char *aDstImage, unsigned aDstStride, unsigned aDepth)

Function Documentation

RectStretch ( unsigned  aSrcWidth,
unsigned  aSrcHeight,
unsigned  aDstWidth,
unsigned  aDstHeight,
unsigned  aStartColumn,
unsigned  aStartRow,
unsigned  aEndColumn,
unsigned  aEndRowe,
unsigned char *  aSrcImage,
unsigned  aSrcStride,
unsigned char *  aDstImage,
unsigned  aDstStride,
unsigned  aDepth 

Definition at line 105 of file imgScaler.cpp.

    int e;
    unsigned dx, dy;
    void (*Stretch)(unsigned x1, unsigned x2, unsigned y1, unsigned y2,
                  unsigned yr, unsigned yw,
                  unsigned aStartRow, unsigned aStartColumn,
                  unsigned aEndColumn,
                  unsigned char *aSrcImage, unsigned aSrcStride,
                  unsigned char *aDstImage, unsigned aDstStride);

    unsigned xs1, ys1, xs2, ys2, xd1, yd1, xd2, yd2;

    xs1 = ys1 = xd1 = yd1 = 0;
    xs2 = aSrcWidth  - 1;
    ys2 = aSrcHeight - 1;
    xd2 = aDstWidth  - 1;
    yd2 = aDstHeight - 1;

//    fprintf(stderr, "RS (%d %d)-(%d %d) (%d %d)-(%d %d) %d %d %d\n",
//         xs1, ys1, xs2, ys2, xd1, yd1, xd2, yd2,
//         aSrcStride, aDstStride, aDepth);

    switch (aDepth) {
    case 32:
       Stretch = Stretch32;
    case 24:
       Stretch = Stretch24;
    case 8:
       Stretch = Stretch8;
    case 1:
       Stretch = Stretch1;
    dx = yd2 - yd1;
    dy = ys2 - ys1;
    e = dy - dx;
    dy += 1;
    if (!dx)
       dx = 1;
    for (yd1 = 0; yd1 <= aEndRow; yd1++) {
       if (yd1 >= aStartRow)
           Stretch(xd1, xd2, xs1, xs2, ys1, yd1,
                  aStartRow, aStartColumn, aEndColumn,
                  aSrcImage, aSrcStride, aDstImage, aDstStride);
       while (e >= 0) {
           e -= dx;
       e += dy;

Here is the call graph for this function:

Here is the caller graph for this function: