annotate scripts/image/rgb2ntsc.m @ 1315:611d403c7f3d

[project @ 1995-06-25 19:56:32 by jwe]
author jwe
date Sun, 25 Jun 1995 19:56:32 +0000
parents 56520a75b5b3
children 5d29638dd524
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1024
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
1 # Copyright (C) 1995 John W. Eaton
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
2 #
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
3 # This file is part of Octave.
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
4 #
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
5 # Octave is free software; you can redistribute it and/or modify it
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
6 # under the terms of the GNU General Public License as published by the
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
7 # Free Software Foundation; either version 2, or (at your option) any
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
8 # later version.
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
9 #
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
10 # Octave is distributed in the hope that it will be useful, but WITHOUT
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
13 # for more details.
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
14 #
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
15 # You should have received a copy of the GNU General Public License
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
16 # along with Octave; see the file COPYING. If not, write to the Free
1315
611d403c7f3d [project @ 1995-06-25 19:56:32 by jwe]
jwe
parents: 1024
diff changeset
17 # Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
18
1024
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
19 function yiq = rgb2ntsc (rgb)
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
20
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
21 # Image format conversion.
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
22
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
23 # Written by Tony Richardson (amr@mpl.ucsd.edu) July 1994.
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
24
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
25 if (nargin != 1)
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
26 usage ("rgb2ntsc (rgb)");
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
27 endif
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
28
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
29 trans = [ 0.299, 0.596, 0.211;
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
30 0.587, -0.274, -0.523;
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
31 0.114, -0.322, 0.312 ];
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 559
diff changeset
32
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
33 yiq = rgb * trans;
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
34
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
35 endfunction