Lines Matching refs:image
36 static void* getPixelAddress (const deImage* image, int x, int y) in getPixelAddress() argument
38 int offset = ((y*image->width) + x) * deImageFormat_getBytesPerPixel(image->format); in getPixelAddress()
39 DE_ASSERT(deInBounds32(x, 0, image->width)); in getPixelAddress()
40 DE_ASSERT(deInBounds32(y, 0, image->height)); in getPixelAddress()
41 return (void*)((deUint8*)image->pixels + offset); in getPixelAddress()
46 deImage* image = DE_NEW(deImage); in deImage_create() local
48 if (!image) in deImage_create()
51 image->width = width; in deImage_create()
52 image->height = height; in deImage_create()
53 image->format = format; in deImage_create()
54 image->pixels = deMalloc(width * height * bpp); in deImage_create()
55 if (!image->pixels) in deImage_create()
57 deFree(image); in deImage_create()
60 memset(image->pixels, 0, width * height * bpp); in deImage_create()
62 return image; in deImage_create()
65 void deImage_destroy (deImage* image) in deImage_destroy() argument
67 deFree(image->pixels); in deImage_destroy()
68 deFree(image); in deImage_destroy()
71 deARGB deImage_getPixel (const deImage* image, int x, int y) in deImage_getPixel() argument
73 void* addr = getPixelAddress(image, x, y); in deImage_getPixel()
74 switch (image->format) in deImage_getPixel()
84 void deImage_setPixel (deImage* image, int x, int y, deARGB argb) in deImage_setPixel() argument
86 void* addr = getPixelAddress(image, x, y); in deImage_setPixel()
87 switch (image->format) in deImage_setPixel()
96 deImage* deImage_convertFormat (const deImage* image, deImageFormat format) in deImage_convertFormat() argument
98 int width = image->width; in deImage_convertFormat()
99 int height = image->height; in deImage_convertFormat()
104 if (format == image->format) in deImage_convertFormat()
105 memcpy(converted->pixels, image->pixels, width * height * deImageFormat_getBytesPerPixel(format)); in deImage_convertFormat()
111 deImage_setPixel(converted, x, y, deImage_getPixel(image, x, y)); in deImage_convertFormat()
161 void deImage_copyToUint8RGBA (const deImage* image, deUint8* pixels) in deImage_copyToUint8RGBA() argument
163 int width = image->width; in deImage_copyToUint8RGBA()
164 int height = image->height; in deImage_copyToUint8RGBA()
170 deARGB pixel = deImage_getPixel(image, x, y); in deImage_copyToUint8RGBA()
179 void* deImage_getPixelPtr (const deImage* image) in deImage_getPixelPtr() argument
181 return image->pixels; in deImage_getPixelPtr()
184 int deImage_getWidth (const deImage* image) in deImage_getWidth() argument
186 return image->width; in deImage_getWidth()
189 int deImage_getHeight (const deImage* image) in deImage_getHeight() argument
191 return image->height; in deImage_getHeight()