代码拉取完成,页面将自动刷新
同步操作将从 OpenHarmony/third_party_libjpeg-turbo 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* cmyk.h
*
* Copyright (C) 2017-2018, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains convenience functions for performing quick & dirty
* CMYK<->RGB conversion. This algorithm is suitable for testing purposes
* only. Properly converting between CMYK and RGB requires a color management
* system.
*/
#ifndef CMYK_H
#define CMYK_H
#include <jinclude.h>
#define JPEG_INTERNALS
#include <jpeglib.h>
#include "jconfigint.h"
/* Fully reversible */
INLINE
LOCAL(void)
rgb_to_cmyk(JSAMPLE r, JSAMPLE g, JSAMPLE b, JSAMPLE *c, JSAMPLE *m,
JSAMPLE *y, JSAMPLE *k)
{
double ctmp = 1.0 - ((double)r / 255.0);
double mtmp = 1.0 - ((double)g / 255.0);
double ytmp = 1.0 - ((double)b / 255.0);
double ktmp = MIN(MIN(ctmp, mtmp), ytmp);
if (ktmp == 1.0) ctmp = mtmp = ytmp = 0.0;
else {
ctmp = (ctmp - ktmp) / (1.0 - ktmp);
mtmp = (mtmp - ktmp) / (1.0 - ktmp);
ytmp = (ytmp - ktmp) / (1.0 - ktmp);
}
*c = (JSAMPLE)(255.0 - ctmp * 255.0 + 0.5);
*m = (JSAMPLE)(255.0 - mtmp * 255.0 + 0.5);
*y = (JSAMPLE)(255.0 - ytmp * 255.0 + 0.5);
*k = (JSAMPLE)(255.0 - ktmp * 255.0 + 0.5);
}
/* Fully reversible only for C/M/Y/K values generated with rgb_to_cmyk() */
INLINE
LOCAL(void)
cmyk_to_rgb(JSAMPLE c, JSAMPLE m, JSAMPLE y, JSAMPLE k, JSAMPLE *r, JSAMPLE *g,
JSAMPLE *b)
{
*r = (JSAMPLE)((double)c * (double)k / 255.0 + 0.5);
*g = (JSAMPLE)((double)m * (double)k / 255.0 + 0.5);
*b = (JSAMPLE)((double)y * (double)k / 255.0 + 0.5);
}
#endif /* CMYK_H */
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。