/**
2002 ZORAN Corporation, All Rights Reserved THIS IS PROPRIETARY SOURCE CODE OF
ZORAN CORPORATION
*/
#define HCE_CALLBACKS_FILE
#include <stdio.h>
#include "Types.h"
#include "Os.h"
#include "Host.h"
#include "HceDirect.h"
#include "Timing.h"
#include "Custom.h"
#include "I43_Api.h"
#include "OtrParam.h"
#include "CameraCallback.h"
/*
%func
HceScratchpadModeHandler
Main HCE handler for Scratchpad mode
%param
*/
VOID
HceScratchpadModeHandler()
{
/*UINT uiDelay = 1000000000;
while( uiDelay-- ) {};*/
}
/*
%func
HceCreateMakerNote
%param
pbyBuffer - Pointer to the buffer which will hold the final maker note to be
saved.
ulSize - The size of the buffer above.
ulOffset - The offset of maker note tag from the beginning of the tiff
header.
pulParam - Array of optional parameters.
ulParamNum - Size of the parameters' array.
%return
When using the MakerNote to store screennail parameters, the HCE can write
all necessary information except the size and offset of the screennail.
The size and offset have yet to be calculated, therefore the HCE must tell
COACH the addresses in the pbyBuffer where they should be stored.
Those addresses should be sent through the pulParamArray, where
pulParamArray[0] will store the offset and pulParamArray[1] the size. See
the example below, after the #else, in which the MakerNote holds the
offset and size in its first 8 bytes.
In case of success, the function returns 1. In case no action was taken,
the function returns 0xFFFFFFFF. In case of failure, the function returns 0.
*/
#define MAKERNOTE_THUMBNAIL
ULONG
HceCreateMakerNote( PBYTE pbyBuffer,
ULONG ulSize,
ULONG ulOffset,
PULONG pulParamArray,
ULONG ulParamNum )
{
#ifdef MAKERNOTE_THUMBNAIL // Use QVGA makernote thumbnail
PBYTE pbyCodeBuffer = NULL;
ULONG ulCodeSize = 0;
if ( pbyBuffer == NULL ||
pulParamArray == NULL )
{
return 0xFFFFFFFF;
}
if ( ulParamNum > 0 )
{
pbyCodeBuffer = (PBYTE)pulParamArray[0];
}
if ( ulParamNum > 1 )
{
ulCodeSize = pulParamArray[1];
}
if ( pbyBuffer == NULL ||
pbyCodeBuffer == NULL ||
ulSize < ulCodeSize )
{
return 0;
}
memcpy( pbyBuffer, pbyCodeBuffer, ulCodeSize );
return 1;
#else // screennail support
PBYTE pbyCodeBuffer = NULL;
ULONG ulCodeSize = 0;
if ( pbyBuffer == NULL )
{
return 0xFFFFFFFF;
}
if(pulParamArray != NULL)
{
if(ulParamNum == 2)
{
pbyBuffer += ulCodeSize;
// saving the offset location in pulParamArray[0]
pulParamArray[0] = (ULONG)pbyBuffer;
// saving the size location in pulParamArray[1]
pulParamArray[1] = (ULONG)pbyBuffer + sizeof(ULONG);
}
}
return 1;
#endif
}
/*
%func
HceParseMakerNote
%param
pbyBuffer - Pointer to the buffer which holds the maker note to be parsed.
ulSize - The size of the buffer above.
ulOffset - The offset of maker note tag from the beginning of the tiff
header.
uwByteOrder - The order of the bytes: BIG ENDIAN = 0x4D4D
LITTLE ENDIAN = 0x4949
pulParam - Array of optional parameters.
ulParamNum - Size of the parameters' array.
%return
In order to decode the screennail, it is necessary to tell COACH the file
offset and the size of the screennail JPG buffer. This is done through
pulParamArray[0] (offset) and pulParamArray[1] (size). See the example
below, in which the first 8 bytes of the MakerNote are used to store the
offset and size.
In case of success, the function returns the number of set parameters in the
parameters' array. In case no action was taken and/or no parameters were set,
the function returns 0xFFFFFFFF. In case of failure the function returns 0.
*/
ULONG
HceParseMakerNote( PBYTE pbyBuffer,
ULONG ulSize,
ULONG ulOffset,
USHORT uwByteOrder,
PULONG pulParamArray,
ULONG ulParamNum )
{
#ifdef MAKERNOTE_THUMBNAIL // return QVGA makernote thumbnail
if ( pbyBuffer == NULL ||
pulParamArray == NULL )
{
return 0xFFFFFFFF;
}
if ( ulParamNum > 0 )
{
pulParamArray[0] = (ULONG)pbyBuffer;
}
if ( ulParamNum > 1 )
{
pulParamArray[1] = ulSize;
}
return 2;
#else // return screennail info
if ( pbyBuffer == NULL ||
pulParamArray == NULL )
{
return 0xFFFFFFFF;
}
if(ulParamNum == 2 )
{
// return the offset in pulParamArray[0]
pulParamArray[0] = *((PULONG)pbyBuffer);
// return the size in pulParamArray[1]
pulParamArray[1] = *((PULONG)(pbyBuffer + sizeof(ULONG)));
}
return 2;
#endif
}
/*
%func
HceCreateAPPn
%desc
This function will be called during the creation of EXIF of JPEG,
if the APPn feature is turned on (see PRMID_APPN_SIZE for more
information ). To store large qulitity of data, please increase
the size in EXIF (see PRMID_MAX_CUSTOM_MARKER_SIZE for more
information).
If the QVGA feature is turned on, pulParam will hold the QVGA
data (non-ZERO). To store data other than QVGA, please ignore
pulParam.
After saving data to APPn segments, return 0 (ZERO) to terminate
the APPn creation process (when return 0, the current buffer will
not be stored in EXIF).
%param
pbyBuffer - Pointer to the buffer which will hold the final APP2 to be saved.
ulSize - The size of the buffer above.
pulAppIndex - (output) The index of APP segment
for example, 2 means APP2. EXIF supports up to 15,
and allow more than one segment have same APP id.
Note: HCE should maintain valid sequence of APP segments.
pulParam - Array of optional parameters.
ulParamNum - Size of the parameters' array.
%return
In case of success, the function returns the written size.
After this non-zero return value returns, the pbyBuffer data
will be stored in JPEG file, and this function will
be called again for more data.
In case no action was taken, the function returns 0.
*/
ULONG
HceCreateAPPn( PBYTE pbyBuffer,
ULONG ulSize,
PULONG pulAppIndex,
PULONG pulParamArray,
ULONG ulParamNum )
{
return 0;
}
/*
%func
HceParseAPPn
%desc
This function will be called when loading QVGA image or loading Main image,
if the APPn (APP2 through APPF) segment is found in EXIF.
For each APPn segment, this function will be called once. If QVGA segment(s)
exist, they should be located in front of other APPn segments.
If current segment doesn't have all the information, pleaase return 0, which
instructs to search and load next segment.
Return 1 means the QVGA reading and reassambly is done (if applicable),
the firmware will try to search/read next segment, and this function will
be called again if other APPn segments are found.
Return 2 whenever you like to terminate the searching/reading.
%param
pbyBuffer - Pointer to the buffer which holds the APP2 to be parsed.
ulSize - The size of the buffer above.
ulAppIndex - The index of APP segment.
For example, 2 means APP2, 12 means APPC.
pulParam - Array of optional parameters.
ulParamNum - Size of the parameters' array.
%return
0: In case of failure.
0 also means the data hasn't
Hce.rar_COACH8_coach_coach h_hce_数码相机
版权申诉
75 浏览量
2022-09-19
15:16:22
上传
评论
收藏 37KB RAR 举报
JaniceLu
- 粉丝: 79
- 资源: 1万+
最新资源
- vscode-1.64.1.tar源码文件
- vscode-1.64.0.tar源码文件
- vscode-1.52.0.tar源码文件
- Music-Player +PlayerActivity+ rockplayer+ SeeJoPlayer 播放器JAVA源码
- vscode-1.46.0.tar源码文件
- 最近很火植物大战僵尸杂交版2.08苹果+安卓+PC+防闪退工具V2+修改工具+高清工具+通关存档整合包更新
- 超级好用的截图工具PixPin,可录制Gif图
- Screenshot_2024-05-21-17-06-42-64_2332cb9b27b851b548ba47a91682926c.jpg
- 毕业设计参考 - 基于树莓派、OpenCV及Python的人脸识别
- node-v18.20.2-linux-arm64
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