Skip to content

Commit

Permalink
fix another two typos
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliu committed Dec 21, 2014
1 parent adb7156 commit 0689a2a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lib/ccv.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#define ccmemalign(memptr, alignment, size) (*memptr = ccmalloc(size))
#endif

/* Doxygen will ignore there, otherwise it has problem to process warn_unused_result directly. */
/* Doxygen will ignore these, otherwise it has problem to process warn_unused_result directly. */
#define CCV_WARN_UNUSED(x) x __attribute__((warn_unused_result))

enum {
Expand Down Expand Up @@ -447,14 +447,14 @@ enum {
* Read image from a file. This function has soft dependencies on [LibJPEG](http://libjpeg.sourceforge.net/) and [LibPNG](http://www.libpng.org/pub/png/libpng.html). No these libraries, no JPEG nor PNG read support. However, ccv does support BMP read natively (it is a simple format after all).
* @param in The file name.
* @param x The output image.
* @param type CCV_IO_ANY_FILE, accept any file format. CCV_IO_GRAY, convert to grayscale image. CCV_IO_COLOR, convert to color image.
* @param type CCV_IO_ANY_FILE, accept any file format. CCV_IO_GRAY, convert to grayscale image. CCV_IO_RGB_COLOR, convert to color image.
*/
/**
* @fn int ccv_read(const void* data, ccv_dense_matrix_t** x, int type, int size)
* Read image from a a region of memory that conforms a specific image format. This function has soft dependencies on [LibJPEG](http://libjpeg.sourceforge.net/) and [LibPNG](http://www.libpng.org/pub/png/libpng.html). No these libraries, no JPEG nor PNG read support. However, ccv does support BMP read natively (it is a simple format after all).
* @param data The data memory.
* @param x The output image.
* @param type CCV_IO_ANY_STREAM, accept any file format. CCV_IO_GRAY, convert to grayscale image. CCV_IO_COLOR, convert to color image.
* @param type CCV_IO_ANY_STREAM, accept any file format. CCV_IO_GRAY, convert to grayscale image. CCV_IO_RGB_COLOR, convert to color image.
* @param size The size of that data memory region.
*/
/**
Expand Down
28 changes: 22 additions & 6 deletions site/_doxygen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ def markdown_safe x
return x.gsub('_', '\_').gsub('|', '\|')
end

def remove_ulinks doc
# replace all ulink to be text
doc.search('ulink').each do |ulink|
ulink.replace Nokogiri::XML::Text.new(ulink.content, doc)
end
end


def merge_structs structs, para
structs_re = /[\w]+\_t/
matches = para.match structs_re
Expand All @@ -29,7 +37,17 @@ def output_function file, function
return structs if desc.length == 0
name = markdown_safe function.at('./name').content
file << "\n" + name + "\n" + ('-' * name.length) + "\n\n"
proto = function.at('./definition').content + function.at('./argsstring').content
case function['kind']
when 'function'
proto = function.at('./definition').content + function.at('./argsstring').content
when 'define'
proto = function.at('./name').content
defnames = Array.new
function.xpath('./param/defname').each do |defname|
defnames << defname.content.strip
end
proto = proto + '(' + defnames.join(', ') + ')' if defnames.length > 0
end
file << "\t" + proto + "\n\n" + markdown_safe(desc.join("\n\n")) + "\n"
params = function.xpath "./detaileddescription/para/parameterlist[@kind='param']/parameteritem"
file << "\n" if params.length > 0
Expand Down Expand Up @@ -118,6 +136,7 @@ def open_and_output_struct out_structs, file, structname, doc_group, dirname
doc_group.xpath('./innerclass').each do |innerclass|
if innerclass.content.strip == structname
doc = Nokogiri::XML(open(dirname + '/' + innerclass['refid'] + '.xml'))
remove_ulinks doc
structs = output_struct file, structname, doc.at('./doxygen/compounddef')
structs = structs - out_structs
out_structs.merge structs
Expand All @@ -138,10 +157,7 @@ def open_and_output_struct out_structs, file, structname, doc_group, dirname

doc = Nokogiri::XML(open ARGV[0])

# replace all ulink to be text
doc.search('ulink').each do |ulink|
ulink.replace Nokogiri::XML::Text.new(ulink.content, doc)
end
remove_ulinks doc

doc_group = doc.at './doxygen/compounddef'

Expand All @@ -163,7 +179,7 @@ def open_and_output_struct out_structs, file, structname, doc_group, dirname

file << "\n" + para.content.strip.capitalize + "\n" if para != nil

functions = doc_group.xpath ".//memberdef[@kind='function']"
functions = doc_group.xpath ".//memberdef[@kind='function'] | .//memberdef[@kind='define']"
out_structs = Set.new
functions.each do |function|
structs = output_function file, function
Expand Down
4 changes: 2 additions & 2 deletions site/_posts/0000-01-01-ccv-io.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Read image from a file. This function has soft dependencies on [LibJPEG](http://

* **in**: The file name.
* **x**: The output image.
* **type**: CCV\_IO\_ANY\_FILE, accept any file format. CCV\_IO\_GRAY, convert to grayscale image. CCV\_IO\_COLOR, convert to color image.
* **type**: CCV\_IO\_ANY\_FILE, accept any file format. CCV\_IO\_GRAY, convert to grayscale image. CCV\_IO\_RGB\_COLOR, convert to color image.

ccv\_read
---------
Expand All @@ -42,7 +42,7 @@ Read image from a a region of memory that conforms a specific image format. This

* **data**: The data memory.
* **x**: The output image.
* **type**: CCV\_IO\_ANY\_STREAM, accept any file format. CCV\_IO\_GRAY, convert to grayscale image. CCV\_IO\_COLOR, convert to color image.
* **type**: CCV\_IO\_ANY\_STREAM, accept any file format. CCV\_IO\_GRAY, convert to grayscale image. CCV\_IO\_RGB\_COLOR, convert to color image.
* **size**: The size of that data memory region.

ccv\_read
Expand Down
10 changes: 10 additions & 0 deletions site/_posts/0000-01-01-ccv-util.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,13 @@ ccv\_contour\_free
Free up the contour object.

* **contour**: The contour.

ccv\_array\_get
---------------

ccv_array_get(a, i)

Get a specific element from an array

* **a**: The array.
* **i**: The index of the element in the array.
12 changes: 12 additions & 0 deletions site/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.PHONY: all site doc clean

all: site

site: doc
jekyll build

doc:
cd .. && doxygen .doxygen.conf && cd site && ./_doxygen.sh

clean:
rm -f _site/* _doxygen/*

0 comments on commit 0689a2a

Please sign in to comment.