• Implementation of Vue underlying compilation


    KVE source code //Expectant usage // new KVue({ // data:{msg:’hello’} // }) class KVue { constructor(options) { this.$options = options; //Processing data options this.$data = options.data; //Responsive this.observe(this.$data); // new Watcher(); // this.$data.test; // new Watcher(); // this.$data.foo.bar; new Compile(options.el, this); if (options.created) { options.created.call(this); } } observe(value) { if (!value || typeof value !== […]

  • Python opencv bilinear interpolation example


    I will not say much nonsense, directly on the code! #coding=utf-8 import cv2 import numpy as np Bilinear interpolation img = cv2.imread(‘timg.jpeg’, cv2.CV_LOAD_IMAGE_GRAYSCALE) # load the gray image cv2.imwrite(‘img.jpg’, img) h, w = img.shape[:2] # shrink to half of the original a1 = np.array([[0.5, 0, 0], [0, 0.5, 0]], np.float32) d1 = cv2.warpAffine(img, a1, (w, […]

  • The coordinates of image reading in OpenCL


    This paper tests two problems about coordinates when reading image data in OpenCL Using float2 coordinates to read Using INT2 coordinates to read First of all, the complete test code is as follows. The test platform is sdm855 #include #include #include #include #include “OCL/OPPOOpenCLWrapper.h” #include “OCL/OCLUtils.h” #ifndef uchar #define uchar unsigned char #endif const char […]

  • On premultiplied alpha and non premultiplied alpha


    1、 Alpha synthesis / alpha synthesis / transparent synthesis In the field of computer graphics, alpha compositing is a process of combining image with background, which can produce partially transparent or completely transparent visual effect. The color information of each pixel is recorded in the two-dimensional image, and the additional information is represented by the […]

  • Different CSS, basic use of SASS (SCSS)


    Preface Main records of this articlesassOfscssBasic use of grammar.sassyescssIt extends the definition of variables, condition control, loops, custom methods and so on that are not available in CSS. Basic content 1. variable /*scss*/ //Declare variables $primary-color:#1269b5; //Using variables div.box{ background-color: $primary-color; } /*css*/ div.box{ background-color:#1269b5; } 2. nesting Progeny /*scss*/ .nav { height: 100px; ul […]

  • Loops in Vue and modifying difference expressions


    0828 self summary I. cycles in Vue v-for Common 4 general information The first kind Second kinds of species Third kinds of species Fourth kinds of species If the object is a dictionary, the index of the common list array type is empty Separator in Vue (modify difference expression) delimiters For instance [[ msg }} […]