예제 #1
0
void NefDecoder::decodeMetaDataInternal(CameraMetaData *meta) {
  int iso = 0;
  mRaw->cfa.setCFA(CFA_RED, CFA_GREEN, CFA_GREEN2, CFA_BLUE);

  vector<TiffIFD*> data = mRootIFD->getIFDsWithTag(MODEL);

  if (data.empty())
    ThrowRDE("NEF Meta Decoder: Model name found");
  if (!data[0]->hasEntry(MAKE))
    ThrowRDE("NEF Support: Make name not found");

  int white = mRaw->whitePoint;
  int black = mRaw->blackLevel;

  string make = data[0]->getEntry(MAKE)->getString();
  string model = data[0]->getEntry(MODEL)->getString();

  if (mRootIFD->hasEntryRecursive(ISOSPEEDRATINGS))
    iso = mRootIFD->getEntryRecursive(ISOSPEEDRATINGS)->getInt();

  string mode = getMode();
  if (meta->hasCamera(make, model, mode)) {
    setMetaData(meta, make, model, mode, iso);
  } else {
    setMetaData(meta, make, model, "", iso);
  }

  if (white != 65536)
    mRaw->whitePoint = white;
  if (black >= 0)
    mRaw->blackLevel = black;
}
예제 #2
0
void UBDocumentProxy::setHasDefaultImageBackground(const bool hasDefault)
{
   mHasDefaultImageBackground = hasDefault;
   // Issue 1684 - ALTI/AOU - 20131210
   if (hasDefault == false){
        setMetaData(UBSettings::documentDefaultBackgroundImage, "");
        setMetaData(UBSettings::documentDefaultBackgroundImageDisposition, "");
   // Fin Issue 1684 - ALTI/AOU - 20131210
   }
}
OMX_ERRORTYPE GpuPostProc::Perform(BufferInfo *pBufferIn, BufferInfo *pBufferOut) {

    gppResult result = GPP_SUCCESS;
    ANativeWindowBuffer *anw1 = NULL;
    ANativeWindowBuffer *anw2 = NULL;

    if (m_fGpuPostProcPerform == NULL) {
        FAILED1(OMX_ErrorUndefined, "Invalid method handle to Perform");
    }

    if (!pBufferIn || !pBufferOut) {
        FAILED1(OMX_ErrorBadParameter, "Bad parameters: %p, %p", pBufferIn, pBufferOut);
    }

    private_handle_t *pHandleIn = (private_handle_t *)pBufferIn->pHandle;
    private_handle_t *pHandleOut = (private_handle_t *)pBufferOut->pHandle;
    if (!pHandleIn || !pHandleOut) {
        FAILED1(OMX_ErrorBadParameter, "Bad parameters: %p, %p", pHandleIn, pHandleOut);
    }

    anw1 = new ANativeWindowBuffer_t;
    anw1->width = m_nFrameWidth;
    anw1->height = m_nFrameHeight;
    anw1->handle = (buffer_handle_t)pHandleIn;
    anw1->format = GetGrallocFormat(m_nInputColorFormat);

    anw2 = new ANativeWindowBuffer_t;
    anw2->width = m_nFrameWidth;
    anw2->height = m_nFrameHeight;
    anw2->handle = (buffer_handle_t)pHandleOut;
    anw2->format = GetGrallocFormat(m_nOutputColorFormat);

    int32_t param = 1;
    if (m_bSecureSession) {
        setMetaData(pHandleIn, MAP_SECURE_BUFFER, (void*)&param);
        setMetaData(pHandleOut, MAP_SECURE_BUFFER, (void*)&param);
    }

    result = m_fGpuPostProcPerform((gpuPostProcessingHandle*)m_pSessionHandle, anw1, anw2);

    if (m_bSecureSession) {
        param = 0;
        setMetaData(pHandleIn, MAP_SECURE_BUFFER, (void*)&param);
        setMetaData(pHandleOut, MAP_SECURE_BUFFER, (void*)&param);
    }

    delete anw1;
    delete anw2;

    if (result != GPP_SUCCESS) {
        VTEST_MSG_ERROR("Error in GpuPostProc Perform");
        return OMX_ErrorBadParameter;
    }
    return OMX_ErrorNone;
}
예제 #4
0
void AriDecoder::decodeMetaDataInternal(CameraMetaData *meta) {
  mRaw->cfa.setCFA(iPoint2D(2,2), CFA_GREEN, CFA_RED, CFA_BLUE, CFA_GREEN2);
  mRaw->metadata.wbCoeffs[0] = mWB[0];
  mRaw->metadata.wbCoeffs[1] = mWB[1];
  mRaw->metadata.wbCoeffs[2] = mWB[2];
  if (meta->hasCamera("ARRI", mModel, mEncoder)) {
    setMetaData(meta, "ARRI", mModel, mEncoder, mIso);
  } else {
    setMetaData(meta, "ARRI", mModel, "", mIso);
  }
}
예제 #5
0
bool FrTextSpans::addMetaData(FrSymbol *key, const FrObject *value)
{
   FrStructField *field = m_metadata.getField(key) ;
   if (!field)
      return setMetaData(key,value) ;
   FrObject *oldvalue = field->get() ;
   if (oldvalue)
      {
      if (oldvalue->consp())
	 {
	 FrList *list = (FrList*)oldvalue ;
	 if (value && value->consp())
	    {
	    FrList *newvalue = ((FrList*)value)->difference(list) ;
	    list = newvalue->nconc(list) ;
	    }
	 else if (!list->member(value,::equal))
	    pushlist(value?value->deepcopy():0,list) ;
	 field->set(list) ;
	 }
      else
	 return false ;
      }
   else if (value && value->consp())
      field->set(value->deepcopy()) ;
   else
      field->set(new FrList(value?value->deepcopy():0)) ;
   return true ;
}
예제 #6
0
bool FrTextSpans::insertMetaData(FrSymbol *key, FrObject *value,
				 bool copy)
{
   FrStructField *field = m_metadata.getField(key) ;
   if (!field)
      return setMetaData(key,value,copy) ;
   FrObject *oldvalue = field->get() ;
   if (oldvalue)
      {
      if (!oldvalue->consp())
	 {
	 oldvalue = new FrList(oldvalue) ;
	 field->set(oldvalue) ;
	 }
      FrList *list = (FrList*)oldvalue ;
      if (!list->member(value,::equal))
	 {
	 pushlist(value&&copy?value->deepcopy():value,list) ;
	 field->set(list) ;
	 }
      }
   else if (value && value->consp())
      field->set(copy?value->deepcopy():value) ;
   else
      field->set(new FrList((value&&copy)?value->deepcopy():value)) ;
   return true ;
}
예제 #7
0
FrTextSpans::FrTextSpans(const FrTextSpans *old)
{
   clear() ;
   if (old)
      {
      m_text = FrDupString(old->m_text) ;
      setPositionMap() ;
      if (m_text && m_positions)
	 {
	 FrList *fields = old->m_metadata.fieldNames() ;
	 while (fields)
	    {
	    FrSymbol *key = (FrSymbol*)poplist(fields) ;
	    setMetaData(key,old->metaData(key)) ;
	    }
	 }
      else
	 {
	 FrFree(m_text) ;	m_text = 0 ;
	 FrFree(m_positions) ;	m_positions = 0 ;
	 m_textlength = 0 ;
	 }
      }
   return ;
}
예제 #8
0
파일: ccObject.cpp 프로젝트: Windlkx/trunk
bool ccObject::fromFile(QFile& in, short dataVersion, int flags)
{
    assert(in.isOpen() && (in.openMode() & QIODevice::ReadOnly));

    if (dataVersion<20)
        return CorruptError();

    //DGM: if we are here, we assume the class ID has already been read!
    //Call ccObject::readClassIDFromFile if necessary
    ////class ID (dataVersion>=20)
    //uint32_t classID = 0;
    //if (in.read((char*)&classID,4) < 0)
    //	return ReadError();

    //unique ID (dataVersion>=20)
    //DGM: this ID will be usefull to recreate dynamic links between entities!
    uint32_t uniqueID = 0;
    if (in.read((char*)&uniqueID,4) < 0)
        return ReadError();
    m_uniqueID = (unsigned)uniqueID;

    //name
    if (dataVersion < 22) //old style
    {
        char name[256];
        if (in.read(name,256) < 0)
            return ReadError();
        setName(name);
    }
    else //(dataVersion>=22)
    {
        QDataStream inStream(&in);
        inStream >> m_name;
    }

    //flags (dataVersion>=20)
    uint32_t objFlags = 0;
    if (in.read((char*)&objFlags,4) < 0)
        return ReadError();
    m_flags = (unsigned)objFlags;

    //meta data (dataVersion>=30)
    if (dataVersion >= 30)
    {
        //count
        uint32_t metaDataCount = 0;
        if (in.read((char*)&metaDataCount,4) < 0)
            return ReadError();

        //"key + value" pairs
        for (uint32_t i=0; i<metaDataCount; ++i)
        {
            QDataStream inStream(&in);
            QString key;
            QVariant value;
            inStream >> key;
            inStream >> value;
            setMetaData(key,value);
        }
    }
예제 #9
0
void PefDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  int iso = 0;
  mRaw->cfa.setCFA(iPoint2D(2,2), CFA_RED, CFA_GREEN, CFA_GREEN, CFA_BLUE);

  if (mRootIFD->hasEntryRecursive(ISOSPEEDRATINGS))
    iso = mRootIFD->getEntryRecursive(ISOSPEEDRATINGS)->getU32();

  setMetaData(meta, "", iso);

  // Read black level
  if (mRootIFD->hasEntryRecursive(static_cast<TiffTag>(0x200))) {
    TiffEntry* black = mRootIFD->getEntryRecursive(static_cast<TiffTag>(0x200));
    if (black->count == 4) {
      for (int i = 0; i < 4; i++)
        mRaw->blackLevelSeparate[i] = black->getU32(i);
    }
  }

  // Set the whitebalance
  if (mRootIFD->hasEntryRecursive(static_cast<TiffTag>(0x0201))) {
    TiffEntry* wb = mRootIFD->getEntryRecursive(static_cast<TiffTag>(0x0201));
    if (wb->count == 4) {
      mRaw->metadata.wbCoeffs[0] = wb->getU32(0);
      mRaw->metadata.wbCoeffs[1] = wb->getU32(1);
      mRaw->metadata.wbCoeffs[2] = wb->getU32(3);
    }
  }
}
예제 #10
0
void ccSNECloud::updateMetadata()
{
	//add metadata tag defining the ccCompass class type
	QVariantMap* map = new QVariantMap();
	map->insert("ccCompassType", "SNECloud");
	setMetaData(*map, true);
}
예제 #11
0
QT_BEGIN_NAMESPACE

