2011-02-23 10:52:22 +00:00
/*
2003-04-28 02:15:46 +00:00
* allocimbuf . h
*
* $ Id $
*
2008-04-16 22:40:48 +00:00
* * * * * * BEGIN GPL LICENSE BLOCK * * * * *
2003-04-28 02:15:46 +00:00
*
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation ; either version 2
2008-04-16 22:40:48 +00:00
* of the License , or ( at your option ) any later version .
2003-04-28 02:15:46 +00:00
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software Foundation ,
2010-02-12 13:34:04 +00:00
* Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 , USA .
2003-04-28 02:15:46 +00:00
*
* The Original Code is Copyright ( C ) 2001 - 2002 by NaN Holding BV .
* All rights reserved .
*
* The Original Code is : all of this file .
*
* Contributor ( s ) : none yet .
*
2008-04-16 22:40:48 +00:00
* * * * * * END GPL LICENSE BLOCK * * * * *
2003-04-28 02:15:46 +00:00
*/
2011-02-27 20:23:21 +00:00
/** \file blender/imbuf/intern/IMB_anim.h
* \ ingroup imbuf
*/
2003-04-28 02:15:46 +00:00
# ifndef IMB_ANIM_H
# define IMB_ANIM_H
# ifdef _WIN32
# define INC_OLE2
# include <windows.h>
# include <windowsx.h>
# include <mmsystem.h>
# include <memory.h>
# include <commdlg.h>
# ifndef FREE_WINDOWS
# include <vfw.h>
# endif
# undef AVIIF_KEYFRAME // redefined in AVI_avi.h
# undef AVIIF_LIST // redefined in AVI_avi.h
2005-01-03 19:53:04 +00:00
# define FIXCC(fcc) if (fcc == 0) fcc = mmioFOURCC('N', 'o', 'n', 'e'); \
if ( fcc = = BI_RLE8 ) fcc = mmioFOURCC ( ' R ' , ' l ' , ' e ' , ' 8 ' ) ;
2003-04-28 02:15:46 +00:00
# endif
# include <sys/types.h>
# include <ctype.h>
# include <stdlib.h>
# include <stdio.h>
# ifndef _WIN32
# include <dirent.h>
# else
# include <io.h>
# endif
# include "BLI_blenlib.h" / * BLI_remlink BLI_filesize BLI_addtail
2010-03-22 09:30:00 +00:00
BLI_countlist BLI_stringdec */
2003-04-28 02:15:46 +00:00
# include "imbuf.h"
# include "AVI_avi.h"
# ifdef WITH_QUICKTIME
# if defined(_WIN32) || defined(__APPLE__)
# include "quicktime_import.h"
# endif /* _WIN32 || __APPLE__ */
# endif /* WITH_QUICKTIME */
2006-02-05 19:23:34 +00:00
# ifdef WITH_FFMPEG
2009-03-22 19:19:21 +00:00
# include <libavformat/avformat.h>
# include <libavcodec/avcodec.h>
# include <libswscale/swscale.h>
2006-02-05 19:23:34 +00:00
# endif
2008-06-02 21:35:57 +00:00
# ifdef WITH_REDCODE
2008-11-04 23:04:15 +00:00
# ifdef _WIN32 /* on windows we use the one in extern instead */
# include "libredcode/format.h"
# else
# include "libredcode/format.h"
# endif
2008-06-02 21:35:57 +00:00
# endif
2003-04-28 02:15:46 +00:00
# include "IMB_imbuf_types.h"
# include "IMB_imbuf.h"
# include "IMB_allocimbuf.h"
/* actually hard coded endianness */
# define GET_BIG_LONG(x) (((uchar *) (x))[0] << 24 | ((uchar *) (x))[1] << 16 | ((uchar *) (x))[2] << 8 | ((uchar *) (x))[3])
# define GET_LITTLE_LONG(x) (((uchar *) (x))[3] << 24 | ((uchar *) (x))[2] << 16 | ((uchar *) (x))[1] << 8 | ((uchar *) (x))[0])
# define SWAP_L(x) (((x << 24) & 0xff000000) | ((x << 8) & 0xff0000) | ((x >> 8) & 0xff00) | ((x >> 24) & 0xff))
# define SWAP_S(x) (((x << 8) & 0xff00) | ((x >> 8) & 0xff))
/* more endianness... should move to a separate file... */
2011-05-22 04:25:31 +00:00
# if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
2003-04-28 02:15:46 +00:00
# define GET_ID GET_BIG_LONG
# define LITTLE_LONG SWAP_LONG
# else
# define GET_ID GET_LITTLE_LONG
# define LITTLE_LONG ENDIAN_NOP
# endif
2011-01-15 16:14:57 +00:00
/* anim.curtype, runtime only */
# define ANIM_NONE 0
# define ANIM_SEQUENCE (1 << 0)
2003-04-28 02:15:46 +00:00
# define ANIM_MOVIE (1 << 4)
# define ANIM_AVI (1 << 6)
# define ANIM_QTIME (1 << 7)
2011-01-15 16:14:57 +00:00
# define ANIM_FFMPEG (1 << 8)
# define ANIM_REDCODE (1 << 9)
2003-04-28 02:15:46 +00:00
2005-01-03 19:53:04 +00:00
# define MAXNUMSTREAMS 50
2003-04-28 02:15:46 +00:00
Merge image related changes from the render branch. This includes the image
tile cache code in imbuf, but it is not hooked up to the render engine.
Imbuf module: some small refactoring and removing a lot of unused or old code
(about 6.5k lines).
* Added a ImFileType struct with callbacks to make adding an file format type,
or making changes to the API easier.
* Move imbuf init/exit code into IMB_init()/IMB_exit() functions.
* Increased mipmap levels from 10 to 20, you run into this limit already with
a 2k image.
* Removed hamx, amiga, anim5 format support.
* Removed colormap saving, only simple colormap code now for reading tga.
* Removed gen_dynlibtiff.py, editing this is almost as much work as just
editing the code directly.
* Functions removed that were only used for sequencer plugin API:
IMB_anim_nextpic, IMB_clever_double, IMB_antialias, IMB_gamwarp,
IMB_scalefieldImBuf, IMB_scalefastfieldImBuf, IMB_onethird, IMB_halflace,
IMB_dit0, IMB_dit2, IMB_cspace
* Write metadata info into OpenEXR images. Can be viewed with the command
line utility 'exrheader'
For the image tile cache code, see this page:
http://wiki.blender.org/index.php/Dev:2.5/Source/Imaging/ImageTileCache
2010-05-07 15:18:04 +00:00
struct _AviMovie ;
2003-04-28 02:15:46 +00:00
struct anim {
int ib_flags ;
int curtype ;
int curposition ; /* index 0 = 1e, 1 = 2e, enz. */
int duration ;
int x , y ;
/* voor op nummer */
char name [ 256 ] ;
/* voor sequence */
char first [ 256 ] ;
/* movie */
void * movie ;
void * track ;
void * params ;
int orientation ;
size_t framesize ;
int interlacing ;
2006-03-07 20:01:12 +00:00
int preseek ;
2003-04-28 02:15:46 +00:00
/* data */
struct ImBuf * ibuf1 , * ibuf2 ;
/* avi */
struct _AviMovie * avi ;
# if defined(_WIN32) && !defined(FREE_WINDOWS)
/* windows avi */
int avistreams ;
int firstvideo ;
int pfileopen ;
PAVIFILE pfile ;
PAVISTREAM pavi [ MAXNUMSTREAMS ] ; // the current streams
PGETFRAME pgf ;
# endif
# ifdef WITH_QUICKTIME
/* quicktime */
struct _QuicktimeMovie * qtime ;
# endif /* WITH_QUICKTIME */
2006-02-05 19:23:34 +00:00
# ifdef WITH_FFMPEG
AVFormatContext * pFormatCtx ;
AVCodecContext * pCodecCtx ;
AVCodec * pCodec ;
2007-09-23 14:04:23 +00:00
AVFrame * pFrame ;
2008-06-29 15:11:35 +00:00
AVFrame * pFrameRGB ;
AVFrame * pFrameDeinterlaced ;
2007-09-23 14:04:23 +00:00
struct SwsContext * img_convert_ctx ;
2006-02-05 19:23:34 +00:00
int videoStream ;
# endif
2008-06-02 21:35:57 +00:00
# ifdef WITH_REDCODE
struct redcode_handle * redcodeCtx ;
# endif
2003-04-28 02:15:46 +00:00
} ;
# endif