Skip to content

Commit

Permalink
Added BGR support
Browse files Browse the repository at this point in the history
  • Loading branch information
wedesoft committed Jun 6, 2011
1 parent 97ffecd commit 25fd747
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -8,7 +8,7 @@ require 'rbconfig'
require 'tempfile'

PKG_NAME = 'hornetseye-frame'
PKG_VERSION = '0.9.2'
PKG_VERSION = '0.10.0'
CFG = RbConfig::CONFIG
CXX = ENV[ 'CXX' ] || 'g++'
RB_FILES = FileList[ 'lib/**/*.rb' ]
Expand Down
2 changes: 1 addition & 1 deletion ext/colourspace.cc
Expand Up @@ -40,7 +40,7 @@ static void setupFormat( const string &typecode, int width, int height, char *me
*format = PIX_FMT_RGB24;
data[ 0 ] = (uint8_t *)memory;
lineSize[ 0 ] = width * 3;
} else if ( typecode == "BGR " ) {
} else if ( typecode == "BGR" ) {
*format = PIX_FMT_BGR24;
data[ 0 ] = (uint8_t *)memory;
lineSize[ 0 ] = width * 3;
Expand Down
8 changes: 4 additions & 4 deletions lib/hornetseye-frame/fourcc.rb
Expand Up @@ -19,7 +19,7 @@ module Hornetseye

class FourCC

def initialize( a, b, c, d )
def initialize(a, b, c, d = nil)
@a, @b, @c, @d = a, b, c, d
end

Expand All @@ -28,7 +28,7 @@ def inspect
end

def to_s
"#{@a}#{@b}#{@c}#{@d}"
"#{@a}#{@b}#{@c}#{@d ? @d : ''}"
end

def to_str
Expand All @@ -41,13 +41,13 @@ def ==( other )

end

def FourCC( a, b, c, d )
def FourCC(a, b, c, d = nil)
FourCC.new a, b, c, d
end

module_function :FourCC

BGR = FourCC 'B', 'G', 'R', ' '
BGR = FourCC 'B', 'G', 'R'
BGRA = FourCC 'B', 'G', 'R', 'A'
UYVY = FourCC 'U', 'Y', 'V', 'Y'
YUY2 = FourCC 'Y', 'U', 'Y', '2'
Expand Down

0 comments on commit 25fd747

Please sign in to comment.