void CPDF_ColorSpace::TranslateImageLine(uint8_t* dest_buf, const uint8_t* src_buf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const { CFX_FixedBufGrow<FX_FLOAT, 16> srcbuf(m_nComponents); FX_FLOAT* src = srcbuf; FX_FLOAT R, G, B; for (int i = 0; i < pixels; i ++) { for (int j = 0; j < m_nComponents; j ++) if (m_Family == PDFCS_INDEXED) { src[j] = (FX_FLOAT)(*src_buf ++); } else { src[j] = (FX_FLOAT)(*src_buf ++) / 255; } GetRGB(src, R, G, B); *dest_buf ++ = (int32_t)(B * 255); *dest_buf ++ = (int32_t)(G * 255); *dest_buf ++ = (int32_t)(R * 255); } }
void JobAddConfigurationInputs(JobScriptOutput& output, const wchar_t *szFileInput, const wchar_t *pszInputDriver, List2<InputFilenameNode> *pListAppended) { do { const VDStringA filename(strCify(VDTextWToU8(VDStringW(szFileInput)).c_str())); if (g_pInputOpts) { int req = g_pInputOpts->write(NULL, 0); vdfastvector<char> srcbuf(req); int srcsize = g_pInputOpts->write(srcbuf.data(), req); if (srcsize) { vdfastvector<char> encbuf((srcsize + 2) / 3 * 4 + 1); membase64(encbuf.data(), srcbuf.data(), srcsize); const VDStringA filename(strCify(VDTextWToU8(VDStringW(szFileInput)).c_str())); output.addf("VirtualDub.Open(\"%s\",\"%s\",0,\"%s\");", filename.c_str(), pszInputDriver?strCify(VDTextWToU8(VDStringW(pszInputDriver)).c_str()):"", encbuf.data()); break; } } output.addf("VirtualDub.Open(\"%s\",\"%s\",0);", filename.c_str(), pszInputDriver?strCify(VDTextWToU8(VDStringW(pszInputDriver)).c_str()):""); } while(false); if (pListAppended) { InputFilenameNode *ifn = pListAppended->AtHead(), *ifn_next; if (ifn = ifn->NextFromHead()) while(ifn_next = ifn->NextFromHead()) { output.addf("VirtualDub.Append(\"%s\");", strCify(VDTextWToU8(VDStringW(ifn->name)).c_str())); ifn = ifn_next; } } }