CameraBinService::CameraBinService(GstElementFactory *sourceFactory, QObject *parent):
    QMediaService(parent),
    m_cameraInfoControl(0)
{
    m_captureSession = 0;
    m_metaDataControl = 0;

    m_audioInputSelector = 0;
    m_videoInputDevice = 0;

    m_videoOutput = 0;
    m_videoRenderer = 0;
    m_videoWindow = 0;
#if defined(HAVE_WIDGETS)
    m_videoWidgetControl = 0;
#endif
    m_imageCaptureControl = 0;

    m_captureSession = new CameraBinSession(sourceFactory, this);
    m_videoInputDevice = new QGstreamerVideoInputDeviceControl(sourceFactory, m_captureSession);
    m_imageCaptureControl = new CameraBinImageCapture(m_captureSession);

    connect(m_videoInputDevice, SIGNAL(selectedDeviceChanged(QString)),
            m_captureSession, SLOT(setDevice(QString)));

    if (m_videoInputDevice->deviceCount())
        m_captureSession->setDevice(m_videoInputDevice->deviceName(m_videoInputDevice->selectedDevice()));

#if defined(Q_WS_MAEMO_6) && defined(__arm__) && defined(HAVE_WIDGETS)
    m_videoRenderer = new QGstreamerGLTextureRenderer(this);
#else
    m_videoRenderer = new QGstreamerVideoRenderer(this);
#endif

#ifdef Q_WS_MAEMO_6
    m_videoWindow = new QGstreamerVideoWindow(this, "omapxvsink");
#else
    m_videoWindow = new QGstreamerVideoWindow(this);
#endif

#if defined(HAVE_WIDGETS)
    m_videoWidgetControl = new QGstreamerVideoWidgetControl(this);
#endif

    m_audioInputSelector = new QGstreamerAudioInputSelector(this);
    connect(m_audioInputSelector, SIGNAL(activeInputChanged(QString)), m_captureSession, SLOT(setCaptureDevice(QString)));

    if (m_captureSession && m_audioInputSelector->availableInputs().size() > 0)
        m_captureSession->setCaptureDevice(m_audioInputSelector->defaultInput());

    m_metaDataControl = new CameraBinMetaData(this);
    connect(m_metaDataControl, SIGNAL(metaDataChanged(QMap<QByteArray,QVariant>)),
            m_captureSession, SLOT(setMetaData(QMap<QByteArray,QVariant>)));

#if defined(Q_WS_MAEMO_6)
    new CameraButtonListener(this);
#endif
}
예제 #12
0
void DlgPrefRecord::slotApply()
{
    setRecordingFolder();

    setMetaData();

    slotEncoding();
}
예제 #13
0
void UBDocumentProxy::setDefaultDocumentSize(QSize pSize)
{
    if (defaultDocumentSize() != pSize)
    {
        setMetaData(UBSettings::documentSize, QVariant(pSize));
        emit defaultDocumentSizeChanged();

        mIsModified = true;
    }
}
예제 #14
0
bool FrTextSpan::setMetaData(FrSymbol *key, const FrObject *value)
{
   if (!metaData())
      {
      setMetaData(new FrStruct(FrSymbolTable::add(METADATA_TYPENAME))) ;
      if (!metaData())
	 return false ;
      }
   m_metadata->put(key,value) ;
   return true ;
}
QGstreamerCaptureService::QGstreamerCaptureService(const QString &service, QObject *parent):
    QMediaService(parent)
{
    m_captureSession = 0;
    m_cameraControl = 0;
    m_metaDataControl = 0;

    m_videoInput = 0;
    m_audioInputEndpointSelector = 0;
    m_videoInputDevice = 0;

    m_videoOutput = 0;
    m_videoRenderer = 0;
    m_videoWindow = 0;
    m_videoWidgetControl = 0;
    m_imageCaptureControl = 0;

    if (service == Q_MEDIASERVICE_AUDIOSOURCE) {
        m_captureSession = new QGstreamerCaptureSession(QGstreamerCaptureSession::Audio, this);
    }

   if (service == Q_MEDIASERVICE_CAMERA) {
        m_captureSession = new QGstreamerCaptureSession(QGstreamerCaptureSession::AudioAndVideo, this);
        m_cameraControl = new QGstreamerCameraControl(m_captureSession);
        m_videoInput = new QGstreamerV4L2Input(this);
        m_captureSession->setVideoInput(m_videoInput);
        m_videoInputDevice = new QGstreamerVideoInputDeviceControl(this);

        connect(m_videoInputDevice, SIGNAL(selectedDeviceChanged(QString)),
                m_videoInput, SLOT(setDevice(QString)));

        if (m_videoInputDevice->deviceCount())
            m_videoInput->setDevice(m_videoInputDevice->deviceName(m_videoInputDevice->selectedDevice()));

        m_videoRenderer = new QGstreamerVideoRenderer(this);

#if defined(Q_WS_X11) && !defined(QT_NO_XVIDEO)
        m_videoWindow = new QGstreamerVideoOverlay(this);
        m_videoWidgetControl = new QGstreamerVideoWidgetControl(this);
#endif    
        m_imageCaptureControl = new QGstreamerImageCaptureControl(m_captureSession);
    }

    m_audioInputEndpointSelector = new QGstreamerAudioInputEndpointSelector(this);
    connect(m_audioInputEndpointSelector, SIGNAL(activeEndpointChanged(QString)), m_captureSession, SLOT(setCaptureDevice(QString)));

    if (m_captureSession && m_audioInputEndpointSelector->availableEndpoints().size() > 0)
        m_captureSession->setCaptureDevice(m_audioInputEndpointSelector->defaultEndpoint());

    m_metaDataControl = new QGstreamerCaptureMetaDataControl(this);
    connect(m_metaDataControl, SIGNAL(metaDataChanged(QMap<QByteArray,QVariant>)),
            m_captureSession, SLOT(setMetaData(QMap<QByteArray,QVariant>)));
}
예제 #16
0
void X3fDecoder::decodeMetaDataInternal( CameraMetaData *meta )
{
  if (readName()) {
    if (checkCameraSupported(meta, camera_make, camera_model, "" )) {
      int iso = 0;
      if (hasProp("ISO"))
        iso = atoi(getProp("ISO").c_str());
      setMetaData(meta, camera_make, camera_model, "", iso);
      return;
    }
  }
}
예제 #17
0
void UBDocumentProxy::init()
{
    setMetaData(UBSettings::documentGroupName, "");

    QDateTime now = QDateTime::currentDateTime();
    setMetaData(UBSettings::documentName, now.toString(Qt::SystemLocaleShortDate));

    setUuid(QUuid::createUuid());

    setDefaultDocumentSize(UBSettings::settings()->pageSize->get().toSize());

    //teacherGuide metadata
    setMetaData(UBSettings::sessionTitle,"");
    setMetaData(UBSettings::sessionAuthors,"");
    setMetaData(UBSettings::sessionObjectives,"");
    setMetaData(UBSettings::sessionKeywords,"");
    setMetaData(UBSettings::sessionGradeLevel,"");
    setMetaData(UBSettings::sessionSubjects,"");
    setMetaData(UBSettings::sessionType,"");
    setMetaData(UBSettings::sessionLicence,"");
}
예제 #18
0
void KdcDecoder::decodeMetaDataInternal(CameraMetaData *meta) {
  vector<TiffIFD*> data = mRootIFD->getIFDsWithTag(MODEL);

  if (data.empty())
    ThrowRDE("KDC Decoder: Model name found");
  if (!data[0]->hasEntry(MAKE))
    ThrowRDE("KDC Decoder: Make name not found");

  string make = data[0]->getEntry(MAKE)->getString();
  string model = data[0]->getEntry(MODEL)->getString();
  setMetaData(meta, make, model, "", 0);
}
void IDBDatabaseBackendImpl::setVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
{
    int64_t databaseId = database->id();
    database->m_version = version;
    if (!setMetaData(database->m_sqliteDatabase->db(), database->m_name, database->m_version, databaseId)) {
        // FIXME: The Indexed Database specification does not have an error code dedicated to I/O errors.
        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
        transaction->abort();
        return;
    }
    callbacks->onSuccess(transaction);
}
예제 #20
0
void FrTextSpan::updateText(char *new_text, bool copy_text)
{
   FrSymbol *symINIT = FrSymbolTable::add(init_text_tag) ;
   if (!getMetaData(symINIT))
      {
      char *txt = getText() ;
      setMetaData(symINIT,new FrString(txt,strlen(txt),1,false),false) ;
      }
   FrFree(m_text) ;
   m_text = copy_text ? FrDupString(new_text) : new_text ;
   return ;
}
예제 #21
0
bool ccPolyline::initWith(ccPointCloud*& vertices, const ccPolyline& poly)
{
	bool success = true;
	if (!vertices)
	{
		ccPointCloud* cloud = dynamic_cast<ccPointCloud*>(poly.m_theAssociatedCloud);
		ccPointCloud* clone = cloud ? cloud->partialClone(&poly) : ccPointCloud::From(&poly);
		if (clone)
		{
			if (cloud)
				clone->setName(cloud->getName()); //as 'partialClone' adds the '.extract' suffix by default
			else
				clone->setGLTransformationHistory(poly.getGLTransformationHistory());
		}
		else
		{
			//not enough memory?
			ccLog::Warning("[ccPolyline::initWith] Not enough memory to duplicate vertices!");
			success = false;
		}

		vertices = clone;
	}

	if (vertices)
	{
		setAssociatedCloud(vertices);
		addChild(vertices);
		//vertices->setEnabled(false);
		assert(m_theAssociatedCloud);
		if (m_theAssociatedCloud)
			addPointIndex(0,m_theAssociatedCloud->size());
	}

	setClosed(poly.m_isClosed);
	set2DMode(poly.m_mode2D);
	setForeground(poly.m_foreground);
	setVisible(poly.isVisible());
	lockVisibility(poly.isVisiblityLocked());
	setColor(poly.m_rgbColor);
	setWidth(poly.m_width);
	showColors(poly.colorsShown());
	showVertices(poly.verticesShown());
	setVertexMarkerWidth(poly.getVertexMarkerWidth());
	setVisible(poly.isVisible());
	showArrow(m_showArrow,m_arrowIndex,m_arrowLength);
	setGlobalScale(poly.getGlobalScale());
	setGlobalShift(poly.getGlobalShift());
	setGLTransformationHistory(poly.getGLTransformationHistory());
	setMetaData(poly.metaData());
	
	return success;
}
예제 #22
0
void KdcDecoder::decodeMetaDataInternal(CameraMetaData *meta) {
  vector<TiffIFD*> data = mRootIFD->getIFDsWithTag(MODEL);

  if (data.empty())
    ThrowRDE("KDC Decoder: Model name found");
  if (!data[0]->hasEntry(MAKE))
    ThrowRDE("KDC Decoder: Make name not found");

  string make = data[0]->getEntry(MAKE)->getString();
  string model = data[0]->getEntry(MODEL)->getString();
  setMetaData(meta, make, model, "", 0);

  // Try the kodak hidden IFD for WB
  if (mRootIFD->hasEntryRecursive(KODAK_IFD2)) {
    TiffEntry *ifdoffset = mRootIFD->getEntryRecursive(KODAK_IFD2);
    TiffIFD *kodakifd = NULL;
    try {
      if (mRootIFD->endian == getHostEndianness())
        kodakifd = new TiffIFD(mFile, ifdoffset->getInt());
      else
        kodakifd = new TiffIFDBE(mFile, ifdoffset->getInt());

     if (kodakifd && kodakifd->hasEntryRecursive(KODAK_KDC_WB)) {
        TiffEntry *wb = kodakifd->getEntryRecursive(KODAK_KDC_WB);
        if (wb->count == 3) {
          const uint32 *tmp = wb->getIntArray();
          mRaw->metadata.wbCoeffs[0] = (float)tmp[0];
          mRaw->metadata.wbCoeffs[1] = (float)tmp[1];
          mRaw->metadata.wbCoeffs[2] = (float)tmp[2];
        }
      }
    } catch(TiffParserException e) {
      mRaw->setError(e.what());
    }
    if (kodakifd)
      delete kodakifd;
  }

  // Use the normal WB if available
  if (mRootIFD->hasEntryRecursive(KODAKWB)) {
    TiffEntry *wb = mRootIFD->getEntryRecursive(KODAKWB);
    if (wb->count == 734 || wb->count == 1502) {
      const uchar8 *tmp = wb->getData();
      mRaw->metadata.wbCoeffs[0] = (float)((((ushort16) tmp[148])<<8)|tmp[149])/256.0f;
      mRaw->metadata.wbCoeffs[1] = 1.0f;
      mRaw->metadata.wbCoeffs[2] = (float)((((ushort16) tmp[150])<<8)|tmp[151])/256.0f;
    }
  }
}
예제 #23
0
void ccGeoObject::init(bool singleSurface)
{
	//add metadata tag defining the ccCompass class type
	QVariantMap* map = new QVariantMap();
	if (singleSurface)
	{
		map->insert("ccCompassType", "GeoObjectSS"); //single-surface GeoObject
	}
	else
	{
		map->insert("ccCompassType", "GeoObject");
	}
	map->insert("GID", getGID());
	setMetaData(*map, true);
}
예제 #24
0
void SrwDecoder::decodeMetaDataInternal(CameraMetaData *meta) {
  mRaw->cfa.setCFA(CFA_RED, CFA_GREEN, CFA_GREEN2, CFA_BLUE);
  vector<TiffIFD*> data = mRootIFD->getIFDsWithTag(MODEL);

  if (data.empty())
    ThrowRDE("SRW Meta Decoder: Model name found");

  string make = data[0]->getEntry(MAKE)->getString();
  string model = data[0]->getEntry(MODEL)->getString();

  data = mRootIFD->getIFDsWithTag(CFAPATTERN);
  if (!this->checkCameraSupported(meta, make, model, "") && !data.empty() && data[0]->hasEntry(CFAREPEATPATTERNDIM)) {
    const unsigned short* pDim = data[0]->getEntry(CFAREPEATPATTERNDIM)->getShortArray();
    iPoint2D cfaSize(pDim[1], pDim[0]);
    if (cfaSize.x != 2 && cfaSize.y != 2)
      ThrowRDE("SRW Decoder: Unsupported CFA pattern size");

    const uchar8* cPat = data[0]->getEntry(CFAPATTERN)->getData();
    if (cfaSize.area() != data[0]->getEntry(CFAPATTERN)->count)
      ThrowRDE("SRW Decoder: CFA pattern dimension and pattern count does not match: %d.");

    for (int y = 0; y < cfaSize.y; y++) {
      for (int x = 0; x < cfaSize.x; x++) {
        uint32 c1 = cPat[x+y*cfaSize.x];
        CFAColor c2;
        switch (c1) {
            case 0:
              c2 = CFA_RED; break;
            case 1:
              c2 = CFA_GREEN; break;
            case 2:
              c2 = CFA_BLUE; break;
            default:
              c2 = CFA_UNKNOWN;
              ThrowRDE("SRW Decoder: Unsupported CFA Color.");
        }
        mRaw->cfa.setColorAt(iPoint2D(x, y), c2);
      }
    }
    printf("Camera CFA: %s\n", mRaw->cfa.asString().c_str());
  }

  int iso = 0;
  if (mRootIFD->hasEntryRecursive(ISOSPEEDRATINGS))
    iso = mRootIFD->getEntryRecursive(ISOSPEEDRATINGS)->getInt();

  setMetaData(meta, make, model, "", iso);
}
IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, IDBSQLiteDatabase* sqliteDatabase, IDBTransactionCoordinator* coordinator, IDBFactoryBackendImpl* factory, const String& uniqueIdentifier)
    : m_sqliteDatabase(sqliteDatabase)
    , m_id(InvalidId)
    , m_name(name)
    , m_version("")
    , m_identifier(uniqueIdentifier)
    , m_factory(factory)
    , m_transactionCoordinator(coordinator)
{
    ASSERT(!m_name.isNull());

    bool success = extractMetaData(m_sqliteDatabase->db(), m_name, m_version, m_id);
    ASSERT_UNUSED(success, success == (m_id != InvalidId));
    if (!setMetaData(m_sqliteDatabase->db(), m_name, m_version, m_id))
        ASSERT_NOT_REACHED(); // FIXME: Need better error handling.
    loadObjectStores();
}
예제 #26
0
 ABST::ABST() {
   memcpy(data + 4, "abst", 4);
   setVersion(0);
   setFlags(0);
   setBootstrapinfoVersion(0);
   setProfile(0);
   setLive(1);
   setUpdate(0);
   setTimeScale(1000);
   setCurrentMediaTime(0);
   setSmpteTimeCodeOffset(0);
   std::string empty;
   setMovieIdentifier(empty);
   setInt8(0, 30); //set serverentrycount to 0
   setInt8(0, 31); //set qualityentrycount to 0
   setDrmData(empty);
   setMetaData(empty);
 }
