void at_bitmap_get_color (const at_bitmap * bitmap, unsigned int row, unsigned int col, at_color * color) { unsigned char *p; g_return_if_fail (color); g_return_if_fail (bitmap); p = AT_BITMAP_PIXEL (bitmap, row, col); if (at_bitmap_get_planes (bitmap) >= 3) at_color_set(color, p[0], p[1], p[2]); else at_color_set(color, p[0], p[0], p[0]); }
at_bitmap_type * at_bitmap_copy(at_bitmap_type * src) { at_bitmap_type * dist; unsigned short width, height, planes; width = at_bitmap_get_width(src); height = at_bitmap_get_height(src); planes = at_bitmap_get_planes(src); dist = at_bitmap_new(width, height, planes); memcpy(dist->bitmap, src->bitmap, width * height * planes * sizeof(unsigned char)); return dist; }