Example #1
0
ImBuf *IMB_loadiffname(const char *filepath, int flags, char colorspace[IM_MAX_SPACE])
{
	ImBuf *ibuf;
	int file, a;
	char filepath_tx[IB_FILENAME_SIZE];

	imb_cache_filename(filepath_tx, filepath, flags);

	file = BLI_open(filepath_tx, O_BINARY | O_RDONLY, 0);
	if (file < 0) return NULL;

	ibuf = IMB_loadifffile(file, filepath, flags, colorspace, filepath_tx);

	if (ibuf) {
		BLI_strncpy(ibuf->name, filepath, sizeof(ibuf->name));
		BLI_strncpy(ibuf->cachename, filepath_tx, sizeof(ibuf->cachename));
		for (a = 1; a < ibuf->miptot; a++)
			BLI_strncpy(ibuf->mipmap[a - 1]->cachename, filepath_tx, sizeof(ibuf->cachename));
		if (flags & IB_fields) IMB_de_interlace(ibuf);
	}

	close(file);

	return ibuf;
}
Example #2
0
ImBuf *IMB_loadiffname(const char *name, int flags)
{
	ImBuf *ibuf;
	int file, a;
	char filename[IB_FILENAME_SIZE];

	imb_cache_filename(filename, name, flags);

	file = open(filename, O_BINARY|O_RDONLY);
	if(file < 0) return NULL;

	ibuf= IMB_loadifffile(file, flags);

	if(ibuf) {
		BLI_strncpy(ibuf->name, name, sizeof(ibuf->name));
		BLI_strncpy(ibuf->cachename, filename, sizeof(ibuf->cachename));
		for(a=1; a<ibuf->miptot; a++)
			BLI_strncpy(ibuf->mipmap[a-1]->cachename, filename, sizeof(ibuf->cachename));
		if(flags & IB_fields) IMB_de_interlace(ibuf);
	}

	close(file);

	return ibuf;
}
Example #3
0
struct ImBuf *IMB_loadiffname(const char *naam, int flags) {
    int file;
    struct ImBuf *ibuf;
    int buf[1];

    file = open(naam, O_BINARY|O_RDONLY);

    if (file == -1) return (0);

    ibuf= IMB_loadifffile(file, flags);

    if (ibuf == NULL) {
        if (read(file, buf, 4) != 4) buf[0] = 0;
        if ((BIG_LONG(buf[0]) & 0xfffffff0) == 0xffd8ffe0)
            ibuf = imb_ibJpegImageFromFilename(naam, flags);
    }

    if (ibuf) {
        strncpy(ibuf->name, naam, sizeof(ibuf->name));
        if (flags & IB_fields) IMB_de_interlace(ibuf);
    }
    close(file);
    return(ibuf);
}
Example #4
0
LIBEXPORT void de_interlace(struct ImBuf *ib)
{
    IMB_de_interlace(ib);
}