<commit_before>/*
 * Copyright (c) 2016 - sikulix.com - MIT license
 */

package com.sikulix.api;

import com.sikulix.core.Content;
import com.sikulix.core.SX;
import com.sikulix.core.SXLog;
import org.opencv.core.*;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
import java.util.List;

public class Picture extends Element {

  private static eType eClazz = eType.PICTURE;
  private static SXLog log = SX.getLogger("SX." + eClazz.toString());

  //<editor-fold desc="*** construction">
  public Picture() {
  }

  protected void setClazz() {
    clazz = eClazz;
  }

  protected void copy(Element elem) {
    if (elem.hasContent()) {
      setContent(elem.getContent().clone());
    } else {
      setContent(new Mat());
    }
    urlImg = elem.urlImg;
    setName(elem.getName());
    setAttributes();
  }

  protected void initAfter() {
    initName(eClazz);
  }

  public Picture(BufferedImage bimg) {<commit_msg>fixed: Picture(Picture): copy w, h<commit_after>/*
 * Copyright (c) 2016 - sikulix.com - MIT license
 */

package com.sikulix.api;

import com.sikulix.core.Content;
import com.sikulix.core.SX;
import com.sikulix.core.SXLog;
import org.opencv.core.*;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
import java.util.List;

public class Picture extends Element {

  private static eType eClazz = eType.PICTURE;
  private static SXLog log = SX.getLogger("SX." + eClazz.toString());

  //<editor-fold desc="*** construction">
  public Picture() {
  }

  protected void setClazz() {
    clazz = eClazz;
  }

  protected void copy(Element elem) {
    w = elem.w;
    h = elem.h;
    if (elem.hasContent()) {
      setContent(elem.getContent().clone());
    } else {
      setContent(new Mat());
    }
    urlImg = elem.urlImg;
    setName(elem.getName());
    setAttributes();
  }

  protected void initAfter() {
    initName(eClazz);
  }

  public Picture(BufferedImage bimg) {
{'fraction_non_alphanumeric': 0.1368421052631579, 'fraction_numerical': 0.003368421052631579, 'mean_word_length': 3.667976424361493, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2755145', 'n_tokens_mistral': 847, 'n_tokens_neox': 825, 'n_words': 180}