Hey guys. It's been a while since I programmed anything in any language. I'm currently looking at getting back into 68K-assembly on Classic Amiga. One thing I need is a tool to generate the following:
A generated data-file with color-values in HEX within a defined X-Y boundary using interpolation to create soft gradients with no dithering.
example:
0111 0222 0333 0444 0555 0666 etc. (a 16-bit word)
(a simple gray-scale). It's 4 bits per channel (R,G,B, the first zero isn't used), ie. nibbles, amounting to 4096 possible colors.
The more difficult part (at least in my case since I've never written an interpolation algorithm) is that I want to be able to put several color points within the X-Y space (beyond the four corner values) that will be used by the interpolation algorithm to create a gradient map.
4 point quads should be enough. I plan on overlapping and manipulating different color maps while also moving/copying color and graphical data (basically masking out colors with negative values and other experiments). I have an idea about a "bubbling" copper-background with 2D- and 3D-elements "shading" the resulting color map. That leaves me 4 bitplanes to mess with graphics on top of that.
The viewscreen will either be 40*256 "copper-pixels" or 80*256 (if I use BPL1 as a 4-pixel layer to increase horizontal resolution beyond the copper-timings).
Example:
Left top corner of the color map set to 0800 (mid-red)
Left bottom corner 0008 (mid blue)
Right top corner 0088 (mid-yellow)
Right bottom corner 0088 (mid-cyan)
Then four point values at X,Y in that defined map that will be used to interpolate gradients between the corners as well as the points to create different color maps that I can then do work on (ie. using one color map to subtract from the second and then blend it with graphical objects that I'll convert to color data and create the final color map).
I suspect there will be some nested loops with fairly advanced math (which is where I fail ).
Enter the colors into C1, C2, C3, C4 in any format accepted by CSS ("#f00", "#ff0000", "rgb(255,0,0)", "red", ...) and adjust the width and height in W and H.
Your result is in the textarea between the controls and canvas.
Enter the colors into C1, C2, C3, C4 in any format accepted by CSS ("#f00", "#ff0000", "rgb(255,0,0)", "red", ...) and adjust the width and height in W and H.
Your result is in the textarea between the controls and canvas.
If you don't know/remember how to get the right color for the pixel you are looking for take this function (translate it to the language you use)
Code:
function getColor(imageData, x, y, imageWidth){
return imageData[x+y*imageWidth];
}
var imageMap = "0123 0234 ...";
var imageWidth = 80;
var imageData = imageMap.split(" "); //transform to array
var myColor = getColor(imageData, 0, 0, imageWidth);
That's IT! The only extra thing I'd like is the ability to add a few extra color points inside the color map rectangle used with the original 4 corner points during interpolation (although it's not super-necessary, I can "cheat" by doing small color maps that I stitch together or make huge maps that I then "resize" to get gradients I can manipulate in assembly).
Hello I'd like to have a data-file that was generated, it cannot be just provided it must have been generated, and it must be in a NTFS filesystem format as well as in binary form.
The bytes in this data-file should be stored as hexadecimal values and in big-endian format.
I would also like to store values in color within some γ-φ range using interpolation, but I don't wanna interpolate it in software, it needs to be interpolated in the binary file using interpolation or the hexadecimal values of the respective colors.
example:
color1 color2 color3 color4 color5 color6 etc... (in binary data of file)
Enter the colors into C1, C2, C3, C4 in any format accepted by CSS ("#f00", "#ff0000", "rgb(255,0,0)", "red", ...) and adjust the width and height in W and H.
Your result is in the textarea between the controls and canvas.
If you don't know/remember how to get the right color for the pixel you are looking for take this function (translate it to the language you use)
Code:
function getColor(imageData, x, y, imageWidth){
return imageData[x+y*imageWidth];
}
var imageMap = "0123 0234 ...";
var imageWidth = 80;
var imageData = imageMap.split(" "); //transform to array
var myColor = getColor(imageData, 0, 0, imageWidth);
That's IT! The only extra thing I'd like is the ability to add a few extra color points inside the color map rectangle used with the original 4 corner points during interpolation (although it's not super-necessary, I can "cheat" by doing small color maps that I stitch together or make huge maps that I then "resize" to get gradients I can manipulate in assembly).
OR (and why didn't I think about this until now???) I simply compile the C routine on the Amiga and run it at the init-phase of my app/demo and then use the result for my main code...
Signature/Avatar nuking: none (can be changed in your profile)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum