16-bit

Write to 16 bit BufferedImage TYPE_USHORT_GRAY

蹲街弑〆低调 提交于 2019-12-30 07:11:33
问题 I'm trying to write 16 bit grayscale imagedata to a png using BufferedImage.TYPE_USHORT_GRAY. Normally I write to an image like so: BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); then: image.setRGB(x,y,Color.getRGB); to set the pixels, and finally: ImageIO.write(image, "png", new File(path + ".png")); to write to a png image. But now I have this as image: BufferedImage imageGray = new BufferedImage(width, height, BufferedImage.TYPE_USHORT_GRAY); How do I

How to do 64 bit multiply on 16 bit machine?

青春壹個敷衍的年華 提交于 2019-12-29 08:08:48
问题 I have an embedded 16 bit CPU. On this machine ints are 16 bit wide and it supports longs that are 32 bits wide. I need to do some multiplications that will need to be stored in 64 bits (e.g. multiply a 32 bit number by a 16 bit number). How can I do that with the given constraints? I do not have a math library to do this. 回答1: A suggestion in C. Note that this code probably will be easier to implement with inline assembler as carry detection in C doesn't seem that easy // Change the typedefs

Help please with CGBitmapContext and 16 bit images

你说的曾经没有我的故事 提交于 2019-12-24 00:47:08
问题 I'd LOVE to know what I'm doing wrong here. I'm a bit of a newbie with CGImageRefs so any advice would help. I'm trying to create a bitmap image that has as it's pixel values a weighted sum of the pixels from another bitmap, and both bitmaps are 16bits per channel. For some reason I had no trouble getting this to work with 8bit images but it fails miserably with 16bit. My guess is that I'm just not setting things up correctly. I've tried using CGFloats, floats and UInt16s as the data types

How can I save/load a 16 bit image in .net x64?

好久不见. 提交于 2019-12-22 06:49:54
问题 Before, when I was using win32, I used FreeImage in order to load and save bitmaps of bit depth greater than 8 bits. That's every image I work with, since I'm doing medical imaging, and before anyone says anything, yes, me and my customers have spent a lot of money on high-brightness, high-contrast monitors with 11 or 12 bits of dynamic range. In fact, if you're curious, requirements by the ACR for running mammography incldue a monitor with at least 10 bits of dynamic range. I just switched

Getting Embedded with D (the programming language)

别来无恙 提交于 2019-12-20 16:59:50
问题 I like a lot of what I've read about D. Unified Documentation (That would make my job a lot easier.) Testing capability built in to the language. Debug code support in the language. Forward Declarations. (I always thought it was stupid to declare the same function twice.) Built in features to replace the Preprocessor. Modules Typedef used for proper type checking instead of aliasing. Nested functions. ( Cough PASCAL Cough ) In and Out Parameters. (How obvious is that!) Supports low level

Getting Embedded with D (the programming language)

我的未来我决定 提交于 2019-12-20 16:57:45
问题 I like a lot of what I've read about D. Unified Documentation (That would make my job a lot easier.) Testing capability built in to the language. Debug code support in the language. Forward Declarations. (I always thought it was stupid to declare the same function twice.) Built in features to replace the Preprocessor. Modules Typedef used for proper type checking instead of aliasing. Nested functions. ( Cough PASCAL Cough ) In and Out Parameters. (How obvious is that!) Supports low level

Difference between C 8 bit 16-bit 32-bit compilers [closed]

风流意气都作罢 提交于 2019-12-20 15:21:37
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . This question may be redundant, but I didn't found exact answer. What is the Difference between C 8 bit 16-bit 32-bit compilers. how

Shutting down computer with nasm

青春壹個敷衍的年華 提交于 2019-12-20 07:26:43
问题 Is it possible to shut down or kill the power (is there a difference?) to a computer from nasm. I know you can use this to reboot: mov al, 0xFE out 0x64, al Is there an equivalent for shutting down? I am making my own 16 bit OS. 回答1: The code you have is not guaranteed to work. It relies on two facts: the OS maps the physical IO memory into the process memory space. the machine has BIOS. Neither of the two might be true. The only reliable way to reboot or shutdown the machine programatically

Problem converting integer to ASCII code in x86 assembly

点点圈 提交于 2019-12-20 06:31:04
问题 I am trying to use the code below to convert an integer in ax to ASCII codes. But running it outputs 515, rather than 513 as I expected. Where is the error? stk segment dw 32 dup(0) stk ends dts Segment posnum db 6 dup(0) ;0<x<65536; dts ends cds Segment Assume cs:cds , ds:dts,ss:stk Main Proc Far mov ax,seg dts mov ds,ax mov es,ax xor ax,ax mov ax,513 mov di,offset posnum Call ConvertPositive mov ah,09h mov dx ,offset posnum int 21h main_finish: mov ah,08h int 21h mov ax,4c00h int 21h Main

TASM 1.4 - Changing background color without clearing the screen?

久未见 提交于 2019-12-19 11:43:14
问题 I'm using Tasm 1.4. I'm trying to change the color of the background and text without clearing the previous text, but it always ends up on clearing the previous text although the colors are changed. For example: mov ah,09h lea dx,text1 int 21h ;displays text1 mov ah,01h int 21h ;I input a character mov ah,06h mov bh,42h mov cx,0000h mov dx,184fh int 10h ;I use this to change the text and background color mov ah,02h mov bh,00h mov dh,0ch mov dl,20h int 10h ;along with this mov ah,09h lea dx