tahoma2d/toonz/sources/include/toonz4.6/tnzmovie.h

148 lines
4.5 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef _QT_MOVIE_H_
#define _QT_MOVIE_H_
/**************************************************************
This APIs permit to handle MACINTOSH QUICKTIME movies.
They are intended only for creation; viewing and updating movies
2016-06-15 18:43:10 +12:00
is not currently supported.
2016-03-19 06:57:51 +13:00
Moreover, image insertion is not permitted; only appending.
2016-06-15 18:43:10 +12:00
To view .mov file, use quicktime tools present on both NT(movieplayer)
and IRIX(movieplayer, moviemaker) platform.
2016-03-19 06:57:51 +13:00
The .mov created are cross-platform
**************************************************************/
#include "toonz4.6/toonz.h"
#include "tsound.h"
#undef TNZAPI
#ifdef TNZ_IS_IMAGELIB
#define TNZAPI TNZ_EXPORT_API
#else
#define TNZAPI TNZ_IMPORT_API
#endif
#undef TNZAPI2
#ifdef TNZ_IS_COMMONLIB
#define TNZAPI2 TNZ_EXPORT_API
#else
#define TNZAPI2 TNZ_IMPORT_API
#endif
/*opaque definition for the movie object*/
typedef struct TNZMOVIE_DATA *TNZMOVIE;
typedef struct _RASTER *MY_RASTER; /*to avoid raster.h inclusion */
/* Warning: TNZMOVIE_TYPE makes sense only on NT; on IRIX is always RGBX*/
typedef enum TNZMOVIE_TYPE {
2016-06-15 18:43:10 +12:00
TM_RGBX_TYPE = 0,
TM_RGB16_TYPE,
TM_RGB8_TYPE,
TM_BW_TYPE,
TM_HOW_MANY_TYPE
2016-03-19 06:57:51 +13:00
} TNZMOVIE_TYPE;
typedef enum TNZMOVIE_QUALITY {
2016-06-15 18:43:10 +12:00
TM_MIN_QUALITY = 0,
TM_LOW_QUALITY,
TM_NORMAL_QUALITY,
TM_HIGH_QUALITY,
TM_MAX_QUALITY,
TM_LOSSLESS_QUALITY,
TM_HOW_MANY_QUALITY
2016-03-19 06:57:51 +13:00
} TNZMOVIE_QUALITY;
#ifdef WIN32
typedef int TNZMOVIE_COMPRESSION;
#else
typedef enum TNZMOVIE_COMPRESSION {
2016-06-15 18:43:10 +12:00
TM_JPG_COMPRESSION = 0,
TM_VIDEO_COMPRESSION,
TM_ANIM_COMPRESSION,
TM_CINEPAK_COMPRESSION,
TM_HOW_MANY_COMPRESSION
2016-03-19 06:57:51 +13:00
} TNZMOVIE_COMPRESSION;
#endif
typedef unsigned long CodecQ;
typedef unsigned long CodecType;
/*---------------------------------------------------------------------------*/
TNZAPI2 TBOOL tnz_movies_available(void);
TNZAPI2 TBOOL tnz_avi_available(void);
2016-06-15 18:43:10 +12:00
TNZAPI2 TBOOL get_movie_codec_info(char ***quality_string, int *numQ, int *defQ,
char ***compression_string, int *numC,
int *defC);
2016-03-19 06:57:51 +13:00
/*
#ifdef WIN32
2016-06-15 18:43:10 +12:00
TNZAPI2 TBOOL get_movie_codec_val(char *quality_string, ULONG *quality_val,
char *compression_string, ULONG
*compression_val);
2016-03-19 06:57:51 +13:00
#else
*/
2016-06-15 18:43:10 +12:00
TNZAPI2 TBOOL get_movie_codec_val(char *quality_string,
TNZMOVIE_QUALITY *quality_val,
char *compression_string,
TNZMOVIE_COMPRESSION *compression_val);
2016-03-19 06:57:51 +13:00
/*
#endif
*/
#ifndef WIN32
2016-06-15 18:43:10 +12:00
TNZAPI2 TBOOL get_movie_codec_info(char ***quality_string, int *numQ, int *defQ,
char ***compression_string, int *numC,
int *defC);
2016-03-19 06:57:51 +13:00
#endif
TNZAPI2 CodecQ tm_get_quality(int quality);
TNZAPI2 CodecType tm_get_compression(int compression);
/**************************************************************
This function creates and open a new movie, ready to append images;
NIL is returned on error; Remember to use tm_close
when finished!!!
**************************************************************/
/*---------------------------------------------------------------------------*/
2016-06-15 18:43:10 +12:00
TNZAPI TNZMOVIE tm_create(char *fullpathname, TBOOL do_overwrite_file,
TNZMOVIE_TYPE type, int rate, int lx, int ly,
TNZMOVIE_QUALITY quality,
TNZMOVIE_COMPRESSION compression);
2016-03-19 06:57:51 +13:00
/**************************************************************
2016-06-15 18:43:10 +12:00
Warning: raster lx and ly must be the same of the movie.
2016-03-19 06:57:51 +13:00
Raster is converted to the suitable format(cloning it)
**************************************************************/
TNZAPI TBOOL tm_append_raster(TNZMOVIE movie, MY_RASTER r);
/**************************************************************
2016-06-15 18:43:10 +12:00
Append a .wav(NT) or .aiff(IRIX) audio file to the movie.
2016-09-06 01:20:21 +12:00
The length of the resulting movie is forced to be equal to the video track,
2016-03-19 06:57:51 +13:00
so any overflowing audio is truncated. For this reason, is adviced to add
the audio when the video part has been completely added.
The position can be a negative value too;
2016-06-15 18:43:10 +12:00
If 'position' is >0, the audio track is added beginning from video frame
'position'.
If 'position' is <0, the audio is added starting from audio frame 'position',
2016-03-19 06:57:51 +13:00
at the beginning of video track.
**************************************************************/
2016-06-15 18:43:10 +12:00
TNZAPI TBOOL tm_add_audio_track(TNZMOVIE movie, char *audiofullpathname,
int img_offs, int audio_offs, int frames,
TS_STRACK audioTrack);
2016-03-19 06:57:51 +13:00
TNZAPI TBOOL tm_close(TNZMOVIE movie);
#endif