Imebra - Change color contrasts

偶尔善良 提交于 2019-12-04 20:17:40
Paolo Brandoli

If you are dealing with a monochrome image and you want to modify the presentation luminosity/contrast, then you have to modify the parameters of the VOILUT transform (voilutTransform variable in your code).

You can get the center and width that the transform is applying to the image before calculating the bitmap to be displayed, then modify them before calling drawBitmap.getBitmap again.

E.g., to double the contrast:

voilutTransform.setCenterWidth(voilutTransform.getCenter(), voilutTransform.getWidth() / 2);

// Now fill the buffer with the image data and create a bitmap from it
drawBitmap.getBitmap(image, drawBitmapType_t.drawBitmapRGBA, 4, buffer);

See this answer for more details about the center/width

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!