|
Blender V4.5
|
#include <algorithm>#include <cstring>#include "BLI_fileops.h"#include "BLI_utildefines.h"#include "MEM_guardedalloc.h"#include "IMB_colormanagement.hh"#include "IMB_filetype.hh"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"Go to the source code of this file.
Classes | |
| struct | IRIS_Header |
| struct | MFileOffset |
Macros | |
| #define | IRIS_MAGIC 0732 |
| #define | HEADER_SIZE 512 |
| #define | RINTLUM (79) |
| #define | GINTLUM (156) |
| #define | BINTLUM (21) |
| #define | ILUM(r, g, b) |
| #define | OFFSET_R 0 /* this is byte order dependent */ |
| #define | OFFSET_G 1 |
| #define | OFFSET_B 2 |
| #define | CHANOFFSET(z) |
| #define | BPPMASK 0x00ff |
| #define | ITYPE_RLE 0x0100 |
| #define | ISRLE(type) |
| #define | BPP(type) |
| #define | RLE(bpp) |
| #define | MFILE_DATA(inf) |
| #define | MFILE_STEP(inf, step) |
| #define | MFILE_SEEK(inf, pos) |
| #define | DIRTY_FLAG_EOF (1 << 0) |
| #define | DIRTY_FLAG_ENCODING (1 << 1) |
| #define | GS(x) |
| #define | MFILE_CAPACITY_AT_PTR_OK_OR_FAIL(p) |
| #define | MFILE_CAPACITY_AT_PTR_OK_OR_FAIL(p) |
| #define | EXPAND_CAPACITY_AT_INPUT_OK_OR_FAIL(iptr_next) |
| #define | EXPAND_CAPACITY_AT_OUTPUT_OK_OR_FAIL(optr_next) |
| #define | EXPAND_CAPACITY_AT_INPUT_OK_OR_FAIL(iptr_next) |
| #define | EXPAND_CAPACITY_AT_OUTPUT_OK_OR_FAIL(optr_next) |
Functions | |
| BLI_STATIC_ASSERT (sizeof(IRIS_Header)==HEADER_SIZE, "Invalid header size") | |
| static void | readheader (MFileOffset *inf, IRIS_Header *image) |
| static int | writeheader (FILE *outf, const IRIS_Header *image) |
| static ushort | getshort (MFileOffset *inf) |
| static uint | getlong (MFileOffset *mofs) |
| static void | putshort (FILE *outf, ushort val) |
| static int | putlong (FILE *outf, uint val) |
| static int | writetab (FILE *outf, const uint *tab, int len) |
| static void | readtab (MFileOffset *inf, uint *tab, int len) |
| static int | expandrow (uchar *optr, const uchar *optr_end, const uchar *iptr, const uchar *iptr_end, int z) |
| static int | expandrow2 (float *optr, const float *optr_end, const uchar *iptr, const uchar *iptr_end, int z) |
| static void | interleaverow (uchar *lptr, const uchar *cptr, int z, int n) |
| static void | interleaverow2 (float *lptr, const uchar *cptr, int z, int n) |
| static int | compressrow (const uchar *lbuf, uchar *rlebuf, int z, int row_len) |
| static void | lumrow (const uchar *rgbptr, uchar *lumptr, int n) |
| bool | imb_is_a_iris (const uchar *mem, size_t size) |
| ImBuf * | imb_loadiris (const uchar *mem, size_t size, int flags, ImFileColorSpace &) |
| static bool | output_iris (const char *filepath, const uint *lptr, const int *zptr, const int xsize, const int ysize, const int zsize) |
| bool | imb_saveiris (ImBuf *ibuf, const char *filepath, int) |
Internal Image API | |
| static void | imbuf_rgba_to_abgr (ImBuf *ibuf) |
The SGI Image File Format. https://en.wikipedia.org/wiki/Silicon_Graphics_Image
Definition in file format_iris.cc.
| #define BINTLUM (21) |
Definition at line 59 of file format_iris.cc.
| #define BPP | ( | type | ) |
Definition at line 76 of file format_iris.cc.
Referenced by imb_loadiris().
| #define BPPMASK 0x00ff |
Definition at line 71 of file format_iris.cc.
| #define CHANOFFSET | ( | z | ) |
Definition at line 68 of file format_iris.cc.
Referenced by lumrow(), and output_iris().
| #define DIRTY_FLAG_ENCODING (1 << 1) |
Definition at line 102 of file format_iris.cc.
Referenced by expandrow(), and expandrow2().
| #define DIRTY_FLAG_EOF (1 << 0) |
Definition at line 101 of file format_iris.cc.
| #define EXPAND_CAPACITY_AT_INPUT_OK_OR_FAIL | ( | iptr_next | ) |
| #define EXPAND_CAPACITY_AT_INPUT_OK_OR_FAIL | ( | iptr_next | ) |
Referenced by expandrow(), and expandrow2().
| #define EXPAND_CAPACITY_AT_OUTPUT_OK_OR_FAIL | ( | optr_next | ) |
| #define EXPAND_CAPACITY_AT_OUTPUT_OK_OR_FAIL | ( | optr_next | ) |
Referenced by expandrow(), and expandrow2().
| #define GINTLUM (156) |
Definition at line 58 of file format_iris.cc.
| #define GS | ( | x | ) |
| #define HEADER_SIZE 512 |
Definition at line 53 of file format_iris.cc.
Referenced by BLI_STATIC_ASSERT(), imb_loadiris(), imb_test_image_read_header_from_filepath(), IMB_test_image_type(), IMB_test_image_type_matches(), and output_iris().
| #define ILUM | ( | r, | |
| g, | |||
| b ) |
| #define IRIS_MAGIC 0732 |
The SGI IRIS magic number. The value is [0x01 0xda] when read as a big-endian ushort.
Definition at line 31 of file format_iris.cc.
Referenced by imb_is_a_iris(), imb_loadiris(), and output_iris().
| #define ISRLE | ( | type | ) |
Definition at line 74 of file format_iris.cc.
Referenced by imb_loadiris().
| #define ITYPE_RLE 0x0100 |
Definition at line 73 of file format_iris.cc.
| #define MFILE_CAPACITY_AT_PTR_OK_OR_FAIL | ( | p | ) |
| #define MFILE_CAPACITY_AT_PTR_OK_OR_FAIL | ( | p | ) |
Referenced by imb_loadiris().
| #define MFILE_DATA | ( | inf | ) |
Definition at line 88 of file format_iris.cc.
Referenced by getlong(), getshort(), and imb_loadiris().
| #define MFILE_SEEK | ( | inf, | |
| pos ) |
Definition at line 94 of file format_iris.cc.
Referenced by imb_loadiris().
| #define MFILE_STEP | ( | inf, | |
| step ) |
Definition at line 89 of file format_iris.cc.
Referenced by getlong(), getshort(), and imb_loadiris().
| #define OFFSET_B 2 |
Definition at line 65 of file format_iris.cc.
Referenced by lumrow().
| #define OFFSET_G 1 |
Definition at line 64 of file format_iris.cc.
Referenced by lumrow().
| #define OFFSET_R 0 /* this is byte order dependent */ |
Definition at line 63 of file format_iris.cc.
Referenced by lumrow().
| #define RINTLUM (79) |
Definition at line 57 of file format_iris.cc.
| #define RLE | ( | bpp | ) |
Definition at line 77 of file format_iris.cc.
Referenced by output_iris().
| BLI_STATIC_ASSERT | ( | sizeof(IRIS_Header) | = =HEADER_SIZE, |
| "Invalid header size" | ) |
References HEADER_SIZE.
Definition at line 909 of file format_iris.cc.
Referenced by output_iris().
|
static |
Definition at line 705 of file format_iris.cc.
References BLI_assert, count, DIRTY_FLAG_ENCODING, EXPAND_CAPACITY_AT_INPUT_OK_OR_FAIL, EXPAND_CAPACITY_AT_OUTPUT_OK_OR_FAIL, and z().
Referenced by imb_loadiris().
|
static |
Definition at line 617 of file format_iris.cc.
References BLI_assert, count, DIRTY_FLAG_ENCODING, EXPAND_CAPACITY_AT_INPUT_OK_OR_FAIL, EXPAND_CAPACITY_AT_OUTPUT_OK_OR_FAIL, and z().
Referenced by imb_loadiris().
|
static |
Definition at line 170 of file format_iris.cc.
References MFILE_DATA, and MFILE_STEP.
Referenced by readtab().
|
static |
Definition at line 160 of file format_iris.cc.
References MFILE_DATA, and MFILE_STEP.
Referenced by readheader().
| bool imb_is_a_iris | ( | const uchar * | mem, |
| size_t | size ) |
Definition at line 251 of file format_iris.cc.
References GS, IRIS_MAGIC, and size().
Referenced by imb_loadiris().
| ImBuf * imb_loadiris | ( | const unsigned char * | mem, |
| size_t | size, | ||
| int | flags, | ||
| ImFileColorSpace & | r_colorspace ) |
Read in a B/W RGB or RGBA iris image file and return an image buffer.
Definition at line 259 of file format_iris.cc.
References BLI_assert, BPP, ImBuf::byte_buffer, ImBufByteBuffer::data, ImBufFloatBuffer::data, ELEM, expandrow(), expandrow2(), ImBuf::float_buffer, ImBuf::ftype, HEADER_SIZE, IB_byte_data, IB_float_data, IB_test, IRIS_Header::imagic, IMB_allocImBuf(), IMB_byte_from_float(), IMB_FTYPE_IRIS, imb_is_a_iris(), imbuf_rgba_to_abgr(), interleaverow(), interleaverow2(), IRIS_MAGIC, ISRLE, MEM_freeN(), MEM_malloc_arrayN(), MFILE_CAPACITY_AT_PTR_OK_OR_FAIL, MFILE_DATA, MFILE_SEEK, MFILE_STEP, min_ii(), ImBuf::planes, readheader(), readtab(), size(), IRIS_Header::type, ImBuf::x, x, IRIS_Header::xsize, ImBuf::y, y, IRIS_Header::ysize, z(), and IRIS_Header::zsize.
| bool imb_saveiris | ( | ImBuf * | ibuf, |
| const char * | filepath, | ||
| int | flags ) |
Definition at line 970 of file format_iris.cc.
References ImBuf::byte_buffer, ImBufByteBuffer::data, imbuf_rgba_to_abgr(), output_iris(), ImBuf::planes, ImBuf::x, and ImBuf::y.
|
static |
Change the ordering of the color bytes pointed to by rect from RGBA to ABGR. size * 4 color bytes are reordered.
Only this one is used liberally here, and in imbuf.
Definition at line 134 of file format_iris.cc.
References ImBuf::byte_buffer, ImBufByteBuffer::data, IMB_get_pixel_count(), and size().
Referenced by imb_loadiris(), and imb_saveiris().
|
static |
Definition at line 899 of file format_iris.cc.
References CHANOFFSET, ILUM, OFFSET_B, OFFSET_G, and OFFSET_R.
Referenced by output_iris().
|
static |
| filepath | The file path to write to. |
| lptr | an array of integers to an iris image file (each int represents one pixel). |
| zptr | depth-buffer (optional, may be nullptr). |
| xsize | with width of the pixel-array. |
| ysize | height of the pixel-array. |
| zsize | specifies what kind of image file to write out.
|
Definition at line 803 of file format_iris.cc.
References BLI_assert_msg, BLI_fopen(), CHANOFFSET, compressrow(), IRIS_Header::dim, HEADER_SIZE, IRIS_Header::imagic, IRIS_MAGIC, len, lumrow(), IRIS_Header::max, MEM_freeN(), MEM_malloc_arrayN(), MEM_mallocN(), IRIS_Header::min, pos, RLE, IRIS_Header::type, writeheader(), writetab(), IRIS_Header::xsize, y, IRIS_Header::ysize, z(), and IRIS_Header::zsize.
Referenced by imb_saveiris().
|
static |
Definition at line 189 of file format_iris.cc.
Referenced by writeheader(), and writetab().
|
static |
Definition at line 180 of file format_iris.cc.
Referenced by writeheader().
|
static |
Definition at line 200 of file format_iris.cc.
References IRIS_Header::dim, getshort(), IRIS_Header::imagic, IRIS_Header::type, IRIS_Header::xsize, IRIS_Header::ysize, and IRIS_Header::zsize.
Referenced by imb_loadiris().
|
static |
Definition at line 240 of file format_iris.cc.
References getlong(), and len.
Referenced by imb_loadiris().
|
static |
Definition at line 211 of file format_iris.cc.
References IRIS_Header::dim, IRIS_Header::imagic, IRIS_Header::max, IRIS_Header::min, putlong(), putshort(), IRIS_Header::type, IRIS_Header::xsize, IRIS_Header::ysize, and IRIS_Header::zsize.
Referenced by output_iris().
|
static |
Definition at line 229 of file format_iris.cc.
References len, and putlong().
Referenced by output_iris().