ZFFramework
 
Loading...
Searching...
No Matches
ZFUIImageAni.h File Reference

animated image load util More...

#include "ZFUIWidgetDef.h"

Go to the source code of this file.

Macros

#define ZFUIImageSerializeType_ZFUIImageAni
 see ZFUIIMAGE_SERIALIZE_TYPE_DEFINE
 
#define ZFSerializableKeyword_ZFUIImageAni_images
 keyword for serialize
 
#define ZFSerializableKeyword_ZFUIImageAni_ref
 keyword for serialize
 
#define ZFSerializableKeyword_ZFUIImageAni_refSrc
 keyword for serialize
 
#define ZFSerializableKeyword_ZFUIImageAni_split
 keyword for serialize
 
#define ZFSerializableKeyword_ZFUIImageAni_frames
 keyword for serialize
 
#define ZFSerializableKeyword_ZFUIImageAni_size
 keyword for serialize
 
#define ZFSerializableKeyword_ZFUIImageAni_count
 keyword for serialize
 
#define ZFSerializableKeyword_ZFUIImageAni_duration
 keyword for serialize
 
#define ZFSerializableKeyword_ZFUIImageAni_rect
 keyword for serialize
 

Functions

zfautoT< ZFUIImageZFUIImageAni (ZFArray *images, zftimet duration=(0), ZFArray *frameDurations=(zft_zfnull))
 animated image util
 
zfbool ZFUIImageAniT (ZFUIImage *ret, ZFArray *images, zftimet duration=(0), ZFArray *frameDurations=(zft_zfnull))
 see ZFUIImageAni
 
zfautoT< ZFUIImageZFUIImageAni (ZFUIImage *ref, const ZFUISize &frameSize, zfindex frameCount, zftimet frameDuration=(0))
 see ZFUIImageAni
 
zfbool ZFUIImageAniT (ZFUIImage *ret, ZFUIImage *ref, const ZFUISize &frameSize, zfindex frameCount, zftimet frameDuration=(0))
 see ZFUIImageAni
 
zfautoT< ZFUIImageZFUIImageAni (const ZFInput &refSrc, const ZFUISize &frameSize, zfindex frameCount, zftimet frameDuration=(0))
 see ZFUIImageAni
 
zfbool ZFUIImageAniT (ZFUIImage *ret, const ZFInput &refSrc, const ZFUISize &frameSize, zfindex frameCount, zftimet frameDuration=(0))
 see ZFUIImageAni
 
zfautoT< ZFUIImageZFUIImageAni (ZFUIImage *ref, ZFArray *frameRects, zftimet duration=(0), ZFArray *frameDurations=(zft_zfnull))
 see ZFUIImageAni
 
zfbool ZFUIImageAniT (ZFUIImage *ret, ZFUIImage *ref, ZFArray *frameRects, zftimet duration=(0), ZFArray *frameDurations=(zft_zfnull))
 see ZFUIImageAni
 
zfautoT< ZFUIImageZFUIImageAni (const ZFInput &refSrc, ZFArray *frameRects, zftimet duration=(0), ZFArray *frameDurations=(zft_zfnull))
 see ZFUIImageAni
 
zfbool ZFUIImageAniT (ZFUIImage *ret, const ZFInput &refSrc, ZFArray *frameRects, zftimet duration=(0), ZFArray *frameDurations=(zft_zfnull))
 see ZFUIImageAni
 
zfautoT< ZFUIImageZFUIImageAniLoad (const ZFInput &input)
 util function to load animated image with special naming logic
 
zfbool ZFUIImageAniLoadCheck (ZFUISize &frameSize, zfindex &frameCount, zftimet &frameDuration, const zfstring &fileName)
 try parse rules declared in ZFUIImageAniLoad
 
zfbool ZFUIImageAniSave (const ZFPathInfo &dst, ZFArray *images, zftimet frameDuration=(0))
 util function to save animated image with special logic
 

Detailed Description

animated image load util

Macro Definition Documentation

◆ ZFUIImageSerializeType_ZFUIImageAni

#define ZFUIImageSerializeType_ZFUIImageAni

see ZFUIIMAGE_SERIALIZE_TYPE_DEFINE

serializable data:

<ZFUIImage imageType="ZFUIImageAni">
// type 1 : each image frame
<node category="images" duration="123" >
<ZFUIImage duration="123" />
...
</node>
// type 2 : split large ref image by same config for each frame
<ZFUIImage category="ref" ... /> // large ref image
<ZFCallback category="refSrc" ... /> // large ref image
<node category="split" // how the large ref image split to frames
size="(w,h)"
count="123"
duration="123"
/>
// type 3 : split large ref image by different config
<ZFUIImage category="ref" ... /> // large ref image
<ZFCallback category="refSrc" ... /> // large ref image
<node category="frames" duration="123" >
<node rect="(l,t,w,h)" duration="123" />
...
</node>
callback used by ZFFramework
Definition ZFCallback.h:96
image storage
Definition ZFUIImage.h:30

Function Documentation

◆ ZFUIImageAni()

zfautoT< ZFUIImage > ZFUIImageAni ( ZFArray * images,
zftimet duration = (0),
ZFArray * frameDurations = (zft_zfnull) )
extern

animated image util

how it works:

  1. return a dummy holder image
  2. update each image frame by ZFUIImage::imageStateImplNotifyUpdate
Note
the src image would be retained by the returned image object
see also ZFUIImage::imageScale for frame size

◆ ZFUIImageAniLoad()

zfautoT< ZFUIImage > ZFUIImageAniLoad ( const ZFInput & input)
extern

util function to load animated image with special naming logic

the src input must support ZFCallback::callbackId or ZFCallback::pathInfo with this naming rule:

  • xxx.wxh-N.xxx, for example: path/test.40x30-10.png
  • xxx.wxh-N-DURATION.xxx, for example: path/test.40x30-10-33.png

then the result animated image would have:

  • 40x30 as each frame size
  • 10 as frame count
  • 33 as each frame duration

◆ ZFUIImageAniSave()

zfbool ZFUIImageAniSave ( const ZFPathInfo & dst,
ZFArray * images,
zftimet frameDuration = (0) )
extern

util function to save animated image with special logic

save to a single large image with special naming rule, see ZFUIImageAniLoad

the dst path info must support these to achieve the special naming rule:

a special file name would be appended to dst, for example, if dst is path/test.png, then the final dst to output may be path/test.40x30-10.png