📄 jpgapi.c
字号:
ExposureProgram[0] =jCtx->ExifInfo->ExposureProgram;
ExposureProgramChar[0] = (unsigned char)(ExposureProgram[0]);
ExposureProgramChar[1] = (unsigned char)(ExposureProgram[0]>>8);
ExposureProgramChar[2] = (unsigned char)(ExposureProgram[0]>>16);
ExposureProgramChar[3] = (unsigned char)(ExposureProgram[0]>>24);
memcpy (tempExif, ExposureProgramChar, 4);
tempExif += 4 ;
///////////////ENTRY NO 4 :ISOSpeedRatings ////////////////////////
//write ISOSpeedRatings tag
memcpy (tempExif, ISOSpeedRatingstag, 2);
tempExif += 2 ;
//write format
memcpy (tempExif, ISOSpeedRatingsformat, 2);
tempExif += 2 ;
//write no of component
memcpy (tempExif, NcomponentISOSpeedRatings, 4);
tempExif += 4 ;
//write orientation mode
ISOSpeedRatings[0] = 1;
ISOSpeedRatings[1] = 2;
ISOSpeedRatingsChar[0] = (unsigned char)(ISOSpeedRatings[0]);
ISOSpeedRatingsChar[1] = (unsigned char)(ISOSpeedRatings[0]>>8);
ISOSpeedRatingsChar[2] = (unsigned char)(ISOSpeedRatings[1]);
ISOSpeedRatingsChar[3] = (unsigned char)(ISOSpeedRatings[1]>>8);
memcpy (tempExif, ISOSpeedRatingsChar, 4);
tempExif += 4 ;
///////////////ENTRY NO 5 : BRIGHTNESS OF THE IMAGE////////////////////////
//write BRIGHTNESS tag
memcpy (tempExif, Brightnesstag, 2);
tempExif += 2 ;
//write format
memcpy (tempExif, Brightnessformat, 2);
tempExif += 2 ;
//write no of component
memcpy (tempExif, NcomponentBrightness, 4); //sanjeev
tempExif += 4 ;
//write X - Resolution
santemp=(int)(offset);
Brightnessoffchar[0]=(unsigned char)santemp;
Brightnessoffchar[1]=(unsigned char)(santemp>>8);
Brightnessoffchar[2]=(unsigned char)(santemp>>16);
Brightnessoffchar[3]=(unsigned char)(santemp>>24);
//write the X-Resolution offset into the bitstream
memcpy (tempExif, Brightnessoffchar, 4);
tempExif += 4 ;
BrightnessNum[0] = jCtx->ExifInfo->BrightnessNum;
BrightnessDen[0] = jCtx->ExifInfo->BrightnessDen;
BrightnessNumChar[0]=(unsigned char)BrightnessNum[0];
BrightnessNumChar[1]=(unsigned char)(BrightnessNum[0]>>8);
BrightnessNumChar[2]=(unsigned char)(BrightnessNum[0]>>16);
BrightnessNumChar[3]=(unsigned char)(BrightnessNum[0]>>24);
BrightnessDenChar[0]=(unsigned char)BrightnessDen[0];
BrightnessDenChar[1]=(unsigned char)(BrightnessDen[0]>>8);
BrightnessDenChar[2]=(unsigned char)(BrightnessDen[0]>>16);
BrightnessDenChar[3]=(unsigned char)(BrightnessDen[0]>>24);
//WRITE THE X - RESOLUTION NUMERATOR
memcpy (startoftiff+santemp, BrightnessNumChar, 4);
memcpy (startoftiff+santemp+4, BrightnessDenChar, 4);
offset+=48;
///////////////ENTRY NO 6 : EXPOSURE BIAS OF THE IMAGE////////////////////////
//write BRIGHTNESS tag
memcpy (tempExif, ExposureBiastag, 2);
tempExif += 2 ;
//write format
memcpy (tempExif, ExposureBiasformat, 2);
tempExif += 2 ;
//write no of component
memcpy (tempExif, NcomponentExposureBias, 4); //sanjeev
tempExif += 4 ;
//write EXPOSURE BIAS
santemp=(int)(offset);
ExposureBiasoffchar[0]=(unsigned char)santemp;
ExposureBiasoffchar[1]=(unsigned char)(santemp>>8);
ExposureBiasoffchar[2]=(unsigned char)(santemp>>16);
ExposureBiasoffchar[3]=(unsigned char)(santemp>>24);
//write the EXPOSURE BIAS offset into the bitstream
memcpy (tempExif, ExposureBiasoffchar, 4);
tempExif += 4 ;
ExposureBiasNum[0]=jCtx->ExifInfo->ExposureBiasNum;
ExposureBiasDen[0]=jCtx->ExifInfo->ExposureBiasDen;
ExposureBiasNumChar[0]=(unsigned char)ExposureBiasNum[0];
ExposureBiasNumChar[1]=(unsigned char)(ExposureBiasNum[0]>>8);
ExposureBiasNumChar[2]=(unsigned char)(ExposureBiasNum[0]>>16);
ExposureBiasNumChar[3]=(unsigned char)(ExposureBiasNum[0]>>24);
ExposureBiasDenChar[0]=(unsigned char)ExposureBiasDen[0];
ExposureBiasDenChar[1]=(unsigned char)(ExposureBiasDen[0]>>8);
ExposureBiasDenChar[2]=(unsigned char)(ExposureBiasDen[0]>>16);
ExposureBiasDenChar[3]=(unsigned char)(ExposureBiasDen[0]>>24);
//WRITE THE EXPOSURE BIAS NUMERATOR
memcpy (startoftiff+santemp, ExposureBiasNumChar, 4);
memcpy (startoftiff+santemp+4, ExposureBiasDenChar, 4);
offset+=48;
///////////////ENTRY NO 7 : SUBJECT DISTANCE////////////////////////
//write SUBJECT DISTANCE tag
memcpy (tempExif, SubjectDistancetag, 2);
tempExif += 2 ;
//write format
memcpy (tempExif, SubjectDistanceformat, 2);
tempExif += 2 ;
//write no of component
memcpy (tempExif, NcomponentSubjectDistance, 4); //sanjeev
tempExif += 4 ;
//write SUBJECT DISTANCE
santemp=(int)(offset);
SubjectDistanceoffchar[0]=(unsigned char)santemp;
SubjectDistanceoffchar[1]=(unsigned char)(santemp>>8);
SubjectDistanceoffchar[2]=(unsigned char)(santemp>>16);
SubjectDistanceoffchar[3]=(unsigned char)(santemp>>24);
//write the SUBJECT DISTANCE offset into the bitstream
memcpy (tempExif, SubjectDistanceoffchar, 4);
tempExif += 4 ;
SubjectDistanceNum[0]=jCtx->ExifInfo->SubjectDistanceNum;
SubjectDistanceDen[0]=jCtx->ExifInfo->SubjectDistanceDen;
SubjectDistanceNumChar[0]=(unsigned char)SubjectDistanceNum[0];
SubjectDistanceNumChar[1]=(unsigned char)(SubjectDistanceNum[0]>>8);
SubjectDistanceNumChar[2]=(unsigned char)(SubjectDistanceNum[0]>>16);
SubjectDistanceNumChar[3]=(unsigned char)(SubjectDistanceNum[0]>>24);
SubjectDistanceDenChar[0]=(unsigned char)SubjectDistanceDen[0];
SubjectDistanceDenChar[1]=(unsigned char)(SubjectDistanceDen[0]>>8);
SubjectDistanceDenChar[2]=(unsigned char)(SubjectDistanceDen[0]>>16);
SubjectDistanceDenChar[3]=(unsigned char)(SubjectDistanceDen[0]>>24);
//WRITE THE SUBJECT DISTANCE NUMERATOR
memcpy (startoftiff+santemp, SubjectDistanceNumChar, 4);
memcpy (startoftiff+santemp+4, SubjectDistanceDenChar, 4);
offset+=48;
///////////////ENTRY NO 8 :METERING MODE////////////////////////
//write METERING tag
memcpy (tempExif, MeteringModetag, 2);
tempExif += 2 ;
//write format
memcpy (tempExif, MeteringModeformat, 2);
tempExif += 2 ;
//write no of component
memcpy (tempExif, NcomponentMeteringMode, 4);
tempExif += 4 ;
//write METERING mode
MeteringMode[0] = jCtx->ExifInfo->MeteringMode;
MeteringModeChar[0] = (unsigned char)(MeteringMode[0]);
MeteringModeChar[1] = (unsigned char)(MeteringMode[0]>>8);
MeteringModeChar[2] = (unsigned char)(MeteringMode[0]>>16);
MeteringModeChar[3] = (unsigned char)(MeteringMode[0]>>24);
memcpy (tempExif, MeteringModeChar, 4);
tempExif += 4 ;
///////////////ENTRY NO 9 :FLASH////////////////////////
//write FLASH tag
memcpy (tempExif, Flashtag, 2);
tempExif += 2 ;
//write format
memcpy (tempExif, Flashformat, 2);
tempExif += 2 ;
//write no of component
memcpy (tempExif, NcomponentFlash, 4);
tempExif += 4 ;
//write FLASH mode
Flash[0]= jCtx->ExifInfo->Flash;
FlashChar[0] = (unsigned char)(Flash[0]);
FlashChar[1] = (unsigned char)(Flash[0]>>8);
FlashChar[2] = (unsigned char)(Flash[0]>>16);
FlashChar[3] = (unsigned char)(Flash[0]>>24);
memcpy (tempExif, FlashChar, 4);
tempExif += 4 ;
///////////////ENTRY NO 10 : FOCAL LENGTH////////////////////////
//write FOCAL LENGTH tag
memcpy (tempExif, FocalLengthtag, 2);
tempExif += 2 ;
//write format
memcpy (tempExif, FocalLengthformat, 2);
tempExif += 2 ;
//write no of component
memcpy (tempExif, NcomponentFocalLength, 4); //sanjeev
tempExif += 4 ;
//write FOCAL LENGTH
santemp=(int)(offset);
FocalLengthoffchar[0]=(unsigned char)santemp;
FocalLengthoffchar[1]=(unsigned char)(santemp>>8);
FocalLengthoffchar[2]=(unsigned char)(santemp>>16);
FocalLengthoffchar[3]=(unsigned char)(santemp>>24);
//write the FOCAL LENGTH offset into the bitstream
memcpy (tempExif, FocalLengthoffchar, 4);
tempExif += 4 ;
FocalLengthNum[0]=jCtx->ExifInfo->FocalLengthNum;
FocalLengthDen[0]=jCtx->ExifInfo->FocalLengthDen;
FocalLengthNumChar[0]=(unsigned char)FocalLengthNum[0];
FocalLengthNumChar[1]=(unsigned char)(FocalLengthNum[0]>>8);
FocalLengthNumChar[2]=(unsigned char)(FocalLengthNum[0]>>16);
FocalLengthNumChar[3]=(unsigned char)(FocalLengthNum[0]>>24);
FocalLengthDenChar[0]=(unsigned char)FocalLengthDen[0];
FocalLengthDenChar[1]=(unsigned char)(FocalLengthDen[0]>>8);
FocalLengthDenChar[2]=(unsigned char)(FocalLengthDen[0]>>16);
FocalLengthDenChar[3]=(unsigned char)(FocalLengthDen[0]>>24);
//WRITE THE FOCAL LENGTH NUMERATOR
memcpy (startoftiff+santemp, FocalLengthNumChar, 4);
memcpy (startoftiff+santemp+4, FocalLengthDenChar, 4);
offset+=48;
///////////////ENTRY NO 11 :Width////////////////////////
//write Width tag
memcpy (tempExif, Widthtag, 2);
tempExif += 2 ;
//write format
memcpy (tempExif, Widthformat, 2);
tempExif += 2 ;
//write no of component
memcpy (tempExif, NcomponentWidth, 4);
tempExif += 4 ;
//write Width
Width[0]=jCtx->ExifInfo->Width;
WidthChar[0] = (unsigned char)(Width[0]);
WidthChar[1] = (unsigned char)(Width[0]>>8);
WidthChar[2] = (unsigned char)(Width[0]>>16);
WidthChar[3] = (unsigned char)(Width[0]>>24);
memcpy (tempExif, WidthChar, 4);
tempExif += 4 ;
///////////////ENTRY NO 12 :Height////////////////////////
//write Height tag
memcpy (tempExif, Heighttag, 2);
tempExif += 2 ;
//write format
memcpy (tempExif, Heightformat, 2);
tempExif += 2 ;
//write no of component
memcpy (tempExif, NcomponentHeight, 4);
tempExif += 4 ;
//write Height
Height[0]=jCtx->ExifInfo->Height;
HeightChar[0] = (unsigned char)(Height[0]);
HeightChar[1] = (unsigned char)(Height[0]>>8);
HeightChar[2] = (unsigned char)(Height[0]>>16);
HeightChar[3] = (unsigned char)(Height[0]>>24);
memcpy (tempExif, HeightChar, 4);
tempExif += 4 ;
///////////////ENTRY NO 13 :COLORSPACE////////////////////////
//write ExposureProgram tag
memcpy (tempExif, ColorSpacetag, 2);
tempExif += 2 ;
//write format
memcpy (tempExif, ColorSpaceformat, 2);
tempExif += 2 ;
//write no of component
memcpy (tempExif, NcomponentColorSpace, 4);
tempExif += 4 ;
//write orientation mode
ColorSpace [0]= jCtx->ExifInfo->ColorSpace;
ColorSpaceChar[0] = (unsigned char)(ColorSpace[0]);
ColorSpaceChar[1] = (unsigned char)(ColorSpace[0]>>8);
ColorSpaceChar[2] = (unsigned char)(ColorSpace[0]>>16);
ColorSpaceChar[3] = (unsigned char)(ColorSpace[0]>>24);
memcpy (tempExif, ColorSpaceChar, 4);
tempExif += 4 ;
///////////////ENTRY NO 14 : FocalPlaneXResolution////////////////////////
//write EXPOSURE TIME tag
memcpy (tempExif, FocalPlaneXResolutiontag, 2);
tempExif += 2 ;
//write format
memcpy (tempExif, FocalPlaneXResolutionformat, 2);
tempExif += 2 ;
//write no of component
memcpy (tempExif, NcomponentFocalPlaneXResolution, 4);
tempExif += 4 ;
//write EXPOSURE TIME
santemp=(int)(offset);
FocalPlaneXResolutionoffchar[0]=(unsigned char)santemp;
FocalPlaneXResolutionoffchar[1]=(unsigned char)(santemp>>8);
FocalPlaneXResolutionoffchar[2]=(unsigned char)(santemp>>16);
FocalPlaneXResolutionoffchar[3]=(unsigned char)(santemp>>24);
//write the X-Resolution offset into the bitstream
memcpy (tempExif, FocalPlaneXResolutionoffchar, 4);
tempExif += 4 ;
FocalPlaneXResolutionNum[0] = jCtx->ExifInfo->FocalPlaneXResolutionNum;
FocalPlaneXResolutionDen[0] = jCtx->ExifInfo->FocalPlaneXResolutionDen;
FocalPlaneXResolutionNumChar[0]=(unsigned char)FocalPlaneXResolutionNum[0];
FocalPlaneXResolutionNumChar[1]=(unsigned char)(FocalPlaneXResolutionNum[0]>>8);
FocalPlaneXResolutionNumChar[2]=(unsigned char)(FocalPlaneXResolutionNum[0]>>16);
FocalPlaneXResolutionNumChar[3]=(unsigned char)(FocalPlaneXResolutionNum[0]>>24);
FocalPlaneXResolutionDenChar[0]=(unsigned char)FocalPlaneXResolutionDen[0];
FocalPlaneXResolutionDenChar[1]=(unsigned char)(FocalPlaneXResolutionDen[0]>>8);
FocalPlaneXResolutionDenChar[2]=(unsigned char)(FocalPlaneXResolutionDen[0]>>16);
FocalPlaneXResolutionDenChar[3]=(unsigned char)(FocalPlaneXResolutionDen[0]>>24);
//WRITE THE EXPOSURE TIME NUMERATOR
memcpy (startoftiff+santemp, FocalPlaneXResolutionNumChar, 4);
memcpy (startoftiff+santemp+4, FocalPlaneXResolutionDenChar, 4);
offset+=48;
///////////////ENTRY NO 15 : FocalPlaneYResolution////////////////////////
//write EXPOSURE TIME tag
memcpy (tempExif, FocalPlaneYResolutiontag, 2);
tempExif += 2 ;
//write format
memcpy (tempExif, FocalPlaneYResolutionformat, 2);
tempExif += 2 ;
//write no of component
memcpy (tempExif, NcomponentFocalPlaneYResolution, 4); //sanjeev
tempExif += 4 ;
//write EXPOSURE TIME
santemp=(int)(offset);
FocalPlaneYResolutionoffchar[0]=(unsigned char)santemp;
FocalPlaneYResolutionoffchar[1]=(unsigned char)(santemp>>8);
FocalPlaneYResolutionoffchar[2]=(unsigned char)(santemp>>16);
FocalPlaneYResolutionoffchar[3]=(unsigned char)(santemp>>24);
//write the X-Resolution offset into the bitstream
memcpy (tempExif, FocalPlaneYResolutionoffchar, 4);
tempExif += 4 ;
FocalPlaneYResolutionNum[0] = jCt
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -