tornavis/source/blender/imbuf
Philipp Oeser c5db0272d4 Fix T70276: View animation with jpeg 2000 image will crash player
Since our ffmpeg is built with openjpeg support and thus can decode jpeg
2000 (in both J2K and JP2 codec flavors as well as high bitdepths), added
these extensions to the supported list.

Also IMB_ispic > IMB_ispic_type > imb_is_a_jp2 was only testing for jp2,
now do both jp2/j2k.

Reviewers: brecht

Maniphest Tasks: T70276

Differential Revision: https://developer.blender.org/D5909
2019-09-27 12:02:08 +02:00
..
intern Fix T70276: View animation with jpeg 2000 image will crash player 2019-09-27 12:02:08 +02:00
CMakeLists.txt ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
IMB_colormanagement.h Cleanup: remove unused render buffers 2019-06-18 13:59:55 +02:00
IMB_imbuf.h Cleanup: use const for image blending functions 2019-09-25 17:19:08 +10:00
IMB_imbuf_types.h Images: change alpha settings to support channel packing 2019-05-19 14:36:42 +02:00
IMB_metadata.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
IMB_moviecache.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
IMB_thumbs.h Fix T67620: Font preview translations malfunction in Blender 2.8 2019-07-29 14:11:35 +02:00
readme.txt Spelling fixes in comments and descriptions, patch by luzpaz 2019-07-31 14:27:35 +02:00

readme.txt

The following 4 steps to adding a new image format to blender, its
probably easiest to look at the png code for a clean clear example,
animation formats are a bit more complicated but very similar:

Step 1:
create a new file named after the format for example lets say we were
creating an openexr read/writer  use openexr.c
It should contain functions to match the following prototypes:

struct ImBuf *imb_loadopenexr(unsigned char *mem,int size,int flags);
/* Use one of the following depending on what's easier for your file format */
short imb_saveopenexr(struct ImBuf *ibuf, FILE myfile, int flags);
short imb_saveopenexr(struct ImBuf *ibuf, char *myfile, int flags);

/* Used to test if its the correct format
int IMB_is_openexr(void *buf);

Step 2:
Add your hooks to read and write the image format these go in
	writeimage.c and readimage.c  just look at how the others are done

Step 3:
Add in IS_openexr to blender/source/blender/imbuf/IMB_imbuf_types.h
Add in R_openexr to source/blender/makesdna/DNA_scene_types.h

Step 4:
Add your hooks to the gui.
source/blender/src/buttons_scene.c
source/blender/src/toets.c
source/blender/src/writeimage.c

Step 5:
edit the following files:
blender/source/blender/imbuf/intern/util.c
blender/source/blender/src/filesel.c
blender/source/blender/src/screendump.c
and add your extension so that your format gets recognized in the thumbnails.

Step 6:
Alter the build process:
For cmake you need to edit blender/source/blender/imbuf/CMakeLists.txt
and add in your additional files to source_files.
If you have any external library info you will also need to add that
to the various build processes.

Step 7:
Its also good to add your image format to:
makepicstring in blender/source/blender/blenkernel/intern/image.c