langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
21
Task/Bitmap/Octave/bitmap-2.octave
Normal file
21
Task/Bitmap/Octave/bitmap-2.octave
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
function im = create_rgb_image(w, h)
|
||||
im = zeros(w, h, 3, "uint8");
|
||||
endfunction
|
||||
|
||||
function set_background(im, colorvector)
|
||||
im(:,:,1) = colorvector(1);
|
||||
im(:,:,2) = colorvector(2);
|
||||
im(:,:,3) = colorvector(3);
|
||||
endfunction
|
||||
|
||||
function set_pixel(im, coord, colorvector)
|
||||
im(coord(1), coord(2), 1) = colorvector(1);
|
||||
im(coord(1), coord(2), 2) = colorvector(2);
|
||||
im(coord(1), coord(2), 3) = colorvector(3);
|
||||
endfunction
|
||||
|
||||
function [r, g, b] = get_pixel(im, coord)
|
||||
r = im(coord(1), coord(2), 1)
|
||||
g = im(coord(1), coord(2), 2)
|
||||
b = im(coord(1), coord(2), 3)
|
||||
endfunction
|
||||
Loading…
Add table
Add a link
Reference in a new issue