Esempio n. 1
0
short IMB_saveiff(struct ImBuf *ibuf, const char *name, int flags)
{
	ImFileType *type;

	if (ibuf == NULL) return (false);
	ibuf->flags = flags;

	for (type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++) {
		if (type->save && type->ftype(type, ibuf)) {
			ImBuf *write_ibuf;
			short result = false;

			write_ibuf = prepare_write_imbuf(type, ibuf);

			result = type->save(write_ibuf, name, flags);

			if (write_ibuf != ibuf)
				IMB_freeImBuf(write_ibuf);

			return result;
		}
	}

	fprintf(stderr, "Couldn't save picture.\n");

	return false;
}
Esempio n. 2
0
short IMB_saveiff(struct ImBuf *ibuf, const char *name, int flags)
{
	ImFileType *type;

	if(ibuf == NULL) return (FALSE);
	ibuf->flags = flags;

	for(type=IMB_FILE_TYPES; type->is_a; type++) {
		if(type->save && type->ftype(type, ibuf)) {
			if(!(type->flag & IM_FTYPE_FLOAT)) {
				if(ibuf->rect==NULL && ibuf->rect_float)
					IMB_rect_from_float(ibuf);
			}
			return type->save(ibuf, name, flags);
		}
	}

	fprintf(stderr, "Couldn't save picture.\n");

	return FALSE;
}