本文整理汇总了C++中CFX_DIBitmap::GetBPP方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_DIBitmap::GetBPP方法的具体用法?C++ CFX_DIBitmap::GetBPP怎么用?C++ CFX_DIBitmap::GetBPP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_DIBitmap
的用法示例。
在下文中一共展示了CFX_DIBitmap::GetBPP方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Continue
//.........这里部分代码省略.........
} else if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
int pos_pixel[8];
for (int row = 0; row < m_ResultHeight; row ++) {
FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col_l, src_row_l, res_x, res_y;
result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
int u_w[4], v_w[4];
if (src_col_l == stretch_width) {
src_col_l--;
}
if (src_row_l == stretch_height) {
src_row_l--;
}
_bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height);
*dest_scan = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, 1, 0);
}
dest_scan ++;
}
}
} else {
CPDF_FixedMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col, src_row;
result2stretch_fix.Transform(col, row, src_col, src_row);
if (src_col >= 0 && src_col <= stretch_width && src_row >= 0 && src_row <= stretch_height) {
if (src_col == stretch_width) {
src_col --;
}
if (src_row == stretch_height) {
src_row --;
}
FX_LPCBYTE src_pixel = stretch_buf + stretch_pitch * src_row + src_col;
*dest_scan = *src_pixel;
}
dest_scan ++;
}
}
}
} else {
int Bpp = m_Storer.GetBitmap()->GetBPP() / 8;
int destBpp = pTransformed->GetBPP() / 8;
if (Bpp == 1) {
FX_BOOL bHasAlpha = m_Storer.GetBitmap()->HasAlpha();
FX_DWORD argb[256];
FX_ARGB* pPal = m_Storer.GetBitmap()->GetPalette();
if (pPal) {
for (int i = 0; i < 256; i ++) {
argb[i] = pPal[i];
}
} else {
if (m_Storer.GetBitmap()->IsCmykImage())
for (int i = 0; i < 256; i ++) {
argb[i] = 255 - i;
}
else
for (int i = 0; i < 256; i ++) {
argb[i] = 0xff000000 | (i * 0x010101);
}
}
if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col_l, src_row_l, res_x, res_y;
result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
if (src_col_l == stretch_width) {
src_col_l--;
}
if (src_row_l == stretch_height) {
src_row_l--;
}
int src_col_r = src_col_l + 1;
int src_row_r = src_row_l + 1;
if (src_col_r == stretch_width) {
src_col_r--;
}
if (src_row_r == stretch_height) {
src_row_r--;
}
int row_offset_l = src_row_l * stretch_pitch;
int row_offset_r = src_row_r * stretch_pitch;
FX_DWORD r_bgra_cmyk = argb[_bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, 1, 0)];
if (transformF == FXDIB_Rgba) {
dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24);
dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16);
dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8);
} else {
*(FX_DWORD*)dest_pos = r_bgra_cmyk;
}
}
dest_pos += destBpp;
}
}