pdf和ofd增加获取bpp功能
This commit is contained in:
parent
941b16337a
commit
39b06d02b0
|
@ -346,7 +346,7 @@ HGResult HGAPI HGImgFmt_LoadImage(const HGChar* fileName, HGUInt fmtType, HGImgF
|
||||||
{
|
{
|
||||||
info->width = pdfInfo.width;
|
info->width = pdfInfo.width;
|
||||||
info->height = pdfInfo.height;
|
info->height = pdfInfo.height;
|
||||||
info->bpp = 0;
|
info->bpp = pdfInfo.bpp;
|
||||||
info->xDpi = 0;
|
info->xDpi = 0;
|
||||||
info->yDpi = 0;
|
info->yDpi = 0;
|
||||||
}
|
}
|
||||||
|
@ -366,7 +366,7 @@ HGResult HGAPI HGImgFmt_LoadImage(const HGChar* fileName, HGUInt fmtType, HGImgF
|
||||||
{
|
{
|
||||||
info->width = ofdInfo.width;
|
info->width = ofdInfo.width;
|
||||||
info->height = ofdInfo.height;
|
info->height = ofdInfo.height;
|
||||||
info->bpp = 0;
|
info->bpp = ofdInfo.bpp;
|
||||||
info->xDpi = 0;
|
info->xDpi = 0;
|
||||||
info->yDpi = 0;
|
info->yDpi = 0;
|
||||||
}
|
}
|
||||||
|
@ -488,7 +488,7 @@ HGResult HGAPI HGImgFmt_LoadImage(const HGChar* fileName, HGUInt fmtType, HGImgF
|
||||||
{
|
{
|
||||||
info->width = pdfInfo.width;
|
info->width = pdfInfo.width;
|
||||||
info->height = pdfInfo.height;
|
info->height = pdfInfo.height;
|
||||||
info->bpp = 0;
|
info->bpp = pdfInfo.bpp;
|
||||||
info->xDpi = 0;
|
info->xDpi = 0;
|
||||||
info->yDpi = 0;
|
info->yDpi = 0;
|
||||||
}
|
}
|
||||||
|
@ -503,7 +503,7 @@ HGResult HGAPI HGImgFmt_LoadImage(const HGChar* fileName, HGUInt fmtType, HGImgF
|
||||||
{
|
{
|
||||||
info->width = ofdInfo.width;
|
info->width = ofdInfo.width;
|
||||||
info->height = ofdInfo.height;
|
info->height = ofdInfo.height;
|
||||||
info->bpp = 0;
|
info->bpp = ofdInfo.bpp;
|
||||||
info->xDpi = 0;
|
info->xDpi = 0;
|
||||||
info->yDpi = 0;
|
info->yDpi = 0;
|
||||||
}
|
}
|
||||||
|
@ -1014,6 +1014,7 @@ HGResult HGAPI HGImgFmt_LoadImageFromReader(HGImgFmtReader reader, HGUInt index,
|
||||||
{
|
{
|
||||||
info->width = pdfInfo.width;
|
info->width = pdfInfo.width;
|
||||||
info->height = pdfInfo.height;
|
info->height = pdfInfo.height;
|
||||||
|
info->bpp = pdfInfo.bpp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1041,6 +1042,7 @@ HGResult HGAPI HGImgFmt_LoadImageFromReader(HGImgFmtReader reader, HGUInt index,
|
||||||
{
|
{
|
||||||
info->width = ofdInfo.width;
|
info->width = ofdInfo.width;
|
||||||
info->height = ofdInfo.height;
|
info->height = ofdInfo.height;
|
||||||
|
info->bpp = ofdInfo.bpp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
HGUInt width;
|
HGUInt width;
|
||||||
HGUInt height;
|
HGUInt height;
|
||||||
|
HGUInt bpp;
|
||||||
}HGOfdPageInfo;
|
}HGOfdPageInfo;
|
||||||
|
|
||||||
HGEXPORT HGResult HGAPI HGImgFmt_CheckOfdFile(const HGChar* fileName, HGBool* isOfd);
|
HGEXPORT HGResult HGAPI HGImgFmt_CheckOfdFile(const HGChar* fileName, HGBool* isOfd);
|
||||||
|
|
|
@ -281,6 +281,7 @@ HGResult HGOfdReaderImpl::GetPageInfo(HGUInt page, HGOfdPageInfo* info)
|
||||||
|
|
||||||
info->width = jpegInfo.width;
|
info->width = jpegInfo.width;
|
||||||
info->height = jpegInfo.height;
|
info->height = jpegInfo.height;
|
||||||
|
info->bpp = jpegInfo.numComponents * 8;
|
||||||
return HGBASE_ERR_OK;
|
return HGBASE_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
HGUInt width;
|
HGUInt width;
|
||||||
HGUInt height;
|
HGUInt height;
|
||||||
|
HGUInt bpp;
|
||||||
}HGPdfPageInfo;
|
}HGPdfPageInfo;
|
||||||
|
|
||||||
HGEXPORT HGResult HGAPI HGImgFmt_CheckPdfFile(const HGChar* fileName, HGBool* isPdf);
|
HGEXPORT HGResult HGAPI HGImgFmt_CheckPdfFile(const HGChar* fileName, HGBool* isPdf);
|
||||||
|
|
|
@ -163,6 +163,7 @@ HGResult HGPdfReaderImpl::GetPageInfo(HGUInt page, HGPdfPageInfo* info)
|
||||||
fz_rect pdfRect = pdf_bound_page(m_pContext, page);
|
fz_rect pdfRect = pdf_bound_page(m_pContext, page);
|
||||||
info->width = ceil(pdfRect.x1);
|
info->width = ceil(pdfRect.x1);
|
||||||
info->height = ceil(pdfRect.y1);
|
info->height = ceil(pdfRect.y1);
|
||||||
|
info->bpp = 24;
|
||||||
ret = HGBASE_ERR_OK;
|
ret = HGBASE_ERR_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue