OSDN Git Service

create cameraHost
[vem/vem.git] / tool / imageProc.rb
index d752286..6053607 100644 (file)
@@ -26,6 +26,20 @@ module ImageProc
     return out_image_array
   end
 
-  def write_array
+  def write_array(image_array)
+    image_length = image_array.length
+
+    image_array_eos = "2 #{image_length} #{image_length}\n"
+      image_length.times do |x|
+        image_length.times do |y|
+          if(y==(image_length-1))
+            image_array_eos <<  "#{image_array[x][image_length-x-1]}\n"
+          else
+            image_array_eos <<  "#{image_array[y][image_length-x-1]} "
+          end
+        end
+    end
+      return image_array_eos
   end
+
 end