Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/Bitmap-Histogram/C/bitmap-histogram-2.c
Normal file
20
Task/Bitmap-Histogram/C/bitmap-histogram-2.c
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
histogram get_histogram(grayimage im)
|
||||
{
|
||||
histogram t;
|
||||
unsigned int x, y;
|
||||
|
||||
if ( im == NULL ) return NULL;
|
||||
t = malloc( sizeof(histogram_t)*256 );
|
||||
memset(t, 0, sizeof(histogram_t)*256 );
|
||||
if (t!=NULL)
|
||||
{
|
||||
for(x=0; x < im->width; x++ )
|
||||
{
|
||||
for(y=0; y < im->height; y++ )
|
||||
{
|
||||
t[ GET_LUM(im, x, y) ]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue