pdf和ofd增加获取bpp功能

This commit is contained in:
luoliangyi 2022-08-16 16:14:56 +08:00
parent 941b16337a
commit 39b06d02b0
5 changed files with 10 additions and 4 deletions

View File

@ -346,7 +346,7 @@ HGResult HGAPI HGImgFmt_LoadImage(const HGChar* fileName, HGUInt fmtType, HGImgF
{
info->width = pdfInfo.width;
info->height = pdfInfo.height;
info->bpp = 0;
info->bpp = pdfInfo.bpp;
info->xDpi = 0;
info->yDpi = 0;
}
@ -366,7 +366,7 @@ HGResult HGAPI HGImgFmt_LoadImage(const HGChar* fileName, HGUInt fmtType, HGImgF
{
info->width = ofdInfo.width;
info->height = ofdInfo.height;
info->bpp = 0;
info->bpp = ofdInfo.bpp;
info->xDpi = 0;
info->yDpi = 0;
}
@ -488,7 +488,7 @@ HGResult HGAPI HGImgFmt_LoadImage(const HGChar* fileName, HGUInt fmtType, HGImgF
{
info->width = pdfInfo.width;
info->height = pdfInfo.height;
info->bpp = 0;
info->bpp = pdfInfo.bpp;
info->xDpi = 0;
info->yDpi = 0;
}
@ -503,7 +503,7 @@ HGResult HGAPI HGImgFmt_LoadImage(const HGChar* fileName, HGUInt fmtType, HGImgF
{
info->width = ofdInfo.width;
info->height = ofdInfo.height;
info->bpp = 0;
info->bpp = ofdInfo.bpp;
info->xDpi = 0;
info->yDpi = 0;
}
@ -1014,6 +1014,7 @@ HGResult HGAPI HGImgFmt_LoadImageFromReader(HGImgFmtReader reader, HGUInt index,
{
info->width = pdfInfo.width;
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->height = ofdInfo.height;
info->bpp = ofdInfo.bpp;
}
}

View File

@ -14,6 +14,7 @@ typedef struct
{
HGUInt width;
HGUInt height;
HGUInt bpp;
}HGOfdPageInfo;
HGEXPORT HGResult HGAPI HGImgFmt_CheckOfdFile(const HGChar* fileName, HGBool* isOfd);

View File

@ -281,6 +281,7 @@ HGResult HGOfdReaderImpl::GetPageInfo(HGUInt page, HGOfdPageInfo* info)
info->width = jpegInfo.width;
info->height = jpegInfo.height;
info->bpp = jpegInfo.numComponents * 8;
return HGBASE_ERR_OK;
}

View File

@ -14,6 +14,7 @@ typedef struct
{
HGUInt width;
HGUInt height;
HGUInt bpp;
}HGPdfPageInfo;
HGEXPORT HGResult HGAPI HGImgFmt_CheckPdfFile(const HGChar* fileName, HGBool* isPdf);

View File

@ -163,6 +163,7 @@ HGResult HGPdfReaderImpl::GetPageInfo(HGUInt page, HGPdfPageInfo* info)
fz_rect pdfRect = pdf_bound_page(m_pContext, page);
info->width = ceil(pdfRect.x1);
info->height = ceil(pdfRect.y1);
info->bpp = 24;
ret = HGBASE_ERR_OK;
}
}