예제 #27
0
void PefDecoder::decodeMetaData(CameraMetaData *meta) {
  int iso = 0;
  mRaw->cfa.setCFA(CFA_RED, CFA_GREEN, CFA_GREEN2, CFA_BLUE);
  vector<TiffIFD*> data = mRootIFD->getIFDsWithTag(MODEL);

  if (data.empty())
    ThrowRDE("PEF Meta Decoder: Model name found");

  TiffIFD* raw = data[0];

  string make = raw->getEntry(MAKE)->getString();
  string model = raw->getEntry(MODEL)->getString();

  if (mRootIFD->hasEntryRecursive(ISOSPEEDRATINGS))
    iso = mRootIFD->getEntryRecursive(ISOSPEEDRATINGS)->getInt();

  setMetaData(meta, make, model, "", iso);
}
예제 #28
0
void ccGenericPointCloud::importParametersFrom(const ccGenericPointCloud* cloud)
{
	if (!cloud)
	{
		assert(false);
		return;
	}

	//original center
	setGlobalShift(cloud->getGlobalShift());
	setGlobalScale(cloud->getGlobalScale());
	//keep the transformation history!
	setGLTransformationHistory(cloud->getGLTransformationHistory());
	//custom point size
	setPointSize(cloud->getPointSize());
	//meta-data
	setMetaData(cloud->metaData());
}
예제 #29
0
void ccPolyline::importParametersFrom(const ccPolyline& poly)
{
	setClosed(poly.m_isClosed);
	set2DMode(poly.m_mode2D);
	setForeground(poly.m_foreground);
	setVisible(poly.isVisible());
	lockVisibility(poly.isVisiblityLocked());
	setColor(poly.m_rgbColor);
	setWidth(poly.m_width);
	showColors(poly.colorsShown());
	showVertices(poly.verticesShown());
	setVertexMarkerWidth(poly.getVertexMarkerWidth());
	setVisible(poly.isVisible());
	showArrow(m_showArrow,m_arrowIndex,m_arrowLength);
	setGlobalScale(poly.getGlobalScale());
	setGlobalShift(poly.getGlobalShift());
	setGLTransformationHistory(poly.getGLTransformationHistory());
	setMetaData(poly.metaData());
}
예제 #30
0
bool SqlStorage::verifyDatabase()
{
	// if the database is empty, it is not ok :-)
	if( database().tables().isEmpty() )
		return false;
	// check database metadata, throw an exception in case the version does not match:
	int version = 1;
	QString versionString = getMetaData(CHARM_DATABASE_VERSION_DESCRIPTOR);
	if (versionString != QString::null )
	{
		int value;
		bool ok;
		value = versionString.toInt( &ok );
		if( ok)
		{
			version = value;
		}
	}

        if ( version == CHARM_DATABASE_VERSION )
            return true;

        if( version > CHARM_DATABASE_VERSION )
            throw UnsupportedDatabaseVersionException( QObject::tr( "Database version is too new." ) );

        if ( version == CHARM_DATABASE_VERSION_BEFORE_TRACKABLE ) {
            SqlRaiiTransactor transactor( database() );
            QSqlQuery query( database() );
            query.prepare( QLatin1String("ALTER TABLE Tasks ADD trackable INTEGER") );
            if ( !runQuery( query ) )
                throw UnsupportedDatabaseVersionException( QObject::tr("Could not upgrade database from version %1 to version %2: %3").arg( QString::number( CHARM_DATABASE_VERSION_BEFORE_TRACKABLE ),
                                                                                                                                            QString::number( CHARM_DATABASE_VERSION ),
                                                                                                                                            query.lastError().text() ) );
            version = CHARM_DATABASE_VERSION;
            setMetaData( CHARM_DATABASE_VERSION_DESCRIPTOR, QString::number ( version ), transactor );
            transactor.commit();
            return true;
        }

        throw UnsupportedDatabaseVersionException( QObject::tr( "Database version is not supported." ) );
	return true;
}