Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Inconsistency in sf::Image::copy  (Read 3089 times)

0 Members and 1 Guest are viewing this topic.

emlai

  • Newbie
  • *
  • Posts: 5
    • View Profile
Inconsistency in sf::Image::copy
« on: July 21, 2016, 02:25:20 pm »
sf::Image::copy allows the images to overlap like this (red is the target image, green is the source image):



but not like this:



I think this behavior is inconsistent. Is there a rationale for this or is this just an oversight?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Inconsistency in sf::Image::copy
« Reply #1 on: July 21, 2016, 02:29:18 pm »
Overlap where, when, what? Are you talking about source/destination rectangles here with your images? What is the red rectangle, what is the green rectangle?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

emlai

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Inconsistency in sf::Image::copy
« Reply #2 on: July 21, 2016, 02:38:49 pm »
What is the red rectangle, what is the green rectangle?

Please read the post.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Inconsistency in sf::Image::copy
« Reply #3 on: July 21, 2016, 03:01:12 pm »
Please read this.


SFML / OS X developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Inconsistency in sf::Image::copy
« Reply #4 on: July 21, 2016, 03:02:50 pm »
The right/bottom tests are implemented here. Seems like left/top would just need a similar test to make your second example work.
Laurent Gomila - SFML developer

emlai

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Inconsistency in sf::Image::copy
« Reply #5 on: July 21, 2016, 03:32:36 pm »
Seems like left/top would just need a similar test to make your second example work.

In addition to that the destX and destY parameters would need to be int, rather than unsigned int.

GameBear

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
    • Email
Re: Inconsistency in sf::Image::copy
« Reply #6 on: July 21, 2016, 04:21:09 pm »
since x_y coords in c++ goes like this:
--->
|
v

your first image shows the green image being added at a positive X and y coordinate on the red image
but the second shows it being added at a negative coordinate. said coordinate could be out of bounds for the image. (eg, you are trying to draw outside of the paper)

just my thoughts....
string message = "some random dude";
cout << "I'm just " << message;

 

anything