30#ifndef VIDEO_QT_DECODER_H
31#define VIDEO_QT_DECODER_H
33#include "audio/decoders/quicktime_intern.h"
34#include "common/keyboard.h"
35#include "common/scummsys.h"
37#include "graphics/palette.h"
38#include "graphics/transform_tools.h"
40#include "video/video_decoder.h"
74 uint16
getWidth()
const override {
return _width; }
75 uint16
getHeight()
const override {
return _height; }
79 void enableEditListBoundsCheckQuirk(
bool enable) { _enableEditListBoundsCheckQuirk = enable; }
85 void setTargetSize(uint16 w, uint16 h);
86 void setOrigin(
int left,
int top) { _origin =
Common::Point(left, top); }
88 void handleMouseMove(int16 x, int16 y);
89 void handleMouseButton(
bool isDown, int16 x = -1, int16 y = -1,
bool repeat =
false);
95 float getPanAngle()
const {
return _panAngle; }
96 void setPanAngle(
float panAngle);
97 float getTiltAngle()
const {
return _tiltAngle; }
98 void setTiltAngle(
float tiltAngle);
99 float getFOV()
const {
return _fov; }
100 float getHFOV()
const {
return _hfov; }
101 bool setFOV(
float fov);
102 int getCurrentNodeID() {
return _currentSample == -1 ? 0 : _panoTrack->panoSamples[_currentSample].hdr.nodeID; }
105 int getCurrentRow() {
return _nextVideoTrack->
getCurFrame() / _nav.columns; }
106 void setCurrentRow(
int row);
107 int getCurrentColumn() {
return _nextVideoTrack->
getCurFrame() % _nav.columns; }
108 void setCurrentColumn(
int column);
110 int getZoomState() {
return _zoomState; }
112 const PanoHotSpot *getRolloverHotspot() {
return _rolloverHotspot; }
113 int getRolloverHotspotID() {
return _rolloverHotspotID; }
114 const PanoHotSpot *getClickedHotspot() {
return _clickedHotspot; }
115 int getClickedHotspotID() {
return _clickedHotspotID; }
120 void setClickedHotSpot(
int id);
121 const PanoHotSpot *getHotSpotByID(
int id);
122 const PanoNavigation *getHotSpotNavByID(
int id);
126 bool isVR()
const {
return _isVR; }
127 QTVRType getQTVRType()
const {
return _qtvrType; }
129 int getWarpMode()
const {
return _warpMode; }
130 void setWarpMode(
int warpMode);
131 float getQuality()
const {
return _quality; }
132 void setQuality(
float quality);
133 Common::String getTransitionMode()
const {
return _transitionMode == kTransitionModeNormal ?
"normal" :
"swing"; }
135 float getTransitionSpeed()
const {
return _transitionSpeed; }
136 void setTransitionSpeed(
float speed);
140 void renderHotspots(
bool mode);
158 NodeData getNodeData(uint32 nodeID);
159 void goToNode(uint32 nodeID);
168 void updateAudioBuffer();
170 void handleObjectMouseMove(int16 x, int16 y);
171 void handleObjectMouseButton(
bool isDown, int16 x, int16 y,
bool repeat);
172 void handlePanoMouseMove(int16 x, int16 y);
173 void handlePanoMouseButton(
bool isDown, int16 x, int16 y,
bool repeat);
180 void lookupHotspot(int16 x, int16 y);
181 void updateQTVRCursor(int16 x, int16 y);
182 void setCursor(
int curId);
183 void cleanupCursors();
184 void computeInteractivityZones();
186 uint16 _width, _height;
194 int _currentSample = -1;
196 bool _isMouseButtonDown =
false;
199 bool _isKeyDown =
false;
209 kTransitionModeNormal,
210 kTransitionModeSwing,
213 kUpdateModeUpdateBoth,
214 kUpdateModeOffscreenOnly,
215 kUpdateModeFromOffscreen,
216 kUpdateModeDirectToScreen,
222 int _currentQTVRCursor = -1;
225 int _cursorDirMap[256];
230 float _quality = 0.0f;
231 int _transitionMode = kTransitionModeNormal;
232 float _transitionSpeed = 1.0f;
233 int _updateMode = kUpdateModeNormal;
235 float _panAngle = 0.0f;
236 float _tiltAngle = 0.0f;
239 int _zoomState = kZoomNone;
241 const PanoHotSpot *_rolloverHotspot =
nullptr;
242 int _rolloverHotspotID = 0;
243 const PanoHotSpot *_clickedHotspot =
nullptr;
244 int _clickedHotspotID = 0;
245 bool _renderHotspots =
false;
251 bool _enableEditListBoundsCheckQuirk;
264 uint16 _bitsPerSample;
266 uint16 _colorTableId;
273 class AudioTrackHandler :
public SeekableAudioTrack {
275 AudioTrackHandler(QuickTimeDecoder *decoder, QuickTimeAudioTrack *audioTrack);
283 QuickTimeDecoder *_decoder;
284 QuickTimeAudioTrack *_audioTrack;
296 int32 _loResSceneTrackID;
297 byte _reserved3[4 * 6];
298 int32 _hotSpotTrackID;
299 byte _reserved4[4 * 9];
313 int16 _sceneNumFramesX;
314 int16 _sceneNumFramesY;
315 int16 _sceneColorDepth;
321 int16 _hotSpotNumFramesX;
322 int16 _hotSpotNumFramesY;
323 int16 _hotSpotColorDepth;
329 class VideoTrackHandler :
public VideoTrack {
332 ~VideoTrackHandler();
334 bool endOfTrack()
const override;
335 bool isSeekable()
const override {
return true; }
343 int getCurFrame()
const override {
return _curFrame; }
344 void setCurFrame(int32 curFrame) { _curFrame = curFrame; }
346 uint32 getNextFrameStartTime()
const override;
352 bool isReversed()
const override {
return _reversed; }
353 bool canDither()
const override;
354 void setDither(
const byte *palette)
override;
362 QuickTimeDecoder *_decoder;
366 int32 _delayedFrameToBufferTo;
367 uint32 _nextFrameStartTime;
369 int32 _durationOverride;
370 const byte *_curPalette;
371 mutable bool _dirtyPalette;
375 uint32 getCurFrameDuration();
376 uint32 findKeyFrame(uint32 frame)
const;
377 bool isEmptyEdit()
const;
378 void enterNewEditListEntry(
bool bufferFrames,
bool intializingTrack =
false);
379 uint32 getRateAdjustedFrameTime()
const;
380 uint32 getCurEditTimeOffset()
const;
381 uint32 getCurEditTrackDuration()
const;
382 bool atLastEdit()
const;
383 bool endOfCurEdit()
const;
384 void checkEditListBounds();
387 class PanoTrackHandler :
public VideoTrack {
392 bool endOfTrack()
const override {
return false; }
396 uint32 getNextFrameStartTime()
const override {
return 0; }
404 void constructPanorama();
409 void setDirty() { _dirty =
true; }
412 QuickTimeDecoder *_decoder;
415 void projectPanorama(uint8 scaleFactor,
float fov,
float hfov,
float panAngle,
float tiltAngle);
416 void swingTransitionHandler();
433 uint8 _upscaleLevel = 0;
438 float _currentFOV = 0;
439 float _currentHFOV = 0;
440 float _currentPanAngle = 0;
441 float _currentTiltAngle = 0;
444 bool _isPanoConstructed;
Definition: quicktime_intern.h:47
Definition: audiostream.h:212
Definition: timestamp.h:83
Definition: archive.h:141
Definition: quicktime.h:134
Definition: rational.h:40
Simple class for handling a palette data.
Definition: palette.h:61
Definition: qt_decoder.h:66
bool loadFile(const Common::Path &filename) override
Audio::Timestamp getDuration() const override
Definition: qt_decoder.h:77
uint16 getWidth() const override
Definition: qt_decoder.h:74
uint16 getHeight() const override
Definition: qt_decoder.h:75
bool loadStream(Common::SeekableReadStream *stream) override
const Graphics::Surface * decodeNextFrame() override
virtual int getCurFrame() const =0
Definition: video_decoder.h:53
bool seek(const Audio::Timestamp &time)
Graphics::PixelFormat getPixelFormat() const
bool hasDirtyPalette() const
Definition: video_decoder.h:337
bool setReverse(bool reverse)
const byte * getPalette()
virtual bool isSeekable() const
bool setOutputPixelFormat(const Graphics::PixelFormat &format)
uint32 getFrameCount() const
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: keyboard.h:294
Definition: quicktime.h:300
Definition: atari-cursor.h:35
Definition: transform_tools.h:32
Definition: qt_decoder.h:142