Subversion Repositories freemyipod

Rev

Rev 498 | Rev 509 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 498 Rev 504
Line 103... Line 103...
103
        }
103
        }
104
        in += (instride - width) * 4;
104
        in += (instride - width) * 4;
105
        out += (outstride - width) * 3;
105
        out += (outstride - width) * 3;
106
    }
106
    }
107
}
107
}
-
 
108
 
-
 
109
void blit(int width, int height, int pixelbytes,
-
 
110
          void* outbuf, int outx, int outy, int outstride,
-
 
111
          void* inbuf, int inx, int iny, int instride)
-
 
112
{
-
 
113
    int i;
-
 
114
    char* in = (char*)inbuf + (inx + iny * instride) * pixelbytes;
-
 
115
    char* out = (char*)outbuf + (outx + outy * outstride) * pixelbytes;
-
 
116
    int rowsize = width * pixelbytes;
-
 
117
    while (height--)
-
 
118
    {
-
 
119
        memcpy(out, in, rowsize);
-
 
120
        in += (instride - width) * pixelbytes;
-
 
121
        out += (outstride - width) * pixelbytes;
-
 
122
    }
-
 
123
}
-
 
124
 
-
 
125
void fill(int width, int height, uint32_t color,
-
 
126
          void* buf, int outx, int outy, int stride)
-
 
127
{
-
 
128
    char* out = (char*)buf + (outx + outy * stride) * 3;
-
 
129
    int r = (color >> 0) & 0xff;
-
 
130
    int g = (color >> 8) & 0xff;
-
 
131
    int b = (color >> 16) & 0xff;
-
 
132
    int x, y;
-
 
133
    for (y = 0; y < height; y++)
-
 
134
    {
-
 
135
        for (x = 0; x < width; x++)
-
 
136
        {
-
 
137
            *out++ = r;
-
 
138
            *out++ = g;
-
 
139
            *out++ = b;
-
 
140
        }
-
 
141
        out += (stride - width) * 3;
-
 
142
    }
-
 
143
}