char **getDotMatrix(bitmapType *bmp)
{
char **matrix;
char *msg;
int x=0, y=0,i=0,j=0, bytesPerCol = bmp->bitsPerPixel/8;
msg=(char*)malloc(255);
memset(msg,'\0',255);
matrix = (char **)malloc(bmp->width*bytesPerCol);
if(matrix != NULL)
{
// memset(matrix, '\0', sizeof(matrix));
for(x=0;x < (bmp->width*bytesPerCol);x++)
{
matrix[x] = (char *)malloc(bmp->height);
if(matrix[x]!=NULL)
{
//memset(matrix[x], '\0', bmp->height);
if((x+1)%964==0)
x=x;
}
else
{
strcpy(msg,"Error al asignar memoria a la matrix[x]: ");
allegro_message(msg);
}
}
/*for(y=0;y<bmp->height;y++)
{
for(x=0;x<bmp->width*bytesPerCol;x++)
{
for(j=2;j>=0;j++)
{
matrix[x][y] = bmp->bmpData[i+j];
x++;
}
x--;
i+=bytesPerCol;
}
}*/
}
else
{
strcpy(msg,"Error al asignar memoria a la matrix: ");
allegro_message(msg);
}
return matrix;
}