Lines Matching refs:img

55  *        void mlib_ImageDelete(mlib_image *img)
57 * mlib_image *mlib_ImageCreateSubimage(mlib_image *img,
63 * void *mlib_ImageCreateRowTable(mlib_image *img)
65 * void mlib_ImageDeleteRowTable(mlib_image *img)
67 * mlib_status mlib_ImageSetPaddings(mlib_image *img,
73 * mlib_status mlib_ImageSetFormat(mlib_image *img,
76 * img pointer to image data structure
355 void mlib_ImageDelete(mlib_image *img)
357 if (img == NULL) return;
358 if ((img -> flags & MLIB_IMAGE_USERALLOCATED) == 0) {
359 mlib_free(img -> data);
362 mlib_ImageDeleteRowTable(img);
363 mlib_free(img);
367 mlib_image *mlib_ImageCreateSubimage(mlib_image *img,
383 if (w <= 0 || h <= 0 || img == NULL) return NULL;
385 type = img -> type;
386 channels = img -> channels;
387 width = img -> width;
388 height = img -> height;
389 stride = img -> stride;
417 data = (mlib_u8 *)(img -> data) + y * stride;
435 bitoffset = img -> bitoffset;
511 void *mlib_ImageCreateRowTable(mlib_image *img)
516 if (img == NULL) return NULL;
517 if (img -> state) return img -> state;
519 im_height = mlib_ImageGetHeight(img);
520 im_stride = mlib_ImageGetStride(img);
521 tline = mlib_ImageGetData(img);
534 img -> state = ((void **)rtable + 2);
535 return img -> state;
539 void mlib_ImageDeleteRowTable(mlib_image *img)
543 if (img == NULL) return;
545 state = img -> state;
549 img -> state = 0;
553 mlib_status mlib_ImageSetPaddings(mlib_image *img,
559 if (img == NULL) return MLIB_FAILURE;
561 if ((left + right) >= img -> width ||
562 (top + bottom) >= img -> height) return MLIB_OUTOFRANGE;
564 img -> paddings[0] = left;
565 img -> paddings[1] = top;
566 img -> paddings[2] = right;
567 img -> paddings[3] = bottom;
573 mlib_status mlib_ImageSetFormat(mlib_image *img,
576 if (img == NULL) return MLIB_FAILURE;
578 img -> format = format;