fixed segfault

git-svn-id: http://tint2.googlecode.com/svn/trunk@168 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
lorthiois@bbsoft.fr
2009-09-01 15:56:52 +00:00
parent a62548bf29
commit a17b62f76f
6 changed files with 32 additions and 25 deletions

View File

@@ -30,20 +30,19 @@
void adjust_hsb(unsigned int *data, int w, int h, float hu, float satur, float bright)
void adjust_hsb(DATA32 *data, int w, int h, float hu, float satur, float bright)
{
unsigned int *pt = data;
int x, y;
unsigned int x, y;
unsigned int a, r, g, b, argb;
unsigned long id;
int cmax, cmin;
float h2, f, p, q, t;
float hue, saturation, brightness;
float redc, greenc, bluec;
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
argb = pt[y * h + x];
for(id = y * w, x = 0; x < w; x++, id++) {
argb = data[id];
a = (argb >> 24) & 0xff;
r = (argb >> 16) & 0xff;
g = (argb >> 8) & 0xff;
@@ -134,7 +133,7 @@ void adjust_hsb(unsigned int *data, int w, int h, float hu, float satur, float b
argb = (argb << 8) + r;
argb = (argb << 8) + g;
argb = (argb << 8) + b;
pt[y * h + x] = argb;
data[id] = argb;
}
}
}