void HDRStage::changed(ConstFieldMaskArg whichField, UInt32 origin, BitVector details) { Inherited::changed(whichField, origin, details); if(this->getRenderTarget() != NULL) { if((whichField & BlurWidthFieldMask) || (whichField & BufferFormatFieldMask)) { this->setRenderTarget(NULL); } if(whichField & ExposureFieldMask) { _TonemapShader->updateUniformVariable("exposure", getExposure()); } if(whichField & BlurAmountFieldMask) { _TonemapShader->addUniformVariable("blurAmount", getBlurAmount()); } if(whichField & EffectAmountFieldMask) { _TonemapShader->addUniformVariable("effectAmount", getEffectAmount()); } if(whichField & GammaFieldMask) { _TonemapShader->addUniformVariable("gamma", getGamma()); } } }
//-------------------------------------------------------------- void ofApp::setup(){ kinect.open(); kinect.initDepthSource(); kinect.initColorSource(); kinect.initInfraredSource(); kinect.initBodyIndexSource(); kinect.initBodySource(); gui.init(); //setup a gui panel for the 3D view auto worldView = gui.addWorld("World"); worldView->onDrawWorld += [this](ofCamera &) { this->kinect.drawWorld(); }; //setup a gui panel for every kinect source auto sources = kinect.getSources(); for(auto source : sources) { auto sourceWithTexture = dynamic_pointer_cast<ofBaseHasTexture>(source); if (sourceWithTexture) { auto panel = gui.add(sourceWithTexture->getTexture(), source->getTypeName()); //if it's the colour panel, let's do something special by writing some info on top auto colorSource = dynamic_pointer_cast<ofxKFW2::Source::Color>(source); if (colorSource) { panel->onDraw += [colorSource] (ofxCvGui::DrawArguments &) { stringstream message; message << "Exposure : " << colorSource->getExposure() << "us" << endl; message << "FrameInterval : " << colorSource->getFrameInterval() << "us" << endl; message << "Gain : " << colorSource->getGain() << endl; message << "Gamma : " << colorSource->getGamma() << endl; ofxCvGui::Utils::drawText(message.str(), 20, 60); }; } //if it's the depth panel, set some scaling auto depthSource = dynamic_pointer_cast<ofxKFW2::Source::Depth>(source); if (depthSource) { auto style = make_shared<ofxCvGui::Panels::Texture::Style>(); style->rangeMaximum = 0.25f; panel->setStyle(style); } //if it's the body index panel, let's draw the joints on top auto bodyIndexSource = dynamic_pointer_cast<ofxKFW2::Source::BodyIndex>(source); if(bodyIndexSource) { panel->onDrawImage += [this](ofxCvGui::DrawImageArguments & args) { auto bodySource = this->kinect.getBodySource(); const auto & bodies = bodySource->getBodies(); ofPushStyle(); { ofColor color(200, 100, 100); int index = 0; for (const auto & body : bodies) { color.setHueAngle((index * 50) % 360); ofSetColor(color); for (const auto & joint : body.joints) { ofDrawCircle(joint.second.getPositionInDepthMap(), 5); } index++; } } ofPopStyle(); }; } } } //if we press the 'c' key on the World panel, then toggle the camera's cursor. This works best when you fullscreen that panel worldView->onKeyboard += [this, worldView] (ofxCvGui::KeyboardArguments & args) { if (args.action == ofxCvGui::KeyboardArguments::Action::Pressed && args.key =='c') { worldView->getCamera().toggleCursorDrawEnabled(); } }; }
//-------------------------------------------------------------- void ofApp::setup() { kinect.open(); kinect.initDepth(); kinect.initColor(); kinect.initInfrared(); kinect.initBodyIndex(); gui.init(); //setup a gui panel for every kinect source auto sources = kinect.getSources(); for(auto source : sources) { auto drawingSource = dynamic_pointer_cast<ofBaseDraws>(source); ofxCvGui::PanelPtr panel; if (drawingSource) { panel = gui.add(*drawingSource, source->getTypeName()); auto colorSource = dynamic_pointer_cast<ofxKFW2::Source::Color>(source); if (colorSource) { panel->onDraw += [colorSource] (ofxCvGui::DrawArguments &) { stringstream message; message << "Exposure : " << colorSource->getExposure() << "us" << endl; message << "FrameInterval : " << colorSource->getFrameInterval() << "us" << endl; message << "Gain : " << colorSource->getGain() << endl; message << "Gamma : " << colorSource->getGamma() << endl; ofxCvGui::Utils::drawText(message.str(), 20, 60); }; } } } auto worldView = gui.addWorld("World"); worldView->onDrawWorld += [this] (ofCamera &) { //setup some point cloud properties for kicks glPushAttrib(GL_POINT_BIT); glPointSize(5.0f); glEnable(GL_POINT_SMOOTH); ofPushStyle(); //bind kinect color camera texture and draw mesh from depth (which has texture coordinates) this->kinect.getColor()->getTextureReference().bind(); //draw point cloud this->mesh.drawVertices(); //draw triangles ofSetColor(255, 150); this->mesh.drawWireframe(); //draw fills faded ofSetColor(255, 50); this->mesh.drawFaces(); //unbind colour camera this->kinect.getColor()->getTextureReference().unbind(); ofPopStyle(); //clear the point cloud drawing attributes glPopAttrib(); //draw the view cones of depth and colour cameras ofPushStyle(); ofNoFill(); ofSetLineWidth(2.0f); ofSetColor(100, 200, 100); this->kinect.getDepth()->drawFrustum(); ofSetColor(200, 100, 100); this->kinect.getColor()->drawFrustum(); ofPopStyle(); }; //if we press the 'c' key on the World panel, then toggle the camera's cursor. This works best when you fullscreen that panel worldView->onKeyboard += [this, worldView] (ofxCvGui::KeyboardArguments & args) { if (args.action == ofxCvGui::KeyboardArguments::Action::Pressed && args.key =='c') { worldView->getCamera().toggleCursorDraw(); } }; }
HDRStageDataTransitPtr HDRStage::setupStageData(Int32 iPixelWidth, Int32 iPixelHeight) { HDRStageDataTransitPtr returnValue = HDRStageData::createLocal(); if(returnValue == NULL) return returnValue; OSG::Thread::setCurrentLocalFlags(); // Scene Target FrameBufferObjectUnrecPtr pSceneFBO = FrameBufferObject::createLocal(); RenderBufferUnrecPtr pDepthBuffer = RenderBuffer ::createLocal(); pDepthBuffer->setInternalFormat(GL_DEPTH_COMPONENT24 ); TextureObjChunkUnrecPtr pSceneTex = TextureObjChunk::createLocal(); TextureEnvChunkUnrecPtr pSceneTexEnv = TextureEnvChunk::createLocal(); ImageUnrecPtr pImg = Image ::createLocal(); pImg->set(Image::OSG_RGB_PF, iPixelWidth, iPixelHeight, 1, 1, 1, 0.0, 0, Image::OSG_FLOAT32_IMAGEDATA, false); pSceneTex ->setImage (pImg ); pSceneTex ->setMinFilter (GL_LINEAR ); pSceneTex ->setMagFilter (GL_LINEAR ); pSceneTex ->setWrapS (GL_CLAMP_TO_EDGE ); pSceneTex ->setWrapT (GL_CLAMP_TO_EDGE ); pSceneTex ->setInternalFormat(getBufferFormat()); pSceneTexEnv->setEnvMode (GL_REPLACE ); TextureBufferUnrecPtr pSceneTexBuffer = TextureBuffer::createLocal(); pSceneTexBuffer->setTexture(pSceneTex); pSceneFBO->setSize(iPixelWidth, iPixelHeight); pSceneFBO->setColorAttachment(pSceneTexBuffer, 0); pSceneFBO->setDepthAttachment(pDepthBuffer ); pSceneFBO->editMFDrawBuffers()->push_back(GL_COLOR_ATTACHMENT0_EXT); setRenderTarget(pSceneFBO); // Shrink Target (w/2, h/2) FrameBufferObjectUnrecPtr pShrinkFBO = FrameBufferObject::createLocal(); TextureObjChunkUnrecPtr pShrinkTex = TextureObjChunk::createLocal(); TextureEnvChunkUnrecPtr pShrinkTexEnv = TextureEnvChunk::createLocal(); pImg = Image ::createLocal(); pImg->set(Image::OSG_RGB_PF, iPixelWidth / 2, iPixelHeight / 2, 1, 1, 1, 0.0, 0, Image::OSG_FLOAT32_IMAGEDATA, false); pShrinkTex ->setImage (pImg ); pShrinkTex ->setMinFilter (GL_LINEAR ); pShrinkTex ->setMagFilter (GL_LINEAR ); pShrinkTex ->setWrapS (GL_CLAMP_TO_EDGE ); pShrinkTex ->setWrapT (GL_CLAMP_TO_EDGE ); pShrinkTex ->setInternalFormat(getBufferFormat()); pShrinkTexEnv->setEnvMode (GL_REPLACE ); TextureBufferUnrecPtr pShrinkTexBuffer = TextureBuffer::createLocal(); pShrinkTexBuffer->setTexture(pShrinkTex); pShrinkFBO->setSize(iPixelWidth / 2, iPixelHeight / 2); pShrinkFBO->setColorAttachment(pShrinkTexBuffer, 0); pShrinkFBO->editMFDrawBuffers()->push_back(GL_COLOR_ATTACHMENT0_EXT); returnValue->setShrinkRenderTarget(pShrinkFBO); // blur (w/4, h/4) FrameBufferObjectUnrecPtr pBlurFBO = FrameBufferObject::createLocal(); TextureObjChunkUnrecPtr pBlurTex1 = TextureObjChunk ::createLocal(); TextureEnvChunkUnrecPtr pBlurTex1Env = TextureEnvChunk ::createLocal(); pImg = Image::createLocal(); pImg->set(Image::OSG_RGB_PF, iPixelWidth / 4, iPixelHeight / 4, 1, 1, 1, 0.0, 0, Image::OSG_FLOAT32_IMAGEDATA, false); pBlurTex1 ->setImage (pImg ); pBlurTex1 ->setMinFilter (GL_LINEAR ); pBlurTex1 ->setMagFilter (GL_LINEAR ); pBlurTex1 ->setWrapS (GL_CLAMP_TO_EDGE ); pBlurTex1 ->setWrapT (GL_CLAMP_TO_EDGE ); pBlurTex1 ->setInternalFormat(getBufferFormat()); pBlurTex1Env->setEnvMode (GL_REPLACE ); TextureBufferUnrecPtr pBlurTexBuffer1 = TextureBuffer::createLocal(); pBlurTexBuffer1->setTexture(pBlurTex1); TextureObjChunkUnrecPtr pBlurTex2 = TextureObjChunk::createLocal(); TextureEnvChunkUnrecPtr pBlurTex2Env = TextureEnvChunk::createLocal(); pImg = Image::createLocal(); pImg->set(Image::OSG_RGB_PF, iPixelWidth / 4, iPixelHeight / 4, 1, 1, 1, 0.0, 0, Image::OSG_FLOAT32_IMAGEDATA, false); pBlurTex2 ->setImage (pImg ); pBlurTex2 ->setMinFilter (GL_LINEAR ); pBlurTex2 ->setMagFilter (GL_LINEAR ); pBlurTex2 ->setWrapS (GL_CLAMP_TO_EDGE ); pBlurTex2 ->setWrapT (GL_CLAMP_TO_EDGE ); pBlurTex2 ->setInternalFormat(getBufferFormat()); pBlurTex2Env->setEnvMode (GL_REPLACE ); TextureBufferUnrecPtr pBlurTexBuffer2 = TextureBuffer::createLocal(); pBlurTexBuffer2->setTexture(pBlurTex2); pBlurFBO->setSize(iPixelWidth / 4, iPixelHeight / 4); pBlurFBO->setColorAttachment(pBlurTexBuffer1, 0); pBlurFBO->setColorAttachment(pBlurTexBuffer2, 1); returnValue->setBlurRenderTarget(pBlurFBO); // general mat chunk MaterialChunkUnrecPtr pMatChunk = MaterialChunk::createLocal(); pMatChunk->setLit(false); // tone map material ChunkMaterialUnrecPtr pTonemapMat = ChunkMaterial ::createLocal(); pTonemapMat->addChunk(pMatChunk ); pTonemapMat->addChunk(pSceneTex, 0); pTonemapMat->addChunk(pSceneTexEnv, 0); pTonemapMat->addChunk(pBlurTex1, 1); pTonemapMat->addChunk(pBlurTex1Env, 1); SimpleSHLChunkUnrecPtr pTonemapShader = generateHDRFragmentProgram(); pTonemapShader->addUniformVariable("sceneTex", 0); pTonemapShader->addUniformVariable("blurTex", 1); pTonemapShader->addUniformVariable("blurAmount", getBlurAmount ()); pTonemapShader->addUniformVariable("exposure", getExposure ()); pTonemapShader->addUniformVariable("effectAmount", getEffectAmount()); pTonemapShader->addUniformVariable("gamma", getGamma ()); pTonemapMat->addChunk(pTonemapShader, 0); returnValue->setToneMappingMaterial(pTonemapMat); // Shrink material ChunkMaterialUnrecPtr pShrinkMat = ChunkMaterial::createLocal(); pShrinkMat->addChunk(pMatChunk ); pShrinkMat->addChunk(pSceneTex, 0); pShrinkMat->addChunk(pSceneTexEnv, 0); SimpleSHLChunkUnrecPtr pShrinkShader = generate2DShrinkHalfFilterFP(); pShrinkShader->addUniformVariable("inputTex", 0); pShrinkMat->addChunk(pShrinkShader, 0); returnValue->setShrinkMaterial(pShrinkMat); // Blur material ChunkMaterialUnrecPtr pBlurMat = ChunkMaterial::createLocal(); pBlurMat->addChunk(pMatChunk ); pBlurMat->addChunk(pShrinkTex, 0); pBlurMat->addChunk(pShrinkTexEnv, 0); pBlurMat->addChunk(pBlurTex1, 1); pBlurMat->addChunk(pBlurTex1Env, 1); pBlurMat->addChunk(pBlurTex2, 2); pBlurMat->addChunk(pBlurTex2Env, 2); pBlurMat->addChunk(pShrinkShader, 0); returnValue->setBlurMaterial(pBlurMat); // generate blur fragment programs SimpleSHLChunkUnrecPtr pHBlurShader = generate1DConvolutionFilterFP(getBlurWidth(), false, true, iPixelWidth / 2, iPixelHeight / 2); pHBlurShader->addUniformVariable("inputTex", 0); returnValue->setHBlurShader(pHBlurShader); // VBlur Override SimpleSHLChunkUnrecPtr pVBlurShader = generate1DConvolutionFilterFP(getBlurWidth(), true, true, iPixelWidth / 2, iPixelHeight / 2); pVBlurShader->addUniformVariable("inputTex", 1); returnValue->setVBlurShader(pVBlurShader); OSG::Thread::resetCurrentLocalFlags(); Thread::getCurrentChangeList()->commitChanges(); return returnValue; }
//[20091123 exif Ratnesh void CameraHal::CreateExif(unsigned char* pInThumbnailData,int Inthumbsize,unsigned char* pOutExifBuf,int& OutExifSize,int flag) { int w =0, h = 0; char getSoftver[20]= {0,}; double temp_denominator; //ExifInfo.exposureTime.denominator int orientationValue = getOrientation(); HAL_PRINT("CreateExif orientationValue = %d \n", orientationValue); ExifCreator* mExifCreator = new ExifCreator(); unsigned int ExifSize = 0; ExifInfoStructure ExifInfo; char ver_date[5] = {NULL,}; unsigned short tempISO = 0; struct v4l2_exif exifobj; // To read values from driver if(mCameraIndex==MAIN_CAMERA) { getExifInfoFromDriver(&exifobj); } memset(&ExifInfo, NULL, sizeof(ExifInfoStructure)); strcpy( (char *)&ExifInfo.maker, "SAMSUNG"); strcpy( (char *)&ExifInfo.model, "YP-GI1"); // Usys_sadang EK14 YP-GS1 mParameters.getPreviewSize(&w, &h); mParameters.getPictureSize((int*)&ExifInfo.imageWidth , (int*)&ExifInfo.imageHeight); mParameters.getPictureSize((int*)&ExifInfo.pixelXDimension, (int*)&ExifInfo.pixelYDimension); struct tm *t = NULL; time_t nTime; time(&nTime); t = localtime(&nTime); if(t != NULL) { sprintf((char *)&ExifInfo.dateTimeOriginal, "%4d:%02d:%02d %02d:%02d:%02d", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); sprintf((char *)&ExifInfo.dateTimeDigitized, "%4d:%02d:%02d %02d:%02d:%02d", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); sprintf((char *)&ExifInfo.dateTime, "%4d:%02d:%02d %02d:%02d:%02d", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); } memset(getSoftver, 0, sizeof(getSoftver)); property_get("ro.build.PDA", getSoftver, ""); //LOGI("softver_FW = %s",getSoftver); //sprintf((char *)&ExifInfo.software, "YP-%s", getSoftver); //S/W version sprintf((char *)&ExifInfo.software, "YP-GI1 XXLF1"); //S/W version if(mCameraIndex==MAIN_CAMERA) { #if 0 int cam_ver = GetCamera_version(); ExifInfo.Camversion[0] = (cam_ver & 0xFF); ExifInfo.Camversion[1] = ((cam_ver >> 8) & 0xFF); ExifInfo.Camversion[2] = ((cam_ver >> 16) & 0xFF); ExifInfo.Camversion[3] = ((cam_ver >> 24) & 0xFF); HAL_PRINT("CreateExif GetCamera_version =[%x][%x][%x][%x]\n", ExifInfo.Camversion[2],ExifInfo.Camversion[3],ExifInfo.Camversion[0],ExifInfo.Camversion[1]); sprintf((char *)&ExifInfo.software, "fw %02d.%02d prm %02d.%02d", ExifInfo.Camversion[2],ExifInfo.Camversion[3],ExifInfo.Camversion[0],ExifInfo.Camversion[1]); //S/W version #endif if(mThumbnailWidth > 0 && mThumbnailHeight > 0) { ExifInfo.hasThumbnail = true; ExifInfo.thumbStream = pInThumbnailData; ExifInfo.thumbSize = Inthumbsize; ExifInfo.thumbImageWidth = mThumbnailWidth; ExifInfo.thumbImageHeight = mThumbnailHeight; } else { ExifInfo.hasThumbnail = false; } ExifInfo.exposureProgram = 3; ExifInfo.exposureMode = 0; ExifInfo.contrast = convertToExifLMH(getContrast(), 2); ExifInfo.fNumber.numerator = 28; ExifInfo.fNumber.denominator = 10; ExifInfo.aperture.numerator = 26; ExifInfo.aperture.denominator = 10; ExifInfo.maxAperture.numerator = 297; ExifInfo.maxAperture.denominator = 100; ExifInfo.focalLength.numerator = 2700; ExifInfo.focalLength.denominator = 1000; //[ 2010 05 01 exif ExifInfo.shutterSpeed.numerator = exifobj.TV_Value; ExifInfo.shutterSpeed.denominator = 100; HAL_PRINT("shutterSpeed.numerator = %d \n",ExifInfo.shutterSpeed.numerator); ExifInfo.exposureTime.numerator = 1; temp_denominator = (double)exifobj.shutter_speed_denominator /400.0; ExifInfo.exposureTime.denominator = (1.0 /temp_denominator) * 1000; //ExifInfo.exposureTime.denominator = (unsigned int)pow(2.0, ((double)exifobj.TV_Value/100.0)); HAL_PRINT("ExifInfo.exposureTime.denominator = %d \n",ExifInfo.exposureTime.denominator); //] ExifInfo.brightness.numerator = 5; ExifInfo.brightness.denominator = 9; //ExifInfo.iso = 1; ExifInfo.isoSpeedRating = exifobj.iso; //add by yongjin - phillit ExifInfo.flash = 0; //flash OFF #if 0 // Flash // bit 0 -whether the flash fired // bit 1,2 -status of returned light // bit 3,4 - indicating the camera's flash mode // bit 5 -presence of a flash function // bit 6 - red-eye mode // refer to flash_mode[] at CameraHal.cpp // off = 1 // on = 2 // auto = 3 // Todo : Need to implement how HAL can recognize existance of flash // if( ! isFlashExist ) // pseudo code // ExifInfo.flash = 32; // bit 5 - No flash function. // else { HAL_PRINT("createExif - flashmode = %d flash result = %d", mPreviousFlashMode, ExifInfo.flash); // bit 0 ExifInfo.flash = ExifInfo.flash | exifobj.flash; // bit 3,4 if(mPreviousFlashMode == 3) // Flashmode auto ExifInfo.flash = ExifInfo.flash |24; // bit 6 // Todo : Need to implement about red-eye // if(mPreviousFlashMode == ??) // Flashmode red-eye // ExifInfo.flash = ExifInfo.flash | 64; } #endif HAL_PRINT("Main Orientation = %d\n",orientationValue); switch(orientationValue) { case 0: ExifInfo.orientation = 1 ; break; case 90: ExifInfo.orientation = 6 ; break; case 180: ExifInfo.orientation = 3 ; break; case 270: ExifInfo.orientation = 8 ; break; default: ExifInfo.orientation = 1 ; break; } #if 0 //calIsoValue //[ 2010 05 01 exif double calIsoValue = 0; calIsoValue = pow(2.0,((double)exifobj.SV_Value/100.0))*3.125; //] if(calIsoValue < 8.909) { tempISO = 0; } else if(calIsoValue >=8.909 && calIsoValue < 11.22) { tempISO = 10; } else if(calIsoValue >=11.22 && calIsoValue < 14.14) { tempISO = 12; } else if(calIsoValue >=14.14 && calIsoValue < 17.82) { tempISO = 16; } else if(calIsoValue >=17.82 && calIsoValue < 22.45) { tempISO = 20; } else if(calIsoValue >=22.45 && calIsoValue < 28.28) { tempISO = 25; } else if(calIsoValue >=28.28 && calIsoValue < 35.64) { tempISO = 32; } else if(calIsoValue >=35.64 && calIsoValue < 44.90) { tempISO = 40; } else if(calIsoValue >=44.90 && calIsoValue < 56.57) { tempISO = 50; } else if(calIsoValue >=56.57 && calIsoValue < 71.27) { tempISO = 64; } else if(calIsoValue >=71.27 && calIsoValue < 89.09) { tempISO = 80; } else if(calIsoValue >=89.09 && calIsoValue < 112.2) { tempISO = 100; } else if(calIsoValue >=112.2 && calIsoValue < 141.4) { tempISO = 125; } else if(calIsoValue >=141.4 && calIsoValue < 178.2) { tempISO = 160; } else if(calIsoValue >=178.2 && calIsoValue < 224.5) { tempISO = 200; } else if(calIsoValue >=224.5 && calIsoValue < 282.8) { tempISO = 250; } else if(calIsoValue >=282.8 && calIsoValue < 356.4) { tempISO = 320; } else if(calIsoValue >=356.4 && calIsoValue < 449.0) { tempISO = 400; } else if(calIsoValue >=449.0 && calIsoValue < 565.7) { tempISO = 500; } else if(calIsoValue >=565.7 && calIsoValue < 712.7) { tempISO = 640; } else if(calIsoValue >=712.7 && calIsoValue < 890.9) { tempISO = 800; } else if(calIsoValue >=890.9 && calIsoValue < 1122) { tempISO = 1000; } else if(calIsoValue >=1122 && calIsoValue < 1414) { tempISO = 1250; } else if(calIsoValue >=1414 && calIsoValue < 1782) { tempISO = 160; } else if(calIsoValue >=1782 && calIsoValue < 2245) { tempISO = 2000; } else if(calIsoValue >=2245 && calIsoValue < 2828) { tempISO = 2500; } else if(calIsoValue >=2828 && calIsoValue < 3564) { tempISO = 3200; } else if(calIsoValue >=3564 && calIsoValue < 4490) { tempISO = 4000; } else if(calIsoValue >=4490 && calIsoValue < 5657) { tempISO = 5000; } else if(calIsoValue >=5657 && calIsoValue < 7127) { tempISO = 6400; } else { tempISO = 8000; } #endif //calIsoValue if(mPreviousSceneMode <= 1) { ExifInfo.meteringMode = mPreviousMetering; if(mPreviousWB <= 1) { ExifInfo.whiteBalance = 0; } else { ExifInfo.whiteBalance = 1; } ExifInfo.saturation = convertToExifLMH(getSaturation(), 2); ExifInfo.sharpness = convertToExifLMH(getSharpness(), 2); #if 0 //mPreviousISO switch(mPreviousISO) { case 2: ExifInfo.isoSpeedRating = 50; break; case 3: ExifInfo.isoSpeedRating = 100; break; case 4: ExifInfo.isoSpeedRating = 200; break; case 5: ExifInfo.isoSpeedRating = 400; break; case 6: ExifInfo.isoSpeedRating = 800; break; default: ExifInfo.isoSpeedRating = tempISO; break; } #endif switch(getExposure()) { case -4: ExifInfo.exposureBias.numerator = -20; break; case -3: ExifInfo.exposureBias.numerator = -15; break; case -2: ExifInfo.exposureBias.numerator = -10; break; case -1: ExifInfo.exposureBias.numerator = -5; break; case 0: ExifInfo.exposureBias.numerator = 0; break; case 1: ExifInfo.exposureBias.numerator = 5; break; case 2: ExifInfo.exposureBias.numerator = 10; break; case 3: ExifInfo.exposureBias.numerator = 15; break; case 4: ExifInfo.exposureBias.numerator = 20; break; default: ExifInfo.exposureBias.numerator = 0; break; } ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 0; } else { switch(mPreviousSceneMode) { case 3://sunset ExifInfo.meteringMode = mPreviousMetering; ExifInfo.whiteBalance = 1; ExifInfo.saturation = 0; ExifInfo.sharpness = 0; //ExifInfo.isoSpeedRating = tempISO; ExifInfo.isoSpeedRating = exifobj.iso; ExifInfo.exposureBias.numerator = 0; ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 4; break; case 4://dawn ExifInfo.meteringMode = mPreviousMetering; ExifInfo.whiteBalance = 1; ExifInfo.saturation = 0; ExifInfo.sharpness = 0; //ExifInfo.isoSpeedRating = tempISO; ExifInfo.isoSpeedRating = exifobj.iso; ExifInfo.exposureBias.numerator = 0; ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 4; break; case 5://candlelight ExifInfo.meteringMode = mPreviousMetering; ExifInfo.whiteBalance = 1; ExifInfo.saturation = 0; ExifInfo.sharpness = 0; //ExifInfo.isoSpeedRating = tempISO; ExifInfo.isoSpeedRating = exifobj.iso; ExifInfo.exposureBias.numerator = 0; ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 4; break; case 6://beach & snow ExifInfo.meteringMode = mPreviousMetering; ExifInfo.whiteBalance = 0; ExifInfo.saturation = 2; ExifInfo.sharpness = 0; ExifInfo.isoSpeedRating = 50; ExifInfo.exposureBias.numerator = 10; ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 4; break; case 7://againstlight ExifInfo.whiteBalance = 0; ExifInfo.saturation = 0; ExifInfo.sharpness = 0; //ExifInfo.isoSpeedRating = tempISO; ExifInfo.isoSpeedRating = exifobj.iso; if(mPreviousFlashMode <= 1) { ExifInfo.meteringMode = mPreviousMetering; } else { ExifInfo.meteringMode = mPreviousMetering; } ExifInfo.exposureBias.numerator = 0; ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 4; break; case 8://text ExifInfo.meteringMode = mPreviousMetering; ExifInfo.whiteBalance = 0; ExifInfo.saturation = 0; ExifInfo.sharpness = 2; //ExifInfo.isoSpeedRating = tempISO; ExifInfo.isoSpeedRating = exifobj.iso; ExifInfo.exposureBias.numerator = 0; ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 4; break; case 9://night ExifInfo.meteringMode = mPreviousMetering; ExifInfo.whiteBalance = 0; ExifInfo.saturation = 0; ExifInfo.sharpness = 0; //ExifInfo.isoSpeedRating = tempISO; ExifInfo.isoSpeedRating = exifobj.iso; ExifInfo.exposureBias.numerator = 0; ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 3; break; case 10://landscape ExifInfo.meteringMode = mPreviousMetering; ExifInfo.whiteBalance = 0; ExifInfo.saturation = 2; ExifInfo.sharpness = 2; //ExifInfo.isoSpeedRating = tempISO; ExifInfo.isoSpeedRating = exifobj.iso; ExifInfo.exposureBias.numerator = 0; ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 1; break; case 11://fireworks ExifInfo.meteringMode = mPreviousMetering; ExifInfo.whiteBalance = 0; ExifInfo.saturation = 0; ExifInfo.sharpness = 0; ExifInfo.isoSpeedRating = 50; ExifInfo.exposureBias.numerator = 0; ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 4; break; case 12://portrait ExifInfo.meteringMode = mPreviousMetering; ExifInfo.whiteBalance = 0; ExifInfo.saturation = 0; ExifInfo.sharpness = 1; //ExifInfo.isoSpeedRating = tempISO; ExifInfo.isoSpeedRating = exifobj.iso; ExifInfo.exposureBias.numerator = 0; ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 2; break; case 13://fallcolor ExifInfo.meteringMode = mPreviousMetering; ExifInfo.whiteBalance = 0; ExifInfo.saturation = 2; ExifInfo.sharpness = 0; //ExifInfo.isoSpeedRating = tempISO; ExifInfo.isoSpeedRating = exifobj.iso; ExifInfo.exposureBias.numerator = 0; ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 4; break; case 14://indoors ExifInfo.meteringMode = mPreviousMetering; ExifInfo.whiteBalance = 0; ExifInfo.saturation = 2; ExifInfo.sharpness = 0; ExifInfo.isoSpeedRating = 200; ExifInfo.exposureBias.numerator = 0; ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 4; break; case 15://sports ExifInfo.meteringMode = mPreviousMetering; ExifInfo.whiteBalance = 0; ExifInfo.saturation = 0; ExifInfo.sharpness = 0; //ExifInfo.isoSpeedRating = tempISO; ExifInfo.isoSpeedRating = exifobj.iso; ExifInfo.exposureBias.numerator = 0; ExifInfo.exposureBias.denominator = 10; ExifInfo.sceneCaptureType = 4; break; } } }