This is the sample program that can see the decode result of barcode data on Watson IoT.

Dependencies:   AsciiFont DisplayApp GR-PEACH_video LCD_shield_config LWIPBP3595Interface_STA_for_mbed-os USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ResultPoint.h Source File

ResultPoint.h

00001 // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
00002 #ifndef __RESULT_POINT_H__
00003 #define __RESULT_POINT_H__
00004 
00005 /*
00006  *  ResultPoint.h
00007  *  zxing
00008  *
00009  *  Copyright 2010 ZXing authors All rights reserved.
00010  *
00011  * Licensed under the Apache License, Version 2.0 (the "License");
00012  * you may not use this file except in compliance with the License.
00013  * You may obtain a copy of the License at
00014  *
00015  *      http://www.apache.org/licenses/LICENSE-2.0
00016  *
00017  * Unless required by applicable law or agreed to in writing, software
00018  * distributed under the License is distributed on an "AS IS" BASIS,
00019  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00020  * See the License for the specific language governing permissions and
00021  * limitations under the License.
00022  */
00023 
00024 #include <zxing/common/Counted.h>
00025 #include <vector>
00026 
00027 namespace zxing {
00028 
00029 class ResultPoint : public Counted {
00030 protected:
00031   const float posX_;
00032   const float posY_;
00033   
00034 public:
00035   ResultPoint();
00036   ResultPoint(float x, float y);
00037   ResultPoint(int x, int y);
00038   virtual ~ResultPoint();
00039 
00040   virtual float getX() const;
00041   virtual float getY() const;
00042 
00043   bool equals(Ref<ResultPoint> other);
00044 
00045   static void orderBestPatterns(std::vector<Ref<ResultPoint> > &patterns);
00046   static float distance(Ref<ResultPoint> point1, Ref<ResultPoint> point2);
00047   static float distance(float x1, float x2, float y1, float y2);
00048 
00049 private:
00050   static float crossProductZ(Ref<ResultPoint> pointA, Ref<ResultPoint> pointB, Ref<ResultPoint> pointC);
00051 };
00052 
00053 }
00054 
00055 #endif // __RESULT_POINT_H__