My Project
|
Public Member Functions | |
void | SetRecordSettings (bool autoAspect, int width, int height, float duration, int fps, int loop, int quality) |
(Settings-1) Sets the recording settings before StartRecord | |
void | SetRecordSettings (Vector2 aspectRatio, int width, int height, float duration, int fps, int loop, int quality) |
(Settings-2) Sets the recording settings before StartRecord | |
void | SetGifRotation (ImageRotator.Rotation rotation) |
Sets the GIF rotation. | |
void | SetTransparent (Color32 color32, byte transparentColorRange) |
Sets the transparent color, hide this color in the GIF. The GIF specification allows setting a color to be transparent. *** Use case: if you want to record gameObject, character or anything else with transparent background, please make sure the background is of solid color(no gradient), and the target object do not contain this color. (Also be reminded, the transparent feature takes more time to encoding the GIF) | |
void | SetTransparent (bool autoDetectTransparent) |
Auto detects the input image(s) pixels for enable/disable transparent feature. *** Use case: for pre-made images that have transparent pixels manually set. (Also be reminded, the transparent feature takes more time to encoding the GIF) | |
void | StartRecord (Camera camera, string recorderName, Action< float > onRecordProgress=null, Action onRecordDurationMax=null, Action onPreProcessingDone=null, Action< int, float > onFileSaveProgress=null, Action< int, string > onFileSaved=null, bool autoClear=true) |
Create/Start a new recorder to store frames with specific camera. | |
ProGifRecorder | GetRecorder (string recorderName) |
void | PauseRecord (string recorderName) |
void | ResumeRecord (string recorderName) |
void | StopRecord (string recorderName) |
void | SaveRecord (string recorderName, string fileNameWithoutExtension="") |
void | StopAndSaveRecord (string recorderName, string fileNameWithoutExtension="") |
void | ClearRecorder (string recorderName) |
void | ClearRecorder_Delay (string recorderName, string importingPlayerName, Action< string > onClear=null) |
void | PlayGif (ProGifRecorder recorderSource, Image playerImage, string playerName, Action< float > onLoading=null) |
Play gif from Recorder, display with Image. | |
void | PlayGif (ProGifRecorder recorderSource, Renderer playerRenderer, string playerName, Action< float > onLoading=null) |
Play gif from Recorder, display with Renderer. | |
void | PlayGif (ProGifRecorder recorderSource, RawImage playerRawImage, string playerName, Action< float > onLoading=null) |
Play gif from Recorder, display with RawImage. | |
void | SetPlayerOnLoading (string playerName, Action< float > onLoading) |
Set the callback for checking the decode progress. If using a recorder source for playback, this becomes a loading-complete callback. | |
void | SetPlayerOnFirstFrame (string playerName, Action< ProGifPlayerComponent.FirstGifFrame > onFirstFrame) |
Set the callback to be fired when the first gif frame ready. If using a recorder source for playback, this becomes a loading-complete callback with the first GIF frame returned. | |
void | SetPlayerOnPlaying (string playerName, Action< GifTexture > onPlaying) |
Set the callback to be fired on every frame when playing gif. | |
ProGifPlayer | GetPlayer (string playerName) |
void | PausePlayer (string playerName) |
void | ResumePlayer (string playerName) |
void | StopPlayer (string playerName) |
void | ClearPlayer (string playerName) |
Static Public Member Functions | |
static void | iSetRecordSettings (bool autoAspect, int width, int height, float duration, int fps, int loop, int quality) |
(Settings-1) Sets the recording settings before StartRecord | |
static void | iSetRecordSettings (Vector2 aspectRatio, int width, int height, float duration, int fps, int loop, int quality) |
(Settings-2) Sets the recording settings before StartRecord | |
static void | iSetGifRotation (ImageRotator.Rotation rotation) |
Sets the GIF rotation. | |
static void | iSetTransparent (Color32 color32, byte transparentColorRange) |
Sets the transparent color, hide this color in the GIF. The GIF specification allows setting a color to be transparent. *** Use case: if you want to record gameObject, character or anything else with transparent background, please make sure the background is of solid color(no gradient), and the target object do not contain this color. (Also be reminded, the transparent feature takes more time to encode the GIF) | |
static void | iSetTransparent (bool autoDetectTransparent) |
Auto detects the input image(s) pixels for enable/disable transparent feature. *** Use case: for pre-made images that have transparent pixels manually set. (Also be reminded, the transparent feature takes more time to encode the GIF) | |
static void | iStartRecord (Camera camera, string recorderName, Action< float > onRecordProgress=null, Action onRecordDurationMax=null, Action onPreProcessingDone=null, Action< int, float > onFileSaveProgress=null, Action< int, string > onFileSaved=null, bool autoClear=true) |
Create/Start a new recorder to store frames with specific camera. | |
static ProGifRecorder | iGetRecorder (string recorderName) |
static void | iPauseRecord (string recorderName) |
static void | iResumeRecord (string recorderName) |
static void | iStopRecord (string recorderName) |
static void | iSaveRecord (string recorderName, string fileNameWithoutExtension="") |
static void | iStopAndSaveRecord (string recorderName, string fileNameWithoutExtension="") |
static void | iClearRecorder (string recorderName) |
Clear the target recorder immediately. | |
static void | iClearRecorder_Delay (string recorderName, string importingPlayerName, Action< string > onClear=null) |
Delay clear the target recorder by monitoring both the recorder and the player status, this ensures the recorder textures not being cleared too early. | |
static void | iSetPlayerOptimization (bool enable) |
static void | iPlayGif (ProGifRecorder recorderSource, Image playerImage, string playerName, Action< float > onLoading=null) |
Play gif from Recorder, display with Image. | |
static void | iPlayGif (ProGifRecorder recorderSource, Renderer playerRenderer, string playerName, Action< float > onLoading=null) |
Play gif from Recorder, display with Renderer. | |
static ProGifPlayer | iGetPlayer (string playerName) |
static void | iPausePlayer (string playerName) |
static void | iResumePlayer (string playerName) |
static void | iStopPlayer (string playerName) |
static void | iClearPlayer (string playerName) |
Public Attributes | |
Vector2 | m_AspectRatio = new Vector2(0, 0) |
bool | m_AutoAspect = true |
int | m_Width = 360 |
int | m_Height = 360 |
float | m_Duration = 3f |
int | m_Fps = 15 |
int | m_Loop = 0 |
int | m_Quality = 20 |
ImageRotator.Rotation | m_Rotation = ImageRotator.Rotation.None |
Color32 | m_TransparentColor = new Color32(0, 0, 0, 0) |
byte | m_TransparentColorRange = 0 |
bool | m_AutoTransparent = false |
bool | m_OptimizeMemoryUsage = true |
Set to 'true' to take advantage of the highly optimized ProGif playback solution for significantly save the memory usage. | |
Dictionary< string, ProGifRecorder > | m_GifRecorderDict = new Dictionary<string, ProGifRecorder>() |
Dictionary< string, ProGifPlayer > | m_GifPlayerDict = new Dictionary<string, ProGifPlayer>() |
Properties | |
static PGif | Instance [get] |
Gets the instance of PGif. Create new one if no existing instance. Use this instance to control gif Record, Playback and Settings. | |
static bool | HasInstance [get] |
|
inlinestatic |
Delay clear the target recorder by monitoring both the recorder and the player status, this ensures the recorder textures not being cleared too early.
recorderName | The recorder that to be saved to GIF file and also uses as a source for a gif player. |
importingPlayerName | The gif player uses for playing the recorder source. |
onClear | The callback to be fired when the recorder actually being cleared. (Optional) |
|
inlinestatic |
Play gif from Recorder, display with Image.
recorderSource | The recorder which the gif frames are stored. |
playerImage | Target image for displaying gif. |
playerName | The Name for identifying players in the dictionary. |
onLoading | On loading. Return value: loading progress(float) |
|
inlinestatic |
Play gif from Recorder, display with Renderer.
recorderSource | The recorder which the gif frames are stored. |
playerRenderer | Target renderer for displaying gif. |
playerName | The Name for identifying players in the dictionary. |
onLoading | On loading. Return value: loading progress(float) |
|
inlinestatic |
Sets the GIF rotation.
rotation | Rotation: None, -90, 90, 180 |
|
inlinestatic |
Set Enable or Disable for optimizing memory usage for gif players. (Call this method before playing GIF)
|
inlinestatic |
(Settings-1) Sets the recording settings before StartRecord
autoAspect | If set to true, auto aspect. Else force scale gif size to width*height. |
width | Width. |
height | Height. If autoAspect, height will be recalculated. |
duration | Total time to record. |
fps | Frames per second. |
loop | Loop. -1: no repeat, 0: infinite, >0: repeat count |
quality | Quality. (1 - 100), 1: best, 100: faster |
|
inlinestatic |
(Settings-2) Sets the recording settings before StartRecord
aspectRatio | A Specify aspect ratio for cropping gif. Set (0,0) if dont use, or use Settings-1 instead. |
width | Width. |
height | Height. If autoAspect, height will be recalculated. |
duration | Total time to record. |
fps | Frames per second. |
loop | Loop. -1: no repeat, 0: infinite, >0: repeat count |
quality | Quality. (1 - 100), 1: best, 100: faster |
|
inlinestatic |
Auto detects the input image(s) pixels for enable/disable transparent feature. *** Use case: for pre-made images that have transparent pixels manually set. (Also be reminded, the transparent feature takes more time to encode the GIF)
autoDetectTransparent | If set to true auto detect transparent pixels to enable the transparent feature, else disable the auto detection. |
|
inlinestatic |
Sets the transparent color, hide this color in the GIF. The GIF specification allows setting a color to be transparent. *** Use case: if you want to record gameObject, character or anything else with transparent background, please make sure the background is of solid color(no gradient), and the target object do not contain this color. (Also be reminded, the transparent feature takes more time to encode the GIF)
color32 | The Color to hide in the gif. Make sure the alpha value greater than Zero, else disable the transparent feature. |
transparentColorRange | The range of RGB value for picking nearby colors of the input color to set as transparent pixels. |
|
inlinestatic |
Create/Start a new recorder to store frames with specific camera.
camera | The target Camera to attach the newly create gif recroder. |
recorderName | Recorder Name for identifying recorders in the dictionary. |
onRecordProgress | Update the record progress. Return values: record progress(float) |
onRecordDurationMax | To be fired when target duration frames reached. |
onPreProcessingDone | On pre processing done. |
onFileSaveProgress | On file save progress. Retrun values: worker id(int), save progress(float). |
onFileSaved | On file saved. Return values: id(int), saved path(string). |
autoClear | If set to true , clear the recorder when gif saved. (Do Not auto clear the recorder if you want to preview the GIF) |
|
inline |
Play gif from Recorder, display with Image.
recorderSource | The recorder which the gif frames are stored. |
playerImage | Target image for displaying gif. |
playerName | The Name for identifying players in the dictionary. |
onLoading | On loading. Return value: loading progress(float) |
|
inline |
Play gif from Recorder, display with RawImage.
recorderSource | The recorder which the gif frames are stored. |
playerRawImage | Target RawImage for displaying gif. |
playerName | The Name for identifying players in the dictionary. |
onLoading | On loading. Return value: loading progress(float) |
|
inline |
Play gif from Recorder, display with Renderer.
recorderSource | The recorder which the gif frames are stored. |
playerRenderer | Target renderer for displaying gif. |
playerName | The Name for identifying players in the dictionary. |
onLoading | On loading. Return value: loading progress(float) |
|
inline |
Sets the GIF rotation.
rotation | Rotation: None, -90, 90, 180 |
|
inline |
Set the callback to be fired when the first gif frame ready. If using a recorder source for playback, this becomes a loading-complete callback with the first GIF frame returned.
onFirstFrame | On first frame callback, returns the first gifTexture and related data. |
|
inline |
Set the callback for checking the decode progress. If using a recorder source for playback, this becomes a loading-complete callback.
onLoading | On loading callback, returns the decode/loading progress(float). |
|
inline |
Set the callback to be fired on every frame when playing gif.
onPlaying | On gif playing callback, returns the current gifTexture. |
|
inline |
(Settings-1) Sets the recording settings before StartRecord
autoAspect | If set to true, auto aspect. Else force scale gif size to width*height. |
width | Width. |
height | Height. If autoAspect, height will be recalculated. |
duration | Total time to record. |
fps | Frames per second. |
loop | Loop. -1: no repeat, 0: infinite, >0: repeat count |
quality | Quality. (1 - 100), 1: best, 100: faster |
|
inline |
(Settings-2) Sets the recording settings before StartRecord
aspectRatio | A Specify aspect ratio for cropping gif. Set (0,0) if dont use, or use Settings-1 instead. |
width | Width. |
height | Height. If autoAspect, height will be recalculated. |
duration | Total time to record. |
fps | Frames per second. |
loop | Loop. -1: no repeat, 0: infinite, >0: repeat count |
quality | Quality. (1 - 100), 1: best, 100: faster |
|
inline |
Auto detects the input image(s) pixels for enable/disable transparent feature. *** Use case: for pre-made images that have transparent pixels manually set. (Also be reminded, the transparent feature takes more time to encoding the GIF)
autoDetectTransparent | If set to true auto detect transparent pixels to enable the transparent feature, else disable the auto detection. |
|
inline |
Sets the transparent color, hide this color in the GIF. The GIF specification allows setting a color to be transparent. *** Use case: if you want to record gameObject, character or anything else with transparent background, please make sure the background is of solid color(no gradient), and the target object do not contain this color. (Also be reminded, the transparent feature takes more time to encoding the GIF)
color32 | The Color to hide in the gif. Make sure the alpha value greater than Zero, else disable the transparent feature. |
transparentColorRange | The range of RGB value for picking nearby colors of the input color to set as transparent pixels. |
|
inline |
Create/Start a new recorder to store frames with specific camera.
camera | The target Camera to attach the newly create gif recroder. |
recorderName | Recorder Name for identifying recorders in the dictionary. |
onRecordProgress | Update the record progress. Return values: record progress(float) |
onRecordDurationMax | To be fired when target duration frames reached. |
onPreProcessingDone | On pre processing done. |
onFileSaveProgress | On file save progress. Retrun values: worker id(int), save progress(float). |
onFileSaved | On file saved. Return values: id(int), saved path(string). |
autoClear | If set to true Clear the recorder when gif saved? (Do Not auto clear the recorder if you want to preview the GIF) |
|
staticget |
Gets the instance of PGif. Create new one if no existing instance. Use this instance to control gif Record, Playback and Settings.
The instance.