问题标签 [24-bit]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - 从 URL 下载图片有些问题
我正在使用以下方法从 URL 下载图像
对我来说,这种方法适用于与图像对应的所有 URL 但问题是它不适用于以下
http://downloads.hyperin.com/hyperin-portal/imageserver/news/13442/ginatricot.jpg
适用于以下网址
http://downloads.hyperin.com/hyperin-portal/imageserver/news/12042/Myfit_liity_nyt.jpg
为了调试,我在浏览器中打开图像并将其下载到我的电脑上,检查其属性并发现这是 32 位图像,其他成功下载的图像是 24 位的。我不知道为什么相同的代码无法下载成功下载 24 位图像的 32 位图像。我的代码遗漏了什么?android 不支持 32 位图像吗?或者是什么?请建议我找出解决方案
c++ - What should we do with a Bitmap file when it's rowsize isn't multiple of 4?
I am writing a program to rotate an image. The Image format is Bitmap and according to the http://en.wikipedia.org/wiki/BMP_file_format the rowsize of a bitmap image should be multiple of 4. My input image isn't so and when I write new image to a file, it isn't what it should be. Of course first I read the data part to an array of pixels and after that I rotate that array. If more information is needed, please tell me.
Of course my previous problem had been solved but I don't know why c++ count the size of this structure 56 byte ?
Here is the structure:
java - 24/32 位 WAV 文件的波形
我正在使用 Java 中的 WAV 文件并创建了一个波形,但它只能显示来自 16 位文件的波形。我为样本帧创建一个循环,为通道创建另一个循环,允许为每个通道创建波形。
我正在努力创建 24 位和 32 位的波形......我试图找到任何解决方案但我找不到,我还尝试了以下代码但没有成功。
提前致谢!
image - Matlab:加载 .tif > 转换 bmp 256 > 转换 bmp 24 位
对于一些编码,我想做以下事情:
- 读取 .tif 文件
- 转换为具有 256 种颜色的 .bmp(从绘图中获得,在 matlab 中找不到!)
- 使用 24 位转换为 .bmp(正常转换为 .bmp 是 24 位,这可行)
问题出在第 2 步之内。我需要这一步,因为它会降低图像质量,从而使部分颜色不那么高级。有了这个,一个部分将具有与它应该相同的值,而不是 4 种类型的深蓝色,你不能用肉眼看到。
发生转换的部分代码:
嗯,我想不通,也许你有一个想法?
audio - Working with 24-bit audio samples
What is the "standard way" of working with 24-bit audio? Well, there are no 24-bit data types available, really. Here are the methods that come into my mind:
- Represent 24-bit audio samples as 32-bit ints and ignore the upper eight bits.
- Just like (1) but ignore the lower eight bits.
- Represent 24-bit audio samples as 32-bit floats.
- Represent the samples as structs of 3 bytes (acceptable for C/C++, but bad for Java).
How do you work this out?
c++ - 像素数据的传输:24BPP 图像和 GL_UNPACK_ALIGNMENT 设置为 4
在我的 OpenGL 程序中,我正在加载一个 24BPP 图像,其宽度为501
. GL_UNPACK_ALINGMENT
参数设置4
为。他们写它不应该工作,因为正在上传的每一行的大小 ( 501*3 = 1503
) 不能除以 4。但是,我可以在显示它时看到没有人工制品的正常纹理。
所以我的代码有效。我正在考虑为什么要充分理解这一点并防止整个项目被窃听。
也许(?)它有效,因为我不只是打电话glTexImage2D
。相反,起初我正在创建一个适当的(尺寸为 2 的幂)空白纹理,然后使用glTexSubImage2D
.
编辑:
但是你觉得写这样的代码有意义吗?
希望它可以防止应用程序崩溃或故障?
grayscale - freeimage 将 png 24 位转换为 1 位黑色/白色 = 灰色/白色?
我正在使用 Freeimage.sf.net 加载 png24bit 并希望将其保存为黑白 png。使用
FIBITMAP bib = Freeimage.Load("<24bit_png>");
FIBITMAP conv = FreeImage.ConvertColorDepth(bib, FREE_IMAGE_COLOR_DEPTH. FICD_01_BPP_THRESHOLD, (byte) 128);
FreeImage.Unload(bin); bib.SetNull();
FreeImage.Save(FREE_IMAGE_FORMAT.FIF_PNG, conv, "<out_png>", FREE_IMAGE_SAVE_FLAGS.PNG_Z_BEST_COMPRESSION);
FreeImage.Unload(conv); conv.SetNull();
但不是黑色/白色,因为它是#0b120c / 白色?为什么阈值不创建 bw 调色板?
c - 写入位图 24 位颜色奇怪的行为
我正在用 c 编写自己的位图生成器,但遇到了一些我无法弄清楚的行为。
我将像素数据存储在我编写的像素结构的二维数组中。我将我的结构直接写入标题之后的文件中。
纯色位图工作正常,但在尝试生成渐变时遇到了问题。图像出现损坏。经过一些实验,我发现任何包含 ar、g 或 b 值为 10 的像素的图像都会显示损坏。我改变了我的代码以避免我的颜色通道中的所有 10,如下所示:
这会产生正确的梯度:
当我删除 if 语句时,我得到:
为了避免此类问题,我需要了解有关位图的哪些信息?
c# - C# 将 4 位颜色 (=ConsoleColor) 转换为 RGB 并返回
我想为游戏编写一个类似控制台的 gui,我从一个真正的控制台开始。所以我有一个类,指定颜色。现在我想将控制台颜色转换为 rgb(24 位),反之亦然。我试过这个:
4 位颜色有这个位主题:drgb。当 d 为 0 时,颜色将变暗,如果为 1,则 rgb 值为 255。我的问题是:颜色 1000(亮黑色)和颜色 0111(深白色)在我的程序中是黑色和灰色。它们应该是深灰色和浅灰色。以及如何通过四舍五入将颜色转换回来,而不仅仅是将特定颜色转换回来?
signal-processing - 24 位 ALU 上的 32 位乘法
我想在 24 位 dsp 上移植 32 x 32 位无符号乘法(它是一个线性同余生成器,所以我不允许截断,我也不想用 24 位替换当前的 LCG )。可用的数据类型为 24 位和 48 位整数。
只需要最后 32 LSB。你知道有什么技巧可以比通常的方式以更少的乘法、掩码和班次来实现吗?
该行如下所示: