HRESULT TimgFilterLogoaway::process(TfilterQueue::iterator it,TffPict &pict,const TfilterSettingsVideo *cfg0)
{
    if (is(pict,cfg0)) {
        const TlogoawaySettings *cfg=(const TlogoawaySettings*)cfg0;
        init(pict,cfg->full,cfg->half);
        bool cspChanged;
        if (cfg->lumaonly) {
            cspChanged=getCurNext(FF_CSPS_MASK_YUV_PLANAR,pict,cfg->full,COPYMODE_DEF,&plane[0].dst,NULL,NULL,NULL);
        } else {
            cspChanged=getCurNext(FF_CSPS_MASK_YUV_PLANAR,pict,cfg->full,COPYMODE_DEF,&plane[0].dst,&plane[1].dst,&plane[2].dst,NULL);
        }

        if (cspChanged || logotemp.rectFull.dx!=(unsigned int)cfg->dx || logotemp.rectFull.dy!=(unsigned int)cfg->dy || !plane[0] || oldLumaOnly!=cfg->lumaonly || oldBlur!=cfg->blur || oldMode!=cfg->mode || stricmp(oldparambitmap,cfg->parambitmap)!=0) {
            oldLumaOnly=cfg->lumaonly;
            oldBlur=cfg->blur;
            oldMode=cfg->mode;
            ff_strncpy(oldparambitmap, cfg->parambitmap, countof(oldparambitmap));
            done();
            if (cfg->mode==TlogoawaySettings::MODE_SHAPEXY || cfg->mode==TlogoawaySettings::MODE_SHAPEUGLARM) {
                parambitmap=new TffPict(csp2,cfg->parambitmap,parambitmapbuf,deci);
                if (parambitmap->rectFull.dx!=(unsigned int)cfg->dx || parambitmap->rectFull.dy!=(unsigned int)cfg->dy) {
                    delete parambitmap;
                    parambitmap=NULL;
                }
            }
            for (int i=0; i<(cfg->lumaonly?1:3); i++) {
                plane[i].shiftX=pict.cspInfo.shiftX[i];
                plane[i].shiftY=pict.cspInfo.shiftY[i];
                plane[i].w=cfg->dx>>plane[i].shiftX;
                plane[i].h=cfg->dy>>plane[i].shiftY;
                if (parambitmap) {
                    plane[i].parambitmapdata=parambitmap->data[i];
                    plane[i].parambitmapstride=parambitmap->stride[i];
                } else {
                    plane[i].parambitmapdata=NULL;
                    plane[i].parambitmapstride=0;
                }
                plane[i].init(cfg);
            }
        }

        Trect tempR(cfg->x,cfg->y,cfg->dx,cfg->dy);
        logotemp.copyFrom(pict,logotempbuf,&tempR);

        YUVcolor yuv(cfg->solidcolor);
        for (int i=0; i<(cfg->lumaonly?1:3); i++) {
            plane[i].stride2=stride2[i];
            plane[i].logotempdata=logotemp.data[i];
            plane[i].logotempstride=logotemp.stride[i];
            plane[i].solidcolor=(i==0?yuv.Y:(i==1?yuv.V+128:yuv.U+128));
            plane[i].process(cfg);
        }
    }
	bool
    IncrementalMerkleTree::getRootValue(std::vector<unsigned char>& r) {

		// Create a temporary byte vector
		std::vector<bool> tempR(r.size() * 8, 0);

        // Query the root for its hash
        this->root.getValue(tempR);

		// Convert the result back into the given vector
		convertVectorToBytesVector(tempR, r);

        return true;
    